Repository navigation
Description
What is the problem this feature will solve?
Text modules (import text from './file.txt' with { type: 'text' }) landed in #62300 behind --experimental-import-text and are documented as Stability 1.0 (Early development). They have shipped in 26.x and were backported to 24.19.0.
The flag makes the feature hard to use in practice. Libraries can't rely on it, because they would have to tell every consumer to pass a CLI flag. #65210 also showed that the flag gate affects userland loaders that handle type: 'text' themselves. #64992 fixed that, but it's a sign that "on behind a flag" and "off" are two separate behaviours that loader authors have to keep in mind.
Standards status:
- tc39/proposal-import-text is at Stage 3 (since March 2026).
- The test262 tests (Add tests for Import Text proposal tc39/test262#4607) and the HTML integration (Add text imports whatwg/html#11933) have both merged.
What is the feature you are proposing to solve the problem?
Remove the flag requirement while keeping the feature experimental, following what was done for JSON modules. JSON modules were unflagged in #41736 (v17.5.0) while import assertions were still Stage 3, and were only marked stable in #55333 after the proposal reached Stage 4.
Concretely:
- Stop gating on
--experimental-import-textinlib/internal/modules/esm/assert.jsandlib/internal/modules/esm/get_format.js. - Keep the existing
emitExperimentalWarning('Text import')in thetexttranslator. - Turn
--experimental-import-textinto aNoOpoption, like--experimental-json-modules, so existing scripts keep working. - Move the docs to Stability 1.1 (Active development).
- Update the tests:
test-esm-import-text-disabled.mjswould need to change or be removed.
Question for @nodejs/loaders: are there open semantics questions (BOM handling, non-UTF-8 sources, the text/plain charset regex in mimeToFormat) that should be settled first?
If there's agreement, I'm happy to send the PR.
Activity
nicolo-ribaudo commentedon Nov 19, 2026
This is on the agenda for Stage 4 at the TC39 meeting in two weeks: https://github.com/tc39/agendas/blob/main/2026/11.md