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

Use babel to transpile the workbox-build codebase? #669

Closed
MaxLeiter opened this issue Jul 10, 2017 · 6 comments
Closed

Use babel to transpile the workbox-build codebase? #669

MaxLeiter opened this issue Jul 10, 2017 · 6 comments
Labels
Bug An issue with our existing, production codebase.

Comments

@MaxLeiter
Copy link

Library Affected:
workbox-build

Browser & Platform:
all browsers

Issue or Feature Request Description:
Currently making a PR, should be as easy as throwing in a 'use strict';

Ref: https://travis-ci.org/thelounge/lounge/jobs/251861458
and thelounge/thelounge#1317

@jeffposnick
Copy link
Contributor

Thanks for pointing that out! The intention is to get support node 4 for workbox-build, though we obviously haven't done a great job of testing that.

While we could approach this via adding in 'use strict';' throughout the individual modules, I wanted to see how @gauntface & co. felt about running the workbox-build project through babel with babel-present-env set up for node 4.

There are a number of times that I've wanted to use, e.g., async/await or spread operators when working on the workbox-build codebase, but didn't, because of legacy node support.

@jeffposnick jeffposnick changed the title generate-sw doesn't work on node 4 due to lack of use strict Use babel to transpile the workbox-build codebase? Jul 10, 2017
@jeffposnick jeffposnick added Bug An issue with our existing, production codebase. question labels Jul 10, 2017
@MaxLeiter
Copy link
Author

Sounds good to me.

@gauntface
Copy link

Personally I hate having to transpile anything just to run in a baseline environment so I'd rather just accept use strict.

There is a bigger question of what our support matrix should be. Should it be current stable and latest version? or should be follow the same as node's schedule where node 4 is in maintanence? https://github.com/nodejs/LTS

@jeffposnick
Copy link
Contributor

The initial impetus behind a minimum of node 4 was to match what create-react-app required, on the assumption that we will try to integrate with them at some point. It turns out c-r-a has since switched to requiring node 6: facebook/create-react-app#1897

That being said, since we can easily resolve node 4 support with minimal extra effort, I'm fine with keeping 4 as a minimum, at least until April 2018.

We're going to need use strict throughout workbox-build and workbox-cli, in that case.

@MaxLeiter
Copy link
Author

MaxLeiter commented Jul 12, 2017

use strict is already present throughout workbox-cli and part of workbox-build. It's just missing from some files. Will update #670 to encompass all the files that require it.

@MaxLeiter
Copy link
Author

Fixed as of #670

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug An issue with our existing, production codebase.
Projects
None yet
Development

No branches or pull requests

3 participants