Skip to content

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

Closed
octref opened this issue Jul 7, 2015 · 11 comments
Closed

What's the rationale for using experimental features in ES7? #226

octref opened this issue Jul 7, 2015 · 11 comments

Comments

@octref
Copy link
Contributor

octref commented Jul 7, 2015

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.

@octref octref changed the title What's the rationale for using Strawman/Proposal stage features in ES7? What's the rationale for using experimental features in ES7? Jul 7, 2015
@octref
Copy link
Contributor Author

octref commented Jul 7, 2015

Just saw #203 , I think a ES6 port would be more practical.

@coodoo
Copy link

coodoo commented Jul 7, 2015

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.

@octref
Copy link
Contributor Author

octref commented Jul 7, 2015

@coodoo
But those ES7 features are subject to change while ES6 features are locked down.
I'm not familar with how exactly EcmaScript proposal works, but what if a ES7 feature Redux depends on changes syntax or get sdropped?

@coodoo
Copy link

coodoo commented Jul 7, 2015

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.

@octref
Copy link
Contributor Author

octref commented Jul 7, 2015

@Dakuan
Copy link

Dakuan commented Jul 7, 2015

This worries me a lot too. It's starting to feel like getting Babel to transpile something is creating de-facto standards.

@johanneslumpe
Copy link
Contributor

@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.

@gaearon
Copy link
Contributor

gaearon commented Jul 7, 2015

I'm not familar with how exactly EcmaScript proposal works, but what if a ES7 feature Redux depends on changes syntax or get sdropped?

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.

@gaearon
Copy link
Contributor

gaearon commented Jul 7, 2015

That said, if there is a PR backporting the examples to ES6, I'll merge it.
There is no need to backport Redux source code itself.

@octref
Copy link
Contributor Author

octref commented Jul 7, 2015

@gaearon

Redux does not depend on these features.

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".

That said, if there is a PR backporting the examples to ES6, I'll merge it.
There is no need to backport Redux source code itself.

Agreed. I guess I'll take a shot today 😃

@octref octref closed this as completed Jul 7, 2015
@badtant
Copy link

badtant commented Jul 9, 2015

Are there any ES6 examples yet? Not so keen on moving to ES7.

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

No branches or pull requests

6 participants