pauldijou / redux-act

An opinionated lib to create actions and reducers for Redux

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Adding a package JSON "module": "src/index.js" is breaking change

LucaMele opened this issue · comments

commented

I saw that between 1.7.7 and 1.7.8 a new package JSON "module": "src/index.js" has been added.

This changes how build systems (bundlers) read out the NPM Module and therefore is a change in the "interface" between your node module and our bild system, ergo breaking change and accordingly to semver you should release a major. In releasing a major version you prevent all other npm modules to automatically take the newest minor and patch version which is a default behaviour of NPM

On Our side we have WebPack that now reads this instead of the main field which points at lib.

The src is NOT transpiled and not recommended anyway for build exports. It is ES8 and not all bundlers can deal in transpiling all community based node modules

commented

Similar as: #107

Really sorry about that. Change has been rollbacked 1.7.9. Will use #107 so track how to re-enable it correctly.

@LucaMele I'm working on ESM support right now and I better understand my mistake: only import / export should be preserved, all other modern syntaxes should still be transpiled.

Considering that, if fixed, would it still need a major release in your opinion? It does change the "interface" as you said, but if it's done respecting what "module" is supposed to expose (which, again, I failed on my 1st try), then I don't see it as a breaking change. It will "just work" for bundlers that are ready to use it / want to take advantage of that.

commented

Hello @pauldijou, if you export module as esm as you described I think is not major cause yes the interface changes but it should be equal as before for bundlers. But yeah taken strictly it is a major, but agree that can be minor if is esm