-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
refactor(cli): migrate run and cache to new infrastructure #7996
Conversation
Can you elaborate what's the hurdle with dynamic imports? |
Because the module graph is the centre of the universe, it means that it tries to go get dynamic imports eagerly, when swc sees them, also, instead of waiting until they are demanded by the runtime. tsc also tries to use them in type checking, so we want to be able to eagerly fetch them. Which means we encounter all the errors there, during the building of the graph, instead when v8 attempts to loads them. This lead to errors not being catchable. I have fixed it now in my branch, basically making dynamic import resolutions in the graph non-errors, but as I said in our chat, I broke a few other things, but I think I know what happened there and am fixing that now. |
I am pretty happy with it now. It does include the breaking change that I am going back through issues that we said we wanted to address with this re-write and writing some test for them. At least one of them is not fixed and I am looking into what I can do to fix it at the moment. |
@bartlomieju I think I have addressed all your feedback... PTAL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, let's land it 🚀
Ref: #7225
Still a work in progress, the biggest challenge is with dynamic imports. I need to do some thinking about how best to integrate these in a way that is clean in the new infrastructure.
There is still a bit of cleanup and some more unit tests to write, but thought it was good enough. It is a ~420 LOC reduction at the moment, but there is certainly more that will be done when bundling can the runtime APIs move over.