| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
cc @nodejs/modules-active-members; not sure this is something we've previously discussed |
Sorry, something went wrong.
|
would you mind terribly removing the chaining commit? that's a larger thing we have to deal with for all loaders. |
Sorry, something went wrong.
|
@devsnek done. note even in the first commit Loader#_transformSource holds an array rather than an undefined or single function, so once it's possible to have multiple --loader arguments the transformSource will automatically support chaining. Do you want this changed as well? |
Sorry, something went wrong.
There was a problem hiding this comment.
Thanks for pushing something like this. It's been a gap for a while.
What about JSON / Wasm and binary files? Should this instead be called moduleTransform then?
A fetch hook that can return binary would apply to all formats, so you can get Wasm, JSON and CJS through patching the CJS loader. Yes, applying to Node binaries is harder, but that's the main exception then.
Personally I would prefer to see that sort of approach to a transform.
Sorry, something went wrong.
|
@guybedford renaming to moduleTransform or maybe transformModuleSource could make sense as this implementation supports ES modules only. An earlier attempt at this feature allowed resolve hooks to provide a fetchSource property, but this cannot effectively support chained transforms. Keeping fetch and transform separate makes it possible to support multiple --loader options each providing a transform to be run in sequence. I think a fetch hook is a good idea but a separate feature. |
Sorry, something went wrong.
|
I think this needs more abstract design work before we start throwing more hooks in. |
Sorry, something went wrong.
|
I've labeled this "work in progress" but comment or remove that label if it's not appropriate. I'd prefer a bit more detail in the commit message if possible. |
Sorry, something went wrong.
|
Oh wow I didn't even know that this PR was here. |
Sorry, something went wrong.
|
@GeoffreyBooth I dropped the ball on this, other priorities unfortunately took over. I really appreciate the effort you took to get the transform hook implemented and merged! |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Checklist