Should measure what performance effect this restriction has and see whether we should allow codegen to know whether it's generating an HTML file or a JS file.
After some preliminary benchmarking, the perf overhead actually seems quite small, but as I go for perf optimization, probably still worth cutting down on.
Quick Summary: Currently we to fix https://github.com/elm-lang/elm-make/issues/174, which is tracked from https://github.com/elm/compiler/issues/1377, we are sanitizing string literals according to https://html.spec.whatwg.org/multipage/scripting.html#restrictions-for-contents-of-script-elements. But this sanitization is unnecessary if we're outputting a
*.js
file instead of a*.html
file, since those restrictions exist only to get around the HTML parser.Should measure what performance effect this restriction has and see whether we should allow codegen to know whether it's generating an HTML file or a JS file.