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 a "Get started with wp-scripts" doc to the Getting Started section #55372

Merged
merged 5 commits into from
Oct 18, 2023

Conversation

ndiego
Copy link
Member

@ndiego ndiego commented Oct 15, 2023

Fixes #54961

What?

This PR adds a getting started guide for wp-scripts. This package is one of the best tools for building projects for the Block Editor. It's used heavily throughout the Block Editor Handbook in examples and is fundamental to the create-block package. Having a primer on the subject in the Getting Started section will help new developers get oriented.

@ndiego ndiego added the [Type] Developer Documentation Documentation for developers label Oct 15, 2023
@ndiego ndiego self-assigned this Oct 15, 2023
@github-actions
Copy link

github-actions bot commented Oct 15, 2023

Flaky tests detected in b2ee650.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/6552253827
📝 Reported issues:

@gziolo
Copy link
Member

gziolo commented Oct 16, 2023

I only skimmed the document, but everything reads great. Excellent job!

See also my note in #55373 (comment).

Copy link
Contributor

@apeatling apeatling left a comment

Choose a reason for hiding this comment

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

Nice work, we need more docs like this!

@ndiego
Copy link
Member Author

ndiego commented Oct 17, 2023

@juanmaguitar I have added a callout for the new create-block doc. Let me know what you think.


The [`@wordpress/scripts`](https://developer.wordpress.org/block-editor/reference-guides/packages/packages-scripts/) package, commonly referred to as `wp-scripts`, is a set of configuration files and scripts that primarily aims to standardize and simplify the development process of WordPress projects that require a JavaScript build step.

A JavaScript build step refers to the process of transforming, bundling, and optimizing JavaScript source code and related assets into a format suitable for production environments. These build steps often take modern JavaScript (ESNext and JSX) and convert it to a version compatible with most browsers. They can also bundle multiple files into one, minify the code to reduce file size and perform various other tasks to optimize the code.
Copy link
Contributor

Choose a reason for hiding this comment

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

We can simplify these explanations about the Build process once we craft "Fundamentals of Block Development > The Build process" according to #54124


The package abstracts away much of the initial setup, configuration, and boilerplate code associated with JavaScript development for modern WordPress. You can then focus on building blocks and Block Editor extensions.

## Quick start
Copy link
Contributor

Choose a reason for hiding this comment

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

I would simplify this whole article by assuming blocks are going to be created using "create-block" so I would remove any references about how to install it and focus this introduction on how to use it and the things that are being taken care of by this script.

I think the handbook should reinforce the idea of using create-block + wp-scripts + wp-env as the "trinity" of official tools recommended for Block Development

Copy link
Contributor

Choose a reason for hiding this comment

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

It would be enough just adding a callout highlighting the idea of how create-block already incorporates wp-script with already prepared scripts so no additional installation is needed for wp-scripts is needed when creating a block with create-block

@ndiego ndiego enabled auto-merge (squash) October 17, 2023 20:08
@ndiego ndiego merged commit f35837b into trunk Oct 18, 2023
49 checks passed
@ndiego ndiego deleted the docs/add-get-started-with-wp-scripts-doc branch October 18, 2023 11:19
@github-actions github-actions bot added this to the Gutenberg 16.9 milestone Oct 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Developer Documentation Documentation for developers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add a dedicated doc for getting started with wp-scripts (subpage of Developer Environment)
4 participants