profile
viewpoint

Ask questionsLoader Hooks

Hooking into the dependency loading steps in Nodejs should be easy, efficient, and reliable across CJS+ESM. Loader hooks would allow for developers to make systematic changes to dependency loading without breaking other systems.

It looks like discussion on this topic has died down, but I'm really interested in loader hooks and would be excited to work on an implementation! There's of prior discussion to parse through, and with this issue I'm hoping to reignite discussion and to create a place for feedback.

Some of that prior discussion:


edit (mylesborins)

here is a link to the design doc

https://docs.google.com/document/d/1J0zDFkwxojLXc36t2gcv1gZ-QnoTXSzK1O6mNAMlync/edit#heading=h.xzp5p5pt8hlq

nodejs/modules

Answer questions reasonablytall

Based on discussion in #386, to prevent blocking unflagging esm we should create a flag that enables the current (and future) experimental --loader feature.

I propose adding an --experimental-loaders flag that enables the use of the --loader option.

I also figure that --experimental-loaders shouldn't be required when --experimental-modules is set, thereby offsetting the need for a user to set --experimental-loaders until esm is unflagged. I'd appreciate thoughts on that.

I'll have a PR for this by Friday, given no objections.

useful!

Related questions

Transition Path Problems For Tooling hot 1
Proposal: Support loading package by own "name" hot 1
JSON modules are being reverted on web hot 1
Out-of-Band Meeting Proposal hot 1
node v13.0-v13.1 errors on require of a module with "exports" defined hot 1
Use consistent error codes for MODULE_NOT_FOUND hot 1
Out-of-Band Meeting Proposal hot 1
Proposal: Support loading package by own "name" hot 1
Github User Rank List