Skip to content
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

Is it still necessary to support legacy Node.js? #207

Closed
Connormiha opened this issue Dec 23, 2018 · 6 comments
Closed

Is it still necessary to support legacy Node.js? #207

Connormiha opened this issue Dec 23, 2018 · 6 comments

Comments

@Connormiha
Copy link
Contributor

Current Terser supports nodejs 0.8.0, 0.10.0, 0.12.0. I think in 2019 supporting of legacy node.js does not give any advantages.
Developers migrated from UglifyJS to Terser because Terser supports ES2015+.
I can't believe that developer who use modern ECMAscript + Terser runs it with legacy Node(without es6 support).
Popular node.js projects are supported from Node 4 or even Node 6. For example Webpack, Jest, Karma, TypeScript have already droped support 0.12.0.
Some parts of the code can be improved without support legacy Node.

@fabiosantoscode
Copy link
Collaborator

It's not hard to support those versions, as long as we keep the code ES5.

A nice improvement would be to use babel or ecmacomp (when it's done) on the source and convert it to ES5 code that runs on 0.10.

I don't think we need to support 0.* forever, but this 0.8 support you're talking about is new to me. Maybe it's just because we support 0.10 it ends up working on 0.8

Happy holidays!

@avdg
Copy link
Contributor

avdg commented Dec 26, 2018

From my perspective it was nice to "support" these old versions as these v8 compilers did not include es5. It's a nice indicator if something was implemented too futuristic.

But given that this branch is already kinda es6 native and that just supporting es5 is something of the past, maybe that we can support a more recent old version of v8.

I just don't want a minifier to support only the latest version as that will break the flexibility with compatibility and increase the possibility of unforseen bugs, especially with browsers lagging implementation or being out of date.

nifgraup added a commit to nifgraup/terser that referenced this issue Dec 27, 2018
@nifgraup
Copy link
Contributor

I added a pull request #210 where node <4 is dropped. It's required to get the tests green in #209.

Alternatively, version 4 could be the minimum version to build terser, but test runs could still execute on older versions of node.js. I don't think that's the way forward unless there is popular demand.

@nifgraup
Copy link
Contributor

nifgraup commented Jan 2, 2019

Turns out rollup needs at least node.js 6, https://travis-ci.org/terser-js/terser/builds/474008895?utm_source=github_status&utm_medium=notification.

Should we raise the minimum version to 6 or have different build and runtime requirements?

@fabiosantoscode
Copy link
Collaborator

How about parcel? Or an older version of rollup. If needed we can go with webpack even. It's not as small but we're not trying to be small.

@nifgraup
Copy link
Contributor

nifgraup commented Jan 2, 2019

Parcel requires node 6 https://github.com/parcel-bundler/parcel/blob/master/package.json#L29, webpack as well https://github.com/webpack/webpack/blob/master/package.json#L86.

It's not sensible to use an older version of rollup, we have to be able to upgrade if bugs arise. In fact I discovered a bug in rollup that caused a terser unit test to fail, now fixed: rollup/rollup#2607

You didn't address if 6 is too new or what you think of having to a different minimum node.js version requirements to run and build terser. Node.js v4 had EOL in April last year https://github.com/nodejs/Release#end-of-life-releases.

nifgraup added a commit to nifgraup/terser that referenced this issue Jan 4, 2019
v4 EOL was 2018-04-30, module bundlers require at least v6.
nifgraup added a commit to nifgraup/terser that referenced this issue Jan 6, 2019
v4 EOL was 2018-04-30, module bundlers require at least v6.
nifgraup added a commit to nifgraup/terser that referenced this issue Jan 14, 2019
nifgraup added a commit to nifgraup/terser that referenced this issue Jan 20, 2019
fabiosantoscode pushed a commit that referenced this issue Feb 2, 2019
* Drop Node.js v4 (#207)

v4 EOL was 2018-04-30, module bundlers require at least v6.

* fixup! Drop Node.js v4 (#207)
fabiosantoscode pushed a commit that referenced this issue Feb 2, 2019
* Drop Node.js v4 (#207)

v4 EOL was 2018-04-30, module bundlers require at least v6.

* Use ES6 modules, build with rollup (#209)

* Use ES6 modules over CommonJS as they can be statically analyzed.
* Enable eslint rule no-undef, good to spot missing imports.
* Had to move TreeTransformer to ast.js. Cyclic dependencies are otherwise
  not causing issues, but rollup gives two warnings.
* Stop shipping lib/, just minified and unminified bundles.
* --comments removed from minify step, it caused multiple license headers
  to be added instead of just one at top.

* fixup! Drop Node.js v4 (#207)
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

4 participants