![]() Support loading source when the return value of load has format: 'commonjs'. ![]() Provide a way to register loaders without a command-line flag, for example via a "loaders" field in package.json. If that turns out to be unachievable, however, then:Ĭonvert resolve from async to sync nodejs/node#43363Ĭonsider an API for async operations before resolution begins, such as preImport #89 We hope that moving loaders off thread will allow us to preserve an async resolve hook while supporting the sync API. Implement chaining as described in the design, where the default becomes next and references the next registered hook in the chain. Refactor Node’s internal ESM loader to move its exception on unknown file types from within resolve (on detection of unknown extensions) to within load (if the resolved extension has no defined translator). Node’s internal loader already has no-ops for transformSource and getGlobalPreloadCode, so all this really entails is wrapping the internal getFormat and getSource with one function load ( getFormat is used internally outside ESMLoader, so they cannot merely be merged). Refactor the internal Node ESMLoader hooks into resolve and load. (Outside of loaders scope, but related to the goal of parity between CommonJS and ESM, is finishing and stabilizing -experimental-vm-modules.)įinish nodejs/node#37468 / nodejs/node#35524, simplifying the hooks to resolve, load and globalPreloadCode. Projectīefore extending into new frontiers, we need to improve the loaders API enough that users can do just about everything they could do in CommonJS with ESM + loaders. We aim to implement the use cases that went unfulfilled by the initial ES modules implementation that can be achieved via loaders. This team is spun off from the Modules team. The Node.js Loaders Team maintains and actively develops the ECMAScript Modules Loaders implementation in Node.js core.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |