Repository navigation
Closed
Milestone
Description
I wanted to push the discussion around 4.0 a little bit, summarize what is left to decide so 4.0 can be developed / released, and make a proposal:
- Support only Node >4 Only support Node v4.0.0 and up #5205. Benefits: native classes, native Promises, arrow functions. Implies Travis: test Node 4, 5, 6? #5878
- ES6 in Sequelize codebase ES6 in Sequelize codebase #3951 (without Babel, classes, arrow functions)
- Make instances
instanceof Model(with native classes) Make Instances instances of Model #5877- Better OOP semantics
define()still works as Model factory- users can extend
Sequelize.Model- awesome for type-safety / autocompletion
- alternative to
classMethods/instanceMethods/getterMethods/setterMethods
Model.init()static initializer attaches attribute metadata to the model- third-party module can define class/attribute decorators that does this for users of TypeScript / Babel - decorators are the perfect semantic for defining additional metadata for Sequelize on the attributes
- Need some way to register a model to a
Sequelizeinstance / model manager,sequelize.add(Model)?
Other than that, keep the API / concept changes small. Let users still use define() like they are used to, but enable users of TS / Babel to explore new ways of defining models.
Reacted by Alex Booker, Martin Lang, Ali Taheri Moghaddar, Randall Crock, kirillsalikhov, Nick K., Ray Shan, Brandon Belvin, Patricio López Juri, Ondrej Slinták and 4 more
Metadata
Metadata
Assignees
Labels
No labels
Activity
janmeier commentedon May 17, 2016
FYI - I've moved 3.0 to a separate branch (https://github.com/sequelize/sequelize/tree/v3), and made master 4.0.0-1. I've also started merging some PRs with minor BC breaks (see changelog) so we can hopefully get the 4.0 ball rolling.
The idea as that all new development is aimed at 4.0, but if people badly need a feature / bugfix in 3.0 they are welcome to create a backport PR. But we in the core team (Mick and I) at least will only work on 4.0.
I know some people will probably be annoyed by us "cutting" support for 3.0, but we simply don't have the resources to maintain two separate branches. We tried that with the 2.0 -> 3.0 transition and hated it :(.
With regards to node version I'm leaning mostly towards 6 only, or perhaps 6 + 0.12 with babel. I'd really like to use coroutines and generators, but that would force 0.12 users to use
--harmony. But I think the increased readability of the code would make up for it.We have been saving up quite a lot of issues with BC breaks that we want to land in 4.0 https://github.com/sequelize/sequelize/issues?utf8=%E2%9C%93&q=is%3Aopen+is%3Aissue+label%3Asemver%3Amajor+
mickhansen commentedon May 24, 2016
We should consider 6.0 only, but we'll need to consider what benefits we'll receive compared to not supported an active LTS version.
I don't believe we should use Babel since it removes the option of npm installed from tag/branch/commit.
We are considering coroutines since the performance impact seems to be minor if any.
overlookmotel commentedon May 24, 2016
Just to note here (so it's noted somewhere) that
bluebird.coroutine()will likely need to be shimmed to maintain CLS context.In my own code, in order to combine coroutines and CLS, I'm using co-bluebird and then setting it to use Sequelize.Promise like so:
I've encountered one weird edge case where CLS context occasionally gets lost which I'm trying to resolve, but that apart, it's solid.
bluebird-co also looks promising, but I don't know whether it supports CLS.
Vanilla
bluebird.coroutine()doesn't give you all the sweet sugar thatcodoes e.g.yield [ promise1, promise2 ]being the same asyield Promise.all( [ promise1, promise2 ] )overlookmotel commentedon May 24, 2016
Destructuring assignments (
var [a, b] = [1, 2];) only arrived in node v6 :(Table of ES6 support in different node versions here: http://node.green/
janmeier commentedon May 24, 2016
Descructuring assigment with default values would have been nice - But I agree that it should be possible to install directly from git, so we'll need to stick to 4.0 features.
I just started rewriting some of the code in model.js to use coroutines, and so far CLS tests still pass (i've changed findAll and a couple others).
Regarding yield sugar, I've added a yield handler that handles the array case - Haven't needed other forms of sugar yet :)
mickhansen commentedon May 24, 2016
Well atleast we get object literal extensions and template literals.
sushantdhiman commentedon May 24, 2016
Yes, thats something I am interested in. At least we will get some of ES6 feature from v4.0
Other thing I would like us to work on is improving performance. There are lots of issues already https://github.com/sequelize/sequelize/search?q=performance&state=open&type=Issues&utf8=✓
I don't know how we should tackle it but I think we should stick to minimal feature set rather than adding lots of feature to make our codebase more complex and slow. We can convert some modules to plugins and move them away from
sequelize-coremickhansen commentedon May 24, 2016
For performance we first need a seperate benchmark repo that we can run against version of Sequelize (with npm link or whatever).
Over time we should move as much as possible away from core. And i'm also working on making most of the codebase batchable which should enable separate: true and other stuff.
sushantdhiman commentedon May 24, 2016
I'll work on https://github.com/sequelize/sequelize-performance to introduce better benchmarks. After that may be we can hook it with the Travis to see per pull request based performance changes.
I am looking for completion of
separate:trueas well. I plan to makehooksanddialectpluggable to achieve closer to native performance. But that will be lots of work I guess.felixfbecker commentedon May 24, 2016
Dumb question: what is CLS needed for?
mickhansen commentedon May 25, 2016
@felixfbecker context maintenance across calls, if passing through options is impractical. It's the same technique used for almost all instrumentation.
mickhansen commentedon May 25, 2016
@sushantdhiman Might be worth it to make a completely new repository, that repo deals with benchmarking us vs others, i'd love to just benchmark our own changes.
sushantdhiman commentedon May 25, 2016
Ok I'll create one. I will benchmark against native db drivers on various node version (4 and 6).
mickhansen commentedon May 25, 2016
@sushantdhiman Just create one benchmark where the node version, sequelize version, dialect is easily swappable in the environment.
This doesn't need to be run on CI atm, we just need to be able to run it ourselves where it produces a nice copy pasteable format so we can manually diff here on git.
I'd love something lower level than the entire travis setup we have here atm :)
25 remaining items
felixfbecker commentedon Aug 28, 2016
Proof of concept for decorators: https://www.npmjs.com/package/sequelize-decorators
broofa commentedon Jan 13, 2017
Is there a timeline for when 4.0.0 will drop? I see the "4.0.0-x" versions in npm info, but I assume that means this work is still experimental.
janmeier commentedon Jan 18, 2017
@broofa - Hopefully very soon - We (I) still need to figure out a good solution for hosting of v4 docs, #6886. As far stability I think you should be able to use the pre-release without problems
ralusek commentedon Apr 10, 2017
@janmeier any update on when this is expected to release?
janmeier commentedon Apr 12, 2017
@ralusek Hopefully soon :) - It's getting closer at least. Docs are done now, but we'd still like to address a couple of things related to where conditions
iamjochem commentedon Apr 24, 2017
hi Guys,
I am using Sequelize v4 and have been trying to write as little PR related to ValidationErrorItem functionality ... I have problems getting with the test suite (clean master branch) to run successfully under Node v6.2 ... it dies on a certain test with the following output:
[MYSQL] BelongsToMany getAssociations ✓ supports transactions (206ms) 1) "before each" hook for "gets all associated objects with all fields" 2) "after each" hook for "gets all associated objects with all fields" 5 passing (910ms) 2 failing 1) "before each" hook for "gets all associated objects with all fields": SequelizeConnectionError: Connection lost: The server closed the connection. at Utils.Promise.then.then.catch (lib/dialects/mysql/connection-manager.js:156:21) From previous event: at ConnectionManager.connect (lib/dialects/mysql/connection-manager.js:142:13) at sequelize.runHooks.then (lib/dialects/abstract/connection-manager.js:303:50) From previous event: at ConnectionManager._connect (lib/dialects/abstract/connection-manager.js:303:8) at Promise (lib/dialects/abstract/connection-manager.js:89:14) From previous event: at Object.pool.Pooling.createPool.create [as create] (lib/dialects/abstract/connection-manager.js:87:23) at Pool._createResource (node_modules/generic-pool/lib/Pool.js:279:42) at Pool._dispense (node_modules/generic-pool/lib/Pool.js:210:12) at Pool.acquire (node_modules/generic-pool/lib/Pool.js:406:10) at Promise (lib/dialects/abstract/connection-manager.js:270:45) From previous event: at promise.then (lib/dialects/abstract/connection-manager.js:269:7) From previous event: at ConnectionManager.getConnection (lib/dialects/abstract/connection-manager.js:268:20) at Promise.try (lib/sequelize.js:521:92) From previous event: at Sequelize.query (lib/sequelize.js:428:23) at Promise.map.tableName (lib/query-interface.js:447:22) From previous event: at QueryInterface.getForeignKeysForTables (lib/query-interface.js:446:20) at showAllTables.then.tableNames (lib/query-interface.js:234:21) From previous event: at QueryInterface.dropAllTables (lib/query-interface.js:220:40) at Object.clearDatabase (test/support.js:131:8) at Context.<anonymous> (test/integration/support.js:18:18) 2) "after each" hook for "gets all associated objects with all fields": Error: Expected 0 running queries. 3 queries still running in [MYSQL] BelongsToMany getAssociations gets all associated objects with all fields at Object.verifyNoRunningQueries (lib/sequelize.js:242:45) at Context.<anonymous> (test/integration/support.js:23:25)I have also tried to run the [mysql] tests (again with clean master branch) on Node v4.2.1 and that also dies (in the "[MYSQL] Transaction" tests) with the following output (up to that point a handful of tests have already failed, which suprises me because it's a clean master branch):
Questions regarding Node versions:
felixfbecker commentedon Apr 24, 2017
@iamjochem see Travis: https://travis-ci.org/sequelize/sequelize. Your test failures seem to be a problem with your DB server, not sequelize.
iamjochem commentedon Apr 24, 2017
@felixfbecker - okay then, tests themselves seem to be fine. My DB server is not the problem either ... it's on localhost (same place i'm running the tests), it is running fine and other processes/apps are using it).
I do notice that there are a stack of ENV vars that I can set (e.g. MYSQL_VER) which I'm not currently doing ... I'll have a play with those.
Anyway it looks like I broke something locally ... if I manage to determine anything I think might be useful generally I'll report back here.
... thanks for reading & helping!
felixfbecker commentedon Apr 24, 2017
It's more suited for our Slack channel than for this issue tbh
iamjochem commentedon Apr 24, 2017
probably ... but seeing as it's invite only ;-) (any chance of an invite?)
felixfbecker commentedon Apr 24, 2017
It's self-invite: http://sequelize-slack.herokuapp.com/
sushantdhiman commentedon Jun 8, 2017
d960cf1