Skip to content

Use ES5 compatible camelcase library. #309

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

Merged
merged 2 commits into from
Jul 25, 2018

Conversation

nowells
Copy link
Contributor

@nowells nowells commented Jul 25, 2018

Fixes #308

@@ -7,5 +7,5 @@ export default type =>
? camelCase(type)
: type
.split(namespacer)
.map(camelCase)
.map(part => camelCase(part))
Copy link
Contributor Author

@nowells nowells Jul 25, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

due to camelCase accepting multiple arguments, and map providing the index as a second argument, and entire array as 3rd.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure about this? We had it like this before as well with camelCase from lodash.

@@ -12,6 +12,7 @@ module.exports = {
library: 'ReduxActions',
libraryTarget: 'umd'
},
devtool: 'sourcemaps',
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

makes the UMD non-minified bundle not be eval sourcemaps.

@codecov
Copy link

codecov bot commented Jul 25, 2018

Codecov Report

Merging #309 into master will increase coverage by 0.03%.
The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff            @@
##           master   #309      +/-   ##
========================================
+ Coverage   95.96%    96%   +0.03%     
========================================
  Files          24     24              
  Lines         124    125       +1     
  Branches       37     37              
========================================
+ Hits          119    120       +1     
  Misses          4      4              
  Partials        1      1
Impacted Files Coverage Δ
src/utils/camelCase.js 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3bc36a2...9459d17. Read the comment docs.

@@ -61,6 +61,10 @@ acorn@^5.0.0, acorn@^5.3.0, acorn@^5.5.0:
version "5.5.3"
resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.5.3.tgz#f473dd47e0277a08e28e9bec5aeeb04751f0b8c9"

acorn@~5.4.0:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't usually use yarn so I have no clue if I updated this properly (just letting yarn add do it's thing)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything good.

package.json Outdated
"build:umd": "cross-env NODE_ENV=development webpack",
"build:umd:min": "cross-env NODE_ENV=production webpack",
"build:umd": "cross-env NODE_ENV=development webpack && es-check es5 dist/redux-actions.js",
"build:umd:min": "cross-env NODE_ENV=production webpack && es-check es5 dist/redux-actions.min.js",
Copy link
Contributor Author

@nowells nowells Jul 25, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I confirmed that this failed before my change (NOTE: it passed on the unminified before due to eval sourcemaps obscuring the actual code which is why I added the sourcemap option below)

@timche
Copy link
Member

timche commented Jul 25, 2018

Thanks a lot for this PR! Would it be possible if we can remove es-check again? Because we'd need to add devtool otherwise. We can revisit it afterwards to make UMD builds ES5 compatible. As for now lodash.camelcase is safe to use in the browser.

@nowells
Copy link
Contributor Author

nowells commented Jul 25, 2018

Thanks a lot for this PR! Would it be possible if we can remove es-check again? Because we'd need to add devtool otherwise. We can revisit it afterwards to make UMD builds ES5 compatible. As for now lodash.camelcase is safe to use in the browser.

Want me to just remove devtool and only test against the minified version with es-check? Or just remove es-check entirely (and devtool). Totally up to you. Just wanted to add some automated tests around this for future safety.

@timche
Copy link
Member

timche commented Jul 25, 2018

Yeah, just replace the package.

@timche timche merged commit e6dbdee into redux-utilities:master Jul 25, 2018
@timche
Copy link
Member

timche commented Jul 25, 2018

Released in v2.5.1: https://github.com/redux-utilities/redux-actions/releases/tag/v2.5.1

Sorry for the inconveniences caused.

@nowells
Copy link
Contributor Author

nowells commented Jul 25, 2018

Thank you so much @timche!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants