Use of miniKindOf is not ES5-compliant
See original GitHub issuePrior Issues
None that I could find.
What is the current behavior?
Redux causes my application to crash on some ES5 browsers because of a nested function within an if
statement in kindOf.ts. This is not permitted in ES5 and Babel does not seem to provide a transform for this, probably because it would break existing code.
The exact console log is this: SyntaxError: Nested functions cannot be declared in strict mode.
Steps to Reproduce
It’s a bit hard to create a live repro case for this, since finding an ES5 browser is difficult nowadays. However, I can provide a gist with my Babel and browserslist configurations as well as a file highlighting the issue.
What is the expected behavior?
Redux should run in an ES5 environment with a standard Babel configuration.
Environment Details
Browser: Midori 0.5.11 on Ubuntu 18.04
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
ECMAScript 5 | Can I use... Support tables for HTML5, CSS3, etc
Full support for the ECMAScript 5 specification. Features include Function.prototype.bind , Array methods like indexOf , forEach , map & filter , Object...
Read more >Is there a place to test if code is ES5 compliant / safe?
Sometimes I'd like to know if the code I'm writing is ES5 compliant/safe or not.
Read more >ECMAScript 5 compatibility table
Compilers/polyfills Desktop brows...
Feature name▻ Current browser 100% es5‑shim 31% Konq 4.13 61%
§Object/array literal extensions▻ 5/5 0/5 3/5
§Getter accessorsc Yes ? Yes
Read more >Transpile your javascript to be ES5-compatible - signageOS
In order to use advanced Javascript's features and syntax, you need to either transpile your code to ES5 or use polyfills.
Read more >How ReactJS ES6 syntax is different compared to ES5
ES5 uses the require module to import any member module in our ... than ES5 as it is a recent update on ES5...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Fixed in https://github.com/reduxjs/redux/releases/tag/v4.1.1
Yeah, definitely a pretty rare edge case 😃
tbh this is low priority for me atm, as we’re focusing on getting the RTK Query APIs out the door. If you’d like to submit a PR that rearranges the code to make this work as expected, we can look at getting that in.