-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Docs: Update JavaScript build and setup with wp-scripts updates #14440
Conversation
Nice ❤️ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! A few small suggestions…
docs/designers-developers/developers/tutorials/javascript/js-build-setup.md
Outdated
Show resolved
Hide resolved
docs/designers-developers/developers/tutorials/javascript/js-build-setup.md
Outdated
Show resolved
Hide resolved
docs/designers-developers/developers/tutorials/javascript/js-build-setup.md
Outdated
Show resolved
Hide resolved
docs/designers-developers/developers/tutorials/javascript/js-build-setup.md
Outdated
Show resolved
Hide resolved
docs/designers-developers/developers/tutorials/javascript/js-build-setup.md
Outdated
Show resolved
Hide resolved
docs/designers-developers/developers/tutorials/javascript/js-build-setup.md
Outdated
Show resolved
Hide resolved
docs/designers-developers/developers/tutorials/javascript/js-build-setup.md
Outdated
Show resolved
Hide resolved
@nosolosw @gziolo In my testing, it was still required to install the following packages, they were not picked up as dependencies of @wordpress/scripts
The Following the instructions in the docs and installing and it all works great, so much simpler! |
@mkaz for ESNext we need to land #14168 first. I'm waiting for Travis so I can merge :) This example oandregal/understanding-gutenberg#7 shows how it works (I'm using JSX syntax and arrow functions in the |
changes addressed; awesome stuff @mkaz!
Thanks ! Co-Authored-By: mkaz <marcus@mkaz.com>
c5705e0
to
02f6909
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great to see! I pushed some commits, feel free to remove them if you don't like them. I thought it'd be faster to commit than to write the suggestion :)
I'm approving so it's ready to go, although I understand that we want to merge this after the packages' release.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome work. Thanks for putting this together and updating with the latest changes introduced. It should be very helpful moving forward. We probably should also reference this document from @wordpress/scripts
readme file as well.
docs/designers-developers/developers/tutorials/javascript/js-build-setup.md
Outdated
Show resolved
Hide resolved
Additionally, webpack has a `--watch` flag that will keep the process running, watching for any changes to the `block.js` file and re-building as changes occur. This is useful during development, when you might have a lot of changes in progress. | ||
|
||
You can start the watcher by running `npm run dev` in a terminal. You can then edit away in your text editor; after each save, webpack will automatically build. You can then use the familiar edit/save/reload development process. | ||
Now, when you run `npm run start` a watcher will run in the terminal. You can then edit away in your text editor; after each save, it will automatically build. You can then use the familiar edit/save/reload development process. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Next step, hot module reloading support? :)
…uild-setup.md Co-Authored-By: mkaz <marcus@mkaz.com>
Description
Closes #13712.
Updates the build and setup section of the JavaScript tutorial with the new simplified commands included in wp-scripts. Removes webpack and babel configs and replaces recommending to use the default configs using
wp-scripts build|start
How has this been tested?
Follow the instructions, in the tutorial which includes a simple block you can create to test.
Until the wp-scripts gets published you will need to add a local reference to
@wordpress/scripts
package.For me Gutenberg is one directory up from my sample plugin so my package.json entry looks like:
View documentation live on branch here
Depends on #14168