joshburgess / redux-most

Most.js based middleware for Redux. Handle async actions with monadic streams & reactive programming.
https://www.npmjs.com/package/redux-most
MIT License
139 stars 14 forks source link

Fix commonjs build #15

Closed vlad-zhukov closed 7 years ago

vlad-zhukov commented 7 years ago

Files under lib/ use ES modules instead of commonjs. This is a simple fix, but I can later simplify the whole build process if you want.

Also should I add tests for this?

joshburgess commented 7 years ago

Did me setting up tree shaking (setting modules: false) break the cjs build? Yes, tests would be good! Sorry :( Is a fix required for the ES build also?

vlad-zhukov commented 7 years ago

Setting modules: false disables module transformation, so they will stay as in source files. ES build is fine.

joshburgess commented 7 years ago

@Vlad-Zhukov Okay. Yeah, could we get testing and also do a PR into the dev branch instead of master? I just recently created that dev branch to try to add a little safety until we get CI setup.

joshburgess commented 7 years ago

I tested this and saw that it works. I'm going to go ahead and merge the request now, so that I can publish a new build, but can you add tests in a new PR when you get a chance? @Vlad-Zhukov

joshburgess commented 7 years ago

@Vlad-Zhukov I've published updates. Please, see some changes I made. I had to change BABEL_ENV=cjs to BABEL_ENV=umd in the umd build scripts so that tree shaking would continue to work. ("modules": false is required for tree shaking to work).

Also, even though I didn't have to, I created 3 separate configs in .babelrc, one each for cjs, es, & umd in order to be explicit about what each needs.

Let me know about testing and your ideas about simplifying the build process.

vlad-zhukov commented 7 years ago

@joshburgess I had a thought about producing all bundles with a single command but now I think it's better leave it as it is right now. I guess I'll just clean up configs a little for now.

vlad-zhukov commented 7 years ago

I added simple tests (see Vlad-Zhukov/redux-most#4c36e80) for bundles but they don't work because babel-register transforms other files as well. Not sure how to properly fix this as I have no experience with ava.