-
Notifications
You must be signed in to change notification settings - Fork 8
Import Maps review #13
Comments
The @nodejs/modules group has discussed it many times; it's definitely going to be useful for node's integration of ESM. |
Couldn't find specific references on the proposal but from what I can find looks like @bmeck is setting up a meeting to discuss specifically about this: nodejs/modules#231 |
@ljharb Do you know where we can find notes from these discussions? Has any feedback from the modules team made it back to the import-maps proposal? |
Notes are here: https://github.com/nodejs/modules/tree/master/doc/meetings, discussed under "package name maps", "import maps", and "module maps", as the name has changed over time. I'm pretty confident there's been lots of communication between @domenic and the modules group - @MylesBorins and @bmeck can probably best speak to that. |
Thanks, @ljharb ! Glad this has been receiving detailed review already. |
Has there been discussion in the modules team about the optimization I noted in the beginning of this thread? I'm having trouble finding any references to that in the notes. |
I have been working on a proposal of a "stat-less public interface" for bare specifiers: https://github.com/jkrems/proposal-pkg-exports/blob/master/README.md#packagejson-interface. Important to note that this is still being discussed. But the idea is that it would allow generating a complete import map offline from a (*) There still might be some for finding "package boundaries" that are used to load additional meta data. But that can happen after the URL is resolved. |
@domenic's import maps proposal defines a JSON format to map from "bare" module specifiers to the URL where the module lives. This mapping can also be used to polyfill/virtualize built-in modules.
Although the proposal was originally designed with the web in mind, it may be useful within Node.js as well: a map to point to the particular path of an import could reduce the number of
stat
calls needed to locate it, which could improve startup time on platforms where that operation is expensive.@joyeecheung told me this optimization a frequently requested feature in Node's module system, which is typically rejected due to the existing complexity of module loading. Maybe a standard solution could be more sustainable than yet another edge case.
What do you think of the import maps proposal? Would it make sense within Node? If it makes sense, how should it be integrated into
require
or ESM support?The text was updated successfully, but these errors were encountered: