Preamble as docs are just getting done
--import=module
Preload the specified module at startup.
Follows [ECMAScript module][] resolution rules.
Use [--require][] to load a [CommonJS module][].
Modules preloaded with --require will run before modules preloaded with --import.
Suggestion
🔍 Search Terms
ESM, moduleResolution
✅ Viability Checklist
My suggestion meets these guidelines:
⭐ Suggestion
detect if running in nodejs 19.1 if so drop moduleResolution support complete only keep classic and use require import respectively also inform the user that he should use customModule Resolution loaders via --import and require flags of nodejs 19.1 as 19.1 and onging will not get LTS that is total fine if he runs on such a environment he wants the feature else he would go for LTS.
He can then implement a function that he uses via --require[] --import[] before frozzen intrensics to offer custom module resolution based on what he needs also the resolution is shareAble via IPC or any guess able other Interfaces that a ECMAScript context supplys at present this are implemented as pre started workers
- offer a fallback loader for people that want to keep the old typescript config driven module resolution but let them explicitly set that as flag this is cli only so the programmatic version can stay as is to get refactored into modules.
- offer a lot of docs and modules to interact with the ecosystem like modular implementations that can get reused in tsserver. prepare for more worker ipc loaders via new ReadableStream and WriteableStream (Yes the web stream methods) they are supported in nodejs 19.1 and the other contexts. and lead to the smallest amount of code that handels most of the dispatching logic and chain propagation out of the box so do not code own implementations.
📃 Motivating Example
endless reuseable usecases cross ecosystem drops moduleResolution from typescript scope makes typescript a consumer of a resolver that is context indipedent and agnostic.
so this would nudge Module Authors and make them aware of a solution that solves a lot of his problems at the root cause.
closes:
💻 Use Cases
Preamble as docs are just getting done
--import=modulePreload the specified module at startup.
Follows [ECMAScript module][] resolution rules.
Use [
--require][] to load a [CommonJS module][].Modules preloaded with
--requirewill run before modules preloaded with--import.Suggestion
🔍 Search Terms
ESM, moduleResolution
✅ Viability Checklist
My suggestion meets these guidelines:
⭐ Suggestion
detect if running in nodejs 19.1 if so drop moduleResolution support complete only keep classic and use require import respectively also inform the user that he should use customModule Resolution loaders via --import and require flags of nodejs 19.1 as 19.1 and onging will not get LTS that is total fine if he runs on such a environment he wants the feature else he would go for LTS.
He can then implement a function that he uses via --require[] --import[] before frozzen intrensics to offer custom module resolution based on what he needs also the resolution is shareAble via IPC or any guess able other Interfaces that a ECMAScript context supplys at present this are implemented as pre started workers
📃 Motivating Example
endless reuseable usecases cross ecosystem drops moduleResolution from typescript scope makes typescript a consumer of a resolver that is context indipedent and agnostic.
so this would nudge Module Authors and make them aware of a solution that solves a lot of his problems at the root cause.
--importflag nodejs/node#43942closes:
--importflag nodejs/node#43942exportsoutside of Node #50794💻 Use Cases