Objection.js: Drop support for node < 4?

Created on 30 Mar 2017  路  12Comments  路  Source: Vincit/objection.js

I will drop the support for node versions below 4.0 in 0.8.0 release if I don't get too many objections. So speak now or forever hold your peace!

question

Most helpful comment

I've been planning to do the same for the knex in near future.

All 12 comments

I've been planning to do the same for the knex in near future.

For the less initiated, is https://github.com/nodejs/LTS the authoritative security and support schedule?

@mceachen does have a point with node 4.x dropping out of LTS soon. It's worth considering just clean-slate it to node 6.x instead.

Yet another consideration is for objection 1.x aim to be clean-slated for node 8.x+. By the looks of it, v8 5.7 seems to have been merged, which comes with a significant promise and async-await performance boosts (I think v8 technically optimises yielding generators actually - but whatever).

Koa 2.0.1 dropped all support for node <7.6 (because of v8 5.5 and native async-await without flag generally available).

I've had a personal bet that the node community will shift once async-await hits and hoping for 2017 to be a year for simplification (dropping multitude of signatures including callbacks and Sync-duplicates). Just do it the async-await/promise way. If there's significant maintenance and optimisation benefits to just work off of node 8+, I'd be happy with that personally :) I understand this perhaps is wishful thinking on my part.

https://github.com/nodejs/node/commit/c459d8ea5d402c702948c860d9497b2230ff7e8a (merged in node 8.x branch)
https://v8project.blogspot.se/2017/02/v8-release-57.html

There's not much added benefit of dropping 4.x that I can think of. Even if we only supported 8.x or whatever that fully supports async/await, I wouldn't change the internals to use async await. There will always be a small overhead of using async/await vs. raw promises and most of the promise usage in objection internals is complex Promise.all stuff, that would still have to be done using promises.

We cannot drop babel even with 8.x because of the extensive usage of decorators. I thought they would get through to ES faster than they are. There is no clean alternative to decorators for the stuff I'm using them (aspect oriented programming). I would really love to drop babel though.

I think we should support 4.x a little while longer. There's still many projects using 4.x even here at Vincit.

Regarding this,

dropping multitude of signatures including callbacks and Sync-duplicates

I would greatly appreciate keeping the callback API around (bluebird provides it with promise.asCallback()).

I also support the direction of dropping babel when it becomes reasonable to do so. _Now looking up aspect-oriented programming_

I don't think we have any reason to drop bluebird so promise.asCallback() will remain. Allthough I cannot imagine why anyone would use callbacks anymore 馃槣

loL wish there was a :trollface: reaction to posts

I dropped Node.js < 4 support in [pg-promise] 2 month ago.

Now only the loading file supports the old Node.js, to detect and throw correctly.

@koskimas @elhigu you guys can reuse the same detection + loading approach in your libraries :wink:

There's not much added benefit of dropping 4.x that I can think of

  • arrow functions, native iterators
  • yield is just as good for promises as await/async, if your library supports it, though if it doesn't, then it should :wink:

After I dropped the legacy stuff I also added eslint integration - it's awesome! 馃槂

@vitaly-t Good idea about the loading file check. I'll do that.

Arrow functions and yield are there even in 4.0.0.

There is a 0.8.0 branch that no longer supports node versions < 4.0.0. I ended up removing babel as well. There was very little refactoring to be done (except for the decorators that are not there even for node 8).

Dropping 4.x would have made absolutely no difference in the user's perspective and very little even for the internals. There was a few places where I had used destructuring and rest parameters, but that was pretty much it.

Arrow functions and yield are there even in 4.0.0.

I was only talking about droping Node.js < 4, never about dropping Node.js 4, that would be unthinkable.

Done in master branch. Will be released with 0.8.0.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

nicolaracco picture nicolaracco  路  3Comments

Ahlid picture Ahlid  路  3Comments

Gustav0ar picture Gustav0ar  路  4Comments

bsdo64 picture bsdo64  路  3Comments

AhmadRaza786 picture AhmadRaza786  路  3Comments