-
Notifications
You must be signed in to change notification settings - Fork 30
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
Don't use parser for Node v22? #89
Comments
From my testing, the parser is only required for |
Regular Node.js import can handle cyclic dependencies but dynamic import cannot. Yeah it really is only the openai test that fails and needs the parser. It's strange that the same test now passes in v22. I can't find anything in the release notes that would suggest this limitation has been removed. |
That doesn't seem to be strictly true. Adding
It's failing but with a 0 exit code :) If you add a |
Ah that's a shame, I missed that entirely and only noticed the tests all passing 😭
That means we could potentially perform |
Testing on top of PR #85, I found that for Node v22, the parser doesn't appear to be required and we can revert back to the faster path of
import(srcUrl).then(Object.keys)
.We would need the parser to support v18.19 -> v21.
We could reduce the potential bundle size caused by the parser (~100KB) by:
package.json#engines
to the Node versions where it's requiredoptionalDependency
ofimport-in-the-middle
import('import-in-the-middle-parser')
inhook.js
in a try/catchWhen installed with Node versions requiring the parser, the optional dependency will be installed and used.
When installed with Node v22+, the optional dependency will be missing and will not be included in any bundle
The text was updated successfully, but these errors were encountered: