You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With ES6 a lot of new features are coming down the pipe, and one of them is classes.
Has anyone given any thought to using ES6 features in sequelize yet?
ES6 is not coming to sequelize anytime soon (and propably not anytime late either ;) )
As @BridgeAR mentions, we need to support older node versions as well. Object initializers would be cool, but personally I don't see much gain from classes either
(you are welcome to provide further points for discussion, but I'll close this issue since the github tracker is meant for feature requests and bugs)
I've actually been given a lot of though to using babel-node internally so we can use ES6 features in the project but still support 0.10. However that wouldn't really enable you to use ES6 classes.
I see a lot to gain by using ES6 classes though, generally better semantics rather than trying to roll your own like we do currently with sequelize.define()
That's what I was thinking too. We're backing into a world where these things will be 1st class citizens, and I was wondering how to get "from here there". I use babel-node in all of my projects for this particular reason and that's why I was wondering about sequelize.
I'll take a few stabs at implementing something and see what happens. If you have any implementation ideas I'm all ears. ;)
I would love to see ES6 interop on the sequelize roadmap.
@trevoro Did you make any progress on your attempt? I am about to create a wrapper for one of my projects, but wanted to see what folks may have already done that I could use. Thanks!
Activity
BridgeAR commentedon May 31, 2015
Sequelize should also work in old nodejs versions. So this is not really an option. Besides that: What would be the benefit for you?
janmeier commentedon May 31, 2015
ES6 is not coming to sequelize anytime soon (and propably not anytime late either ;) )
As @BridgeAR mentions, we need to support older node versions as well. Object initializers would be cool, but personally I don't see much gain from classes either
(you are welcome to provide further points for discussion, but I'll close this issue since the github tracker is meant for feature requests and bugs)
mickhansen commentedon Jun 1, 2015
I've actually been given a lot of though to using babel-node internally so we can use ES6 features in the project but still support 0.10. However that wouldn't really enable you to use ES6 classes.
I see a lot to gain by using ES6 classes though, generally better semantics rather than trying to roll your own like we do currently with sequelize.define()
trevoro commentedon Jun 1, 2015
That's what I was thinking too. We're backing into a world where these things will be 1st class citizens, and I was wondering how to get "from here there". I use
babel-nodein all of my projects for this particular reason and that's why I was wondering about sequelize.I'll take a few stabs at implementing something and see what happens. If you have any implementation ideas I'm all ears. ;)
xpepermint commentedon Jul 13, 2015
+1 for
babel(clialso)SpainTrain commentedon Jul 14, 2015
👍
@BridgeAR @janmeier For an example of a project that supports ES5 and ES6 syntax for creating derived classes - https://facebook.github.io/react/docs/reusable-components.html
Admittedly React is an extreme case due to jsx, but interop is feasible even in smaller and simpler projects e.g., https://github.com/home-buddy/rest-buddy
I would love to see ES6 interop on the sequelize roadmap.
@trevoro Did you make any progress on your attempt? I am about to create a wrapper for one of my projects, but wanted to see what folks may have already done that I could use. Thanks!
felixfbecker commentedon Aug 28, 2016
@SpainTrain https://www.npmjs.com/package/sequelize-decorators