- Recording: https://www.youtube.com/watch?v=AYDPTaZXl74
- GitHub Issue: #6
- Geoffrey Booth, @GeoffreyBooth
- Bryan English, @bengl
- Jacob Smith, @JakobJingleheimer
- Andrew Bradley, @cspotcode
- Bradley Farias, @bmeck
- Stephen Belanger, @qard
- Extracted from loaders-agenda labeled issues and pull requests from the nodejs org prior to the meeting.
- Almost done, just needs approvals from Guy, Geoffrey; needs Derek to drop his blocking review which is out of date.
- This PR completes merging the hooks into resolve and load and globalPreloadCode; format can optionally be returned from resolve. Includes test cases for when format is included and when it’s not.
- The PR: simplifies the hooks to
resolve
,load
andglobalPreloadCode
. Refactors the internal Node ESM loader’s hooks intoresolve
andload
. Refactors Node’s internal ESM loader to move its exception on unknown file types from withinresolve
(on detection of unknown extensions) to withinload
(if the resolved extension has no defined translator).
- Discussion of using done() to short-circuit, where not calling done() means that the next loader is called. So the default would be that every loader runs and short circuiting is the exception, rather than under next() where doing nothing causes a short circuit and calling next() continues the chain.
- Skepticism; concerns over how to get the result of Node’s default hooks, since Node’s would seem to always be last.
- Left off that Jacob would take the examples in /~https://github.com/nodejs/loaders/blob/main/doc/design.md and write new versions of them that use the done() API, to show how it would work and handle these use cases.