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
feat: move from CJS to ESM #2566
base: master
Are you sure you want to change the base?
Conversation
|
this is an unreasonably large change which does a few things: - Moves all packages to `type: "module"` - Removes `node-fetch` (ran into problems in ESM-land) - Replaces all `__dirname` with an equivalent using `import.meta` - Replaces all `require.resolve` with `import.meta.resolve` - Update all imports to be ESM-compatible - Move all `tsconfig` to use `nodenext` resolution Probably some other stuff too.
70dd2e3
to
aa809a7
Compare
I think a good way forward is to create a |
Actually I forgot I just commented out some tests in that PR. I gotta get those fixed first. |
Ended up fixing this. I've pushed my PR to the If you rebase this PR against |
i haven't had chance to look yet what you've done. it sounds like you've done a lot of what i've done here, but the shorter route (e.g. i went all in on this branch instead so its probably less likely to land. for example:
e.g. there's also some type errors in rollup's plugins in maybe you haven't had to tackle either way, i don't think you can just hope to rebase this branch onto yours. you first need to fully understand whats in your branch vs whats in my branch, so we know what exactly we're trying to take from each IMO. |
@koddsson where shall I post bugs found in the canary release? |
I think just a issue would be great :) |
What is your plan in releasing this? A separate issue I think is better for what is already released which is not the case here. |
this is an unreasonably large change which does a few things:
type: "module"
node-fetch
(ran into problems in ESM-land)__dirname
with an equivalent usingimport.meta
require.resolve
withimport.meta.resolve
tsconfig
to usenodenext
resolutionProbably some other stuff too.
@koddsson if your branch is cleaner, and easier to review etc etc just let me know. im happy to throw this away, it was still a learning experience and i did go upstream to fix a few dependencies we have to make them work in
nodenext
.ah yeah and it'll be outdated, probably a truckload of conflicts but i can update if we want it