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

Add Webpack/Eslinting for Gutenberg blocks #1533

Merged
merged 2 commits into from
Jun 27, 2018
Merged

Conversation

dbtlr
Copy link
Contributor

@dbtlr dbtlr commented Jun 27, 2018

Pulled from #1521

This PR adds in all of the webpack building and eslinting required to build a Gutenberg block.

The Build

  • The build is pretty standard webpack/babel, with some things borrowed from the Gutenberg build.

  • I've included it in our grunt-based existing build system.

  • When we start building the other blocks, there are a few things we may need to consider:

    • Sharing components between blocks.
    • Splitting bundles (for both synchronous and asynchronous loading).

@dbtlr dbtlr requested a review from alexsanford June 27, 2018 15:44
@dbtlr dbtlr changed the title Initial import from the add/jobs-shortcode-block branch Add Webpack/Eslinting for Gutenberg blocks Jun 27, 2018
Copy link
Contributor

@alexsanford alexsanford left a comment

Choose a reason for hiding this comment

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

A few small things, then LGTM

.eslintrc.js Outdated
globals: {
wp: true,
window: true,
document: true,
Copy link
Contributor

Choose a reason for hiding this comment

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

Funky indentation here

/**
* Register all Gutenblocks
*/
public function register_blocks() {
Copy link
Contributor

Choose a reason for hiding this comment

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

This is likely to fail since the jobs block is gone. Should we just stub this function out?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

removed!

@dbtlr dbtlr merged commit 0b11184 into master Jun 27, 2018
@spencerfinnell
Copy link
Contributor

WordPress' Babel preset package will handle Babel config: https://github.com/WordPress/packages/tree/master/packages/babel-preset-default

@jom jom deleted the add/gutenblock-webpack-build branch July 2, 2018 09:39
jom added a commit that referenced this pull request Jul 4, 2018
jom added a commit that referenced this pull request Jul 4, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants