redux-utilities / redux-actions

Flux Standard Action utilities for Redux.
https://redux-actions.js.org
MIT License
6.51k stars 301 forks source link

Non-es-modules dependencies #322

Open alxdnlnko opened 6 years ago

alxdnlnko commented 6 years ago

Hello. I'm trying to use redux-actions in Polymer 3 project with module imports (without any browserify compilation), but redux-actions depends on some libraries, that doesn't provide module exports, for example: invariant and lodash.camelcase.

So i'm getting such errors: Uncaught SyntaxError: The requested module '../../../lodash.camelcase/index.js' does not provide an export named 'default'

I tried to fork invariant and added the es-module there, and it worked ok. Lodash can be substituted with lodash-es.

But does redux-actions really have to depend on theese libraries? invariant and camelcase are not so big functions and can be simply included in redux-actions, this would make the redux-actions more independent.

ghost commented 6 years ago

@alxdnlnko I'm in the same situation... what do you mean by 'fork invariant and added the es-module there'? Thanks.

alxdnlnko commented 6 years ago

@andreabioli, there are three ways of solving this problem:

  1. remove "bad" dependencies (fork redux-actions on github, make pull request and wait it to be merged and published)
  2. fix "bad" dependencies (fork all "bad" dependencies projects, fix them, make pull requests and wait them all to be merged and published)
  3. not using redux-actions until somebody do one of previous options :)

I choose the 3 way, because I have no time to wait. Just made myself some tiny util-functions (like createAction) in my project.

ghost commented 6 years ago

@alxdnlnko Oh, this is really what I call 'pragmatism'! :-) I will follow the same, then... :-) Thanks again!