DEV: Stop storing theme-transpiler on filesystem in development (#28198)

We were writing theme-transpiler JS files to the filesystem on a per-process basis, and then immediately reading them back in. Plus, there was no cleanup mechanism, so the tmp directory would grow indefinitely.

This commit refactors things so that the `build.js` script outputs the theme-transpiler source to stdout. That way, we can read it directly into the process, and then into mini-racer, without needing to go via the filesystem. No cleanup required!

In production, the theme-transpiler is still cached in a file during `assets:precompile`
This commit is contained in:
David Taylor
2024-08-01 17:59:34 +01:00
committed by GitHub
parent 87450f677b
commit 11369018b6
4 changed files with 16 additions and 20 deletions

View File

@ -321,7 +321,7 @@ task "assets:precompile:compress_js": "environment" do
end
task "assets:precompile:theme_transpiler": "environment" do
DiscourseJsProcessor::Transpiler.build_theme_transpiler
DiscourseJsProcessor::Transpiler.build_production_theme_transpiler
end
# Run these tasks **before** Rails' "assets:precompile" task