-
-
Notifications
You must be signed in to change notification settings - Fork 15.2k
What's the rationale for using experimental features in ES7? #226
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
Comments
Just saw #203 , I think a ES6 port would be more practical. |
With babel in place most ES6 and ES7 features are covered out of the box, it also serves as a practical real world use case of those new syntaxes to beginners, which IMO is a good thing in the long run. |
@coodoo |
That's when Babel (the transpiler) comes into play, as long as Babel remains supporting those syntaxes you will be fine, and traditionally babel has top notch support for most advanced ES syntaxes, hence personally I think it's worth the shot to familiarize oneself to those new syntaxes sooner rather than worrying too much about spec changes. |
This worries me a lot too. It's starting to feel like getting Babel to transpile something is creating de-facto standards. |
@octref from my point of view your argument is void. All the features used can be expressed as ES6/5 using Babel. In addition to that, Babel's syntax extensions will be moved into plugins, which will remain usable even if a proposal would have been rejected. The version you install from npm is already transpiled, so it does not contain any ES7 code. Redux is one of the project that's spearheading ES7 usage. But nobody forces you to use it if you feel uncomfortable with that. |
Redux does not depend on these features. We use zero runtime features of ES6 (or ES7 proposals). We don't even use Symbols, Promises or generators. Don't forget you use the compiled builds. So if Babel drops some of these features tomorrow, you won't even notice because the version on NPM is ES5. If some feature becomes unsupported, for us it's a matter of 5 minutes to replace it with a more verbose ES5 equivalent. We only use small syntactic sugar. These are easily replaceable (albeit slightly less readable). Then we'll bump the Babel version we depend on. That's it. Redux itself is very tiny, you should check out the source code. We are also fully covered by tests. It's not like there's some real work involved in replacing them. |
That said, if there is a PR backporting the examples to ES6, I'll merge it. |
Good to know! I know with babel the compiled code is all ES5. I was worried since all existing documentation suggests "you should write a Redux app using ES7".
Agreed. I guess I'll take a shot today 😃 |
Are there any ES6 examples yet? Not so keen on moving to ES7. |
I see you are using decorators and bind functions in the examples.
ES7 features are experimental and I think it's wise to exclude them.
ES6 is OK I think, as the proposal has been accepted, every JS engine has started implementing the features, and FB switched React to Babel themselves.
I know it's not 1.0/stable yet, but if redux is built on top of experimental features I doubt I'll ever use it for anything serious.
The text was updated successfully, but these errors were encountered: