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

Relax the engines support in package.json for node6 support for fluent-syntax #164

Merged
merged 2 commits into from
Mar 8, 2018

Conversation

EnTeQuAk
Copy link
Contributor

@EnTeQuAk EnTeQuAk commented Mar 8, 2018

This blocks mozilla/addons-linter#1789 (and thus the langpack signing
for Firefox 60).

fluent-syntax is compatible with node 6 when using the compat build but
still can't be installed given that it requires node 8+ in the
packages.json.

Can we relax that a little bit?

Addons-linter is a dependency of web-ext which is being installed on
end-users machines and thus has a bit more LTS requirements and has to
support node6 while it's still LTS.

I added the ignore-engines option to the addons-linter tests to check that the build really does support node 6 and all tests are passing.

See #164 for more details.

@EnTeQuAk EnTeQuAk changed the title Relax the engines support in package.json for node6 support. Relax the engines support in package.json for node6 support for fluent-syntax Mar 8, 2018
@stasm
Copy link
Contributor

stasm commented Mar 8, 2018

Hi @EnTeQuAk, thanks for the PR.

The Node 8+ requirement was introduced in #95 and the motivation was #92 (comment). Node 6 doesn't support Object.entries(). Even though this was specifically a problem in the fluent package, I made the change for all packages in the repo, including fluent-syntax, to make maintenance easier and avoid similar bug in the future. Note that the compat builds don't solve this issue: Object.entries needs to be polyfilled via core-js/fn/object/entries rather than transpiled.

While fluent-syntax currently doesn't use Object.entries() , fluent and fluent-react do. It would make the maintenance of fluent-syntax much harder if we had to remember that it's the only package in the repo where you can't use certain JS features :( Ideally we'd run the test suite on Node 6 as well to prevent bugs in the future, but then fluent and fluent-react would break.

I'll do my best to unblock mozilla/addons-linter#1789 in the short term. Perhaps we can relax the requirement for a few point releases?

Long term -- what's your timeline for phasing out Node 6 support? Please say Firefox 61 :)

@stasm
Copy link
Contributor

stasm commented Mar 8, 2018

BTW Is this a yarn-only thing?

@EnTeQuAk
Copy link
Contributor Author

EnTeQuAk commented Mar 8, 2018

Ah, thanks for the hint regarding the compat transpilation. Well, it seems the compat build is working for the stuff that I use but it could break at other points it seems.

Long term -- what's your timeline for phasing out Node 6 support? Please say Firefox 61 :)

That depends on how web-ext phases it out but currently I plan to remove Node 6 support when node6 goes into "Maintenance LTS"-mode which is April 30th 2018, so not too long.

Alternatively, I could fork the fluent-syntax package temporarily, rewrite whatever is node 8-only and publish that for the time being. I could even try using an older fluent-syntax package but I'd rather not go backwards here tbh. Or we could merge those changes temporarily but that increases maintainance burden on your end.

What do you think?

@stasm
Copy link
Contributor

stasm commented Mar 8, 2018

That depends on how web-ext phases it out but currently I plan to remove Node 6 support when node6 goes into "Maintenance LTS"-mode which is April 30th 2018, so not too long.

OK, this is great to know. I was mostly afraid of having different engine requirements across different packages in the repo. I'm sure down the road I'd forget and try to use some new JS feature which would break fluent-syntax on Node 6 :)

If we put a time limit on this, I think that's fine and easier to remember. I'll also try to set Travis up such that it runs fluent-syntax tests on Node 6.

This blocks to mozilla/addons-linter#1789 (and thus the langpack signing
for Firefox 60).

fluent-syntax is compatible with node 6 when using the compat build but
still can't be installed given that it requires node 8+ in the
packages.json.

Can we relax that a little bit?

Addons-linter is a dependency of `web-ext` which is being installed on
end-users machines and thus has a bit more LTS requirements and has to
support node6 while it's still LTS.
stasm added a commit to EnTeQuAk/fluent.js that referenced this pull request Mar 8, 2018
By default, make test requires babel-polyfill and all tests run fine even on
older versions of Node. For fluent-syntax, howeever, we want to also run tests
without the polyfill in order to make sure that fluent-syntax is actually
runnable on Node 6. See projectfluent#164.
stasm added a commit to EnTeQuAk/fluent.js that referenced this pull request Mar 8, 2018
By default, make test requires babel-polyfill and all tests run fine even on
older versions of Node. For fluent-syntax, howeever, we want to also run tests
without the polyfill in order to make sure that fluent-syntax is actually
runnable on Node 6. See projectfluent#164.
@stasm stasm force-pushed the support-node6 branch 2 times, most recently from f8db290 to a96e6e6 Compare March 8, 2018 12:20
@stasm stasm requested a review from Pike March 8, 2018 12:28
@stasm
Copy link
Contributor

stasm commented Mar 8, 2018

@Pike Does this look like a sane way forward until May?

@@ -23,6 +23,10 @@ compat.js: $(SOURCES)
--output.file $@
@echo -e " $(OK) $@ built"

.PHONY: test-without-babel-polyfill
test-without-babel-polyfill:
@mocha --recursive --ui tdd --require babel-register test/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We still need babel-register to transpile ES6 syntax, just like the compat builds do. Thanks to this, imports work correctly, for instance.

Copy link
Contributor

@Pike Pike left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm fine either way, but I wonder if we should run the non-polyfill tests on all version.

.travis.yml Outdated
script: make deps && make dist
script:
- make deps && make dist
- if [[ $(node --version) = v6.* ]]; then make -C fluent-syntax test-without-babel-polyfill; fi
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason to only test this for v6 and not for v8 as well?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No reason, except that I fixated on Node 6 :)

By default, make test requires babel-polyfill and all tests run fine even on
older versions of Node. For fluent-syntax, howeever, we want to also run tests
without the polyfill in order to make sure that fluent-syntax is actually
runnable on Node 6.
@stasm stasm merged commit e18ce16 into projectfluent:master Mar 8, 2018
@EnTeQuAk EnTeQuAk deleted the support-node6 branch March 13, 2018 14:14
@stasm stasm added this to fluent-syntax 0.6.5 in fluent-syntax May 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
fluent-syntax
fluent-syntax 0.6.5
Development

Successfully merging this pull request may close these issues.

None yet

3 participants