10up / generator-wp-make

A Yeoman generator for making WordPress things
184 stars 42 forks source link

Update/es6 #80

Closed kylereicks closed 8 years ago

kylereicks commented 8 years ago

This pull request includes contributions and consultation from @mrbobbybryant, @Faison, @ivankruchkoff, and @fuhton.

We think we've landed on some good defaults as a starting place. A few items that were still in open discussion:

  1. Should we be including things like Babel's polyfill by default? For a single page app, or a site with a single JavaScript file, but conditional polyfills via wp_script_add_data might be better when multiple JavaScript files could be loaded on a page.
  2. In _script.js, are the < IE9 fallback and the document readystate check something that should be included by default or should we assume that IE8 support and asynchronous loading are not common enough to clutter the file with?
  3. In _core.js we've updated the script actions to register on init and then enqueue global scripts on wp_enqueue_scripts. This isn't strictly necessary for the es6 update, but it makes scripts available to wp_localize_script, wp_script_add_data, and wp_add_inline_script before they are printed in the head.

@lkwdwrd We also have a draft of a description of the directory structure changes here

fuhton commented 8 years ago

@kylereicks 1 test isn't passing. I don't believe this is your fault, but it'd be great if we fixed the issue.

Also, you're only requiring your js/_component.js file in the theme. This will cause issues for plugins/child-themes/libraries.

fuhton commented 8 years ago

We are considering ES6 for v1. We'll be doing this through WebPack (or something similar). Since this is against the master branch (vs develop) we'll be closing this PR.

cc @lkwdwrd @allenmoore