redux icon indicating copy to clipboard operation
redux copied to clipboard

Update build tooling to target modern environments

Open markerikson opened this issue 3 years ago • 3 comments

I'd like to see if we can start applying the principles from "ship modern JS" at https://web.dev/publish-modern-javascript/ . In particular, https://web.dev/publish-modern-javascript/#modern-with-legacy-fallback-and-esm-bundler-optimizations looks like the combo of settings we would want to use .

This is something we ought to try to get into 4.1 if possible.

markerikson avatar Mar 28 '21 18:03 markerikson

It looks like defining an exports field is considered a breaking change due to messing up Node usage. So, we should hold off on that.

I would like to see if I can at least move all of our build artifacts into dist. In theory that shouldn't be breaking because they should all be getting looked up via the appropriate package.json fields. The main thing would be to keep the dist/redux.min.js filename the same, because I see uses of that publicly via Unpkg:

https://stackoverflow.com/questions/60731097/use-redux-without-npm

markerikson avatar Apr 02 '21 16:04 markerikson

Any reason conditional exports wouldn't work for Node usage without breaking existing? https://nodejs.org/api/packages.html#packages_conditional_exports

Recently ran into an issue where a package I'm consuming in Node as ESM imports redux which then breaks because Node cannot resolve redux as an ESM

mattrunyon avatar Oct 07 '21 18:10 mattrunyon

I dunno :) I barely know enough about this topic as it is, and I just remember someone telling me that "adding an exports field is considered a breaking change that requires a major". I haven't had time to do more research on the topic.

markerikson avatar Oct 07 '21 18:10 markerikson

Oh hey this is finally done as of the 5.0 alphas!

markerikson avatar Apr 16 '23 19:04 markerikson