Skip to content

Latest commit

 

History

History
39 lines (25 loc) · 2.05 KB

2021-05-28.md

File metadata and controls

39 lines (25 loc) · 2.05 KB

Node.js Loaders Team Meeting 2021-05-28

Links

Present

  • Geoffrey Booth, @GeoffreyBooth
  • Bryan English, @bengl
  • Jacob Smith, @JakobJingleheimer
  • Andrew Bradley, @cspotcode
  • Bradley Farias, @bmeck
  • Stephen Belanger, @qard

Agenda

Announcements

  • Extracted from loaders-agenda labeled issues and pull requests from the nodejs org prior to the meeting.

nodejs/node

  • esm: consolidate ESM Loader methods #37468
  • module: ESM loader approach #36954

esm: consolidate ESM Loader methods

  • 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 and globalPreloadCode. Refactors the internal Node ESM loader’s hooks into resolve and load. Refactors 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).

module: ESM loader approach

  • 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.