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
Better interop with NodeJS-native ES Modules #75
Conversation
Awesome! I was just trying to figure out how to do this last night, using v3 of d3-transition as a starting point. Questions:
|
Thanks so much for your feedback!
I don’t think it’s absolutely necessary as long as we keep the D3 packages as regular dependencies, but it would probably improve support for tree shaking etc. However, I don't know enough of the specifics of D3 & jetpack to decide what ranges to pick for
Right now I'm mostly trying to get the current version to play nice with ES Modules in order to fix some tooling issues we have Datawrapper. So for now I’d be happy with a new minor version that provides the same exports as before, but in a way that can be properly handled by Node. @gka, what do you think? |
D3's API hasn't changed too much since being split into modules and jetpack doesn't hit too many edge cases; I think I'm not sure how modern javascript works, but I think peer dependencies of Merging this as is to fix the tooling issue also works; the major version bump can wait till d3's. |
@1wheel Hey Adam, thanks again for your feedback. I've added |
Motivation:
Make package work with modern NodeJS (native ES Modules)
Changes:
type
tomodule
so that NodeJS understands that.js
files are written in ES Module syntax.cjs
to trigger proper handling in NodeJS (specifically used in tests & exports)essentials
andselection
builds (ES Modules only — this mimics the previous behavior)tape
&jsdom
) to play nice with the new ES Module setup