Maël Nison
Maël Nison
> Now if I would have two of these functions, one that can read package.json from zip files and another that can resolve js imports back to typescript source files,...
What's the use case? I can see why accessing the first loader is useful (to reset the resolution), but I don't immediately see why the last one is 🤔
> I'm thinking about a situation where one loader needs to augment the behavior of a helper function, and another loader needs to pass an implementation of that helper function...
Fwiw my thinking for virtual filesystems is that we would be able to override `node:fs` the same way as the hooks. One note: perhaps it'd be simpler if the helpers...
> Ideally node would provide this API so we don't need to ship a copy of logic that is already within node's binary. To support this with another example, Yarn...
I think I'd need to see what this helper API would look like - I'm worried if every loader has to reimplement the whole `resolve` they'll quickly start conflicting (or...
Updated this PR to be mentioned in the chaining proposals, as per https://github.com/nodejs/loaders/issues/48#issuecomment-955494126. Should be ready for review.
> should there be an example of each of these and how they might work together in a chain? (resolve and load have them) Speaking of that, I wonder if...
> if a `load` hook calls `fs.readFile`, it can’t call the a chain of `readFile` hooks because then you have code from all registered loaders executing while you’re still in...
I opened an implementation draft on the Node repository: https://github.com/nodejs/node/pull/41076