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

Convert build procedure to use wp-scripts #65

Merged
merged 9 commits into from
Mar 21, 2019
Merged

Conversation

mkaz
Copy link
Member

@mkaz mkaz commented Mar 20, 2019

  • Simplifies the build procedure to use wp-scripts setup
  • Removes .babelrc and webpack.config.js to use standard configs from wp-scripts
  • Adjusts code to live where wp-scripts expects it to be

@mor10
Copy link

mor10 commented Mar 20, 2019

Is this the new recommend best practice for block development? If so, a lot of documentation has to be updated.

Copy link
Member

@ntwb ntwb left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@oandregal
Copy link
Member

❤️ the simplicity of it!

@gziolo
Copy link
Member

gziolo commented Mar 21, 2019

Is this the new recommend best practice for block development? If so, a lot of documentation has to be updated.

Documentation inside Gutenberg has been already updated. We should post in make.wordpress.org/core with more details next week. All those changes introduced should make everything easier, but it's perfectly fine to use the old workflow.

@mkaz, I noticed that each block has .gitignore file which should be either removed or updated to reflect new distribution file path.

Thanks for starting this PR. I really like how this integrates.

Finally, we can also enable linting for JS files and fix some issues like unused variables which I could quickly notice, e.g. https://github.com/WordPress/gutenberg-examples/blob/master/05-recipe-card-esnext/block.js#L1 - setLocaleData is never used.

README.md Outdated Show resolved Hide resolved
Co-Authored-By: mkaz <marcus@mkaz.com>
@mkaz
Copy link
Member Author

mkaz commented Mar 21, 2019

@gziolo Good catch, I missed the .gitignore. Should we exclude the built file or not?

  1. The case for including, if someone downloads and runs the plugin it will work with it included. It also shows what the output should be when setup properly.

  2. The case for excluding, not having it there forces the developer to learn how to build it to get it to work, it was excluded before, the file is minified javascript so versioning isn't that useful and it can easily be rebuilt when needed

I really don't have much preference.

@gziolo
Copy link
Member

gziolo commented Mar 21, 2019

https://github.com/WordPress/gutenberg-examples#installation this says you can copy and run. I'm inclined to keep those build files and remove .gitignore files.

@mkaz mkaz merged commit cf8733e into master Mar 21, 2019
@mkaz mkaz deleted the update/01-wp-scripts branch March 21, 2019 17:18
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.

6 participants