You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Text decoding should be specified for JS, JSON & text imports #117
ECMA-262 does not define how to parse a file into a module, when it's imported into JS. For browsers, this is defined by the HTML standard, which includes this:
Let sourceText be the result of UTF-8 decodingbodyBytes.
That applies for all imports, be it for JS modules, JSON modules, or the upcoming text modules.
For text modules, the intent in its HTML standard changes is to match the behaviour of Fetch's .text(), which already now mandates using the UTF-8 decode algorithm for all files.
I'd be surprised if some runtime wasn't currently at least detecting a BOM and potentially parsing UTF-16 content as UTF-16 rather than UTF-8.
Reacted by M.K., Owen Buckley, Kenta Moriuchi, Steven and Jacob Smith
this is a valid interop concern, but not in scope for the minimum common API (MCA) spec
the MCA specifies APIs required for confirming runtimes; it doesn't (currently) specify how hosts resolve/decode ES modules, etc. that would be appropriate in a different spec which defines module loading semantics (or potentially in a separate TC55 host integration effort), rather than in the MCA spec
edit: maybe it could be in scope for the MCA, but would fall outside the bounds of its current mandate of "defines a subset of Web Platform APIs for server runtimes to implement for interoperability with the web"
Activity
ctcpip commentedon Sep 25, 2026
this is a valid interop concern, but not in scope for the minimum common API (MCA) spec
the MCA specifies APIs required for confirming runtimes; it doesn't (currently) specify how hosts resolve/decode ES modules, etc. that would be appropriate in a different spec which defines module loading semantics (or potentially in a separate TC55 host integration effort), rather than in the MCA spec
edit: maybe it could be in scope for the MCA, but would fall outside the bounds of its current mandate of "defines a subset of Web Platform APIs for server runtimes to implement for interoperability with the web"
ctcpip commentedon Sep 25, 2026
related: #49
I guess we have to decide on whether/how to include #49, and then this issue becomes significantly more relevant