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

ES2015ify the gulpfile #1677

Merged
merged 1 commit into from
Oct 2, 2015
Merged

ES2015ify the gulpfile #1677

merged 1 commit into from
Oct 2, 2015

Conversation

sindresorhus
Copy link
Contributor

Nicer syntax. Less code. Why not.

Gulp and Babel handles this for us. It just works.

// @addyosmani @surma

@addyosmani addyosmani self-assigned this Oct 1, 2015
@surma
Copy link
Contributor

surma commented Oct 1, 2015

Love it! Will take a closer look at the code shorty.

Drone is failing because it looks like we need to tweak the customizer to play well with this setup, something we wanted to do anyways. We should probably do that in a separate PR.

Does JSCS/JSHint have ES6 enabled already or is linting going to fail?

@sindresorhus
Copy link
Contributor Author

Does JSCS/JSHint have ES6 enabled already or is linting going to fail?

JSCS parses ES2015 by default. .jshintrc has the esnext: true option set.

@addyosmani
Copy link
Contributor

Code reviewed and changes LGTM. We just need to nail down the issues around Drone failing:

[14:52:19] ReferenceError: MaterialCustomizer is not defined
    at Object.<anonymous> (/var/cache/drone/src/github.com/google/material-design-lite/docs/_assets/customizer.js:71:19)
    at Module._compile (module.js:456:26)
    at normalLoader (/cache/node_modules/babel-core/lib/api/register/node.js:199:5)
    at Object.require.extensions.(anonymous function) [as .js] (/cache/node_modules/babel-core/lib/api/register/node.js:216:7)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Gulp.<anonymous> (/var/cache/drone/src/github.com/google/material-design-lite/gulpfile.babel.js:759:30)
    at module.exports (/cache/node_modules/gulp/node_modules/orchestrator/lib/runTask.js:34:7)
[14:52:19] 'all' errored after 37 s
[14:52:19] ReferenceError: MaterialCustomizer is not defined
    at Object.<anonymous> (/var/cache/drone/src/github.com/google/material-design-lite/docs/_assets/customizer.js:71:19)
    at Module._compile (module.js:456:26)
    at normalLoader (/cache/node_modules/babel-core/lib/api/register/node.js:199:5)
    at Object.require.extensions.(anonymous function) [as .js] (/cache/node_modules/babel-core/lib/api/register/node.js:216:7)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Gulp.<anonymous> (/var/cache/drone/src/github.com/google/material-design-lite/gulpfile.babel.js:759:30)
    at module.exports (/cache/node_modules/gulp/node_modules/orchestrator/lib/runTask.js:34:7)

Personal preference is that we figure out what needs to be updated in the Customiser to make it play well with this setup prior to landing this change. Other team members are working against master so we probably want to avoid breaking their workflow prematurely :)

@sindresorhus
Copy link
Contributor Author

Figured out the issue. The Drone is now passing.

The problem was that the Babel require hook hooks all requires, so it tried to ES2015ify the "docs/_assets/customizer.js" file, which didn't work. It will now only transpile the gulpfile: https://github.com/google/material-design-lite/pull/1677/files#diff-b9cfc7f2cdf78a7f4b91a753d10865a2R79

@addyosmani
Copy link
Contributor

Fantastic. Thanks once again for the PR, @sindresorhus! 🐴 ✨ 😍

addyosmani added a commit that referenced this pull request Oct 2, 2015
@addyosmani addyosmani merged commit 46eac36 into master Oct 2, 2015
@addyosmani addyosmani deleted the es2015ify branch October 2, 2015 13:49
@surma
Copy link
Contributor

surma commented Oct 2, 2015

🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants