Skip to content
This repository has been archived by the owner on Jan 13, 2022. It is now read-only.

Switch to ES6 format? #52

Open
roadmanfong opened this issue Jun 4, 2015 · 4 comments
Open

Switch to ES6 format? #52

roadmanfong opened this issue Jun 4, 2015 · 4 comments

Comments

@roadmanfong
Copy link

A lot of new features in ES6 makes code simpler.
like import, export ...

ex:
Define method in object from

componentDidUpdate: function(prevProps, prevState) {
    ${1}
},

to

componentDidUpdate(prevProps, prevState) {
    ${1}
},
@jgebhardt
Copy link
Contributor

I agree that this is something we want to do, but we need to keep in mind that there is a lot of fragmentation in terms of transpilation methods / preferences across this package's user base. Not everyone is using ES6 (or ES7), and some only use a subset of features. Options to deal with this include:

  • ability to choose snippets in preferences (I don't like this approach because the number or permutations of possibly valid snippets is very high due to said fragmentation)
  • setting a date and announcing the upcoming deprecations via change log messages

If anyone has thoughts on this, please do chime in.

@roadmanfong
Copy link
Author

I see. That make sense.
I prefer first option, but I'm ok with second one.

@nathanfriemel
Copy link

My initial thought was to fork and add to the js snippets folder es6 friendly snippets(react_component6.sublime-snippet with a trigger of rcc6) while leaving the current ones because I actually work in an organization that has just begun to move to es6 and the move will take quite some time.

@jgebhardt
Copy link
Contributor

Note that "es6-friendliness" is a blurry concept rather than a binary one; Take a look at the many options in popular transformers such as https://babeljs.io/docs/usage/options/. whitelist and blacklist can each contain arbitrary transformers, several of which would impact the content of snippets differently. Even if this is covered, not everyone is using Babel, either.

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

No branches or pull requests

3 participants