-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Expose underlying hooks #215
Comments
Would the |
Amazing. Yes, it seems to handle everything, even conditions. I was also hoping to get access to the CJS load and it would even provide that. Currently I have that piece fudged. I'm closing these since they both seem covered. |
ghost
closed this as completed
Jul 14, 2024
This issue was closed.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Issue
My loader analyzes a full module graph during load to determine module shape (the set of exported names). Walking the whole graph is necessary because wildcard exports can add unspecified names. You've got to walk the full graph to determine the names for one module.
To ensure I'm using the full semantics of active CLI options, feature changes across versions, etc plus semantics changes provided by underlying loaders (such as TypeScript transpilation), I use the
nextResolve
andnextLoad
routines in the analysis. They're extracted by theresolve
andload
hooks.I see in the code that these routines actually mutate internal state for the particular import operation they were extracted from. Analysis for a single load may apply these routines to hundreds of modules with all different URLs and
context
properties. Analysis runs concurrently so many operations are in flight together. So far this doesn't seem to be causing problems, but I'm concerned it's an unsupported use and may break in the future.When attributes come into use, I wonder if they'll start to drift across concurrent operations.
Solution
My loader would like a supported way to run resolve and load of the underlying loaders, independent of any import operations, and capable of running concurrently. Maybe they could be passed to
initialize
.The text was updated successfully, but these errors were encountered: