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

Docs: Fundamentals of Block Development - Working with Javascript in the Block Editor (closed) #56294

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
133 commits
Select commit Hold shift + click to select a range
47b5c9a
Add documentation for working with Javascript in
juanmaguitar Nov 18, 2023
f65490f
Update JavaScript in the Block Editor
juanmaguitar Nov 18, 2023
de5d1c7
Update JavaScript assets enqueueing in the Editor
juanmaguitar Nov 18, 2023
8af25cc
added references
juanmaguitar Nov 19, 2023
29448f8
small adjustments
juanmaguitar Nov 19, 2023
384f6a0
Update docs/getting-started/fundamentals-block-development/javascript…
juanmaguitar Nov 19, 2023
b551917
Update docs/getting-started/fundamentals-block-development/javascript…
juanmaguitar Nov 19, 2023
fd0fff9
small text adjustment
juanmaguitar Nov 19, 2023
1d7c663
Merge branch 'fundamentals-block-development/javascript-in-the-block-…
juanmaguitar Nov 19, 2023
d3595dd
customized explanation about dependencies to match full example refer…
juanmaguitar Nov 19, 2023
7722fae
minor adjustment
juanmaguitar Nov 19, 2023
3c4b4ae
Update JavaScript resources and references
juanmaguitar Nov 19, 2023
98d925c
Add custom webpack.config.js for build
juanmaguitar Nov 20, 2023
64c276d
Added build process diagram
juanmaguitar Nov 20, 2023
19baf9c
Update build process diagram link
juanmaguitar Nov 20, 2023
25c1f03
Merge branch 'trunk' into fundamentals-block-development/javascript-i…
juanmaguitar Nov 20, 2023
5cfe094
Post Schedule Panel: Remove text overflow ellipsis (#56319)
youknowriad Nov 20, 2023
0253471
Duotone: Backport from Core to fix filters in classic themes (#54778)
t-hamano Nov 20, 2023
d7f8cff
Docs - Block Editor Handbook - Add end user documentation about Block…
juanmaguitar Nov 20, 2023
59c0356
Update webpack options for wp-scripts in README.md (#56314)
juanmaguitar Nov 20, 2023
8eb63dd
Revisions: add new selectors to fetch entity revisions (#54046)
ramonjd Nov 20, 2023
0b153a4
Migrating `BlockPatternSetup` to use updated `Composite` implementati…
Nov 20, 2023
7e61771
useInnerBlocksProps: stabilise dropZoneElement prop (#56313)
andrewserong Nov 20, 2023
53cae01
Rich text: pad multiple spaces through en/em replacement (#56341)
ellatrix Nov 21, 2023
15c94b0
Site editor: redirect to main page menu if page record not found (#56…
ramonjd Nov 21, 2023
a8de73d
Update README.md to fix the typo (#56322)
chiilog Nov 21, 2023
d4c367d
Docs: Fix incorrect build script description in script package (#56332)
t-hamano Nov 21, 2023
1e29bb5
Block Theme Preview: Display the theme name on the activate button (#…
arthur791004 Nov 21, 2023
1587cb9
Add top toolbar to distraction free mode (#56295)
draganescu Nov 21, 2023
fe958de
Migrate 'sidebar permalink' e2e tests to Playwright (#56253)
Mamaduka Nov 21, 2023
15b6355
Check Grammar
juanmaguitar Nov 21, 2023
ffa9ff7
Dataviews: Ensure items and fields are using a unique id (#56366)
ntsekouras Nov 21, 2023
3e42c03
Site Editor: Add the Post Author component to the Page sidebar (#56368)
youknowriad Nov 21, 2023
e95bb8c
Fix version in useSetting deprecation notice (#56377)
fabiankaegy Nov 21, 2023
68b0d5b
Global styles revisions: migrate API call to getRevisions() (#56349)
ramonjd Nov 21, 2023
aa91684
Spacing theme.json - check that the first item in the units array is …
glendaviesnz Nov 21, 2023
c283c44
Patterns: Fix bug with templates in replace template screen showing a…
glendaviesnz Nov 22, 2023
ae57cac
useMovingAnimation: Clear translate3d rule when animation is finished…
andrewserong Nov 22, 2023
537fa57
Reduce specificity of default Cover text color styles. (#56411)
tellthemachines Nov 22, 2023
ee6acea
Pattern placeholder: Remove duplicate 'useDispatch' hook (#56397)
Mamaduka Nov 22, 2023
1003417
Fix overly complex code example in ComboboxControl readme (#56365)
fabiankaegy Nov 22, 2023
3861da9
Block Editor: Undeprecate the '__experimentalImageSizeControl' compon…
Mamaduka Nov 22, 2023
d7d680e
Simplify code example in ToggleControl component readme (#56389)
fabiankaegy Nov 22, 2023
12f286c
Fix data view menu item radius (#56395)
jameskoster Nov 22, 2023
de3c98e
Bump plugin version to 17.1.0
gutenbergplugin Nov 22, 2023
014d163
Migrating `InserterListbox` to use updated Composite implementation (…
Nov 22, 2023
9c6f6b1
Update Changelog for 17.1.0
gutenbergplugin Nov 22, 2023
a791158
DataViews: update filter component (#56110)
oandregal Nov 22, 2023
3b380b0
Update Readme.txt tested up to 6.4 (#56427)
bph Nov 22, 2023
6e532f4
Add align support to the image block - alternative (#55954)
draganescu Nov 22, 2023
77d0226
fix remove removal version from deprecated prop (#56336)
fabiankaegy Nov 22, 2023
c3f0077
NavigableContainers: Fix doc typo in onKeyDown prop (#56352)
t-hamano Nov 22, 2023
3539a97
Improve tooltip for parent blocks on the block toolbar (#56146)
MaggieCabrera Nov 22, 2023
c5ac490
PostCSS style transformation: fail gracefully instead of throwing an …
zaguiini Nov 22, 2023
f73f8d2
Documentation: Add the attributes definition page to the create block…
youknowriad Nov 22, 2023
fbc962c
Theme JSON schema: add heading/button key to color definition (#55674)
t-hamano Nov 22, 2023
8b59123
Playwright Utils: Fix the method of getting post ID in 'publishPost' …
Mamaduka Nov 22, 2023
57f1171
Documentation: add new section to release docs about troubleshooting …
oandregal Nov 22, 2023
1694514
Migrating block editor `BlockPatternsList` component (#56210)
Nov 22, 2023
574f628
Slot: add styles prop to bubblesVirtually version (#56428)
ciampo Nov 22, 2023
2097500
Add focus rings to focusable disabled buttons (#56383)
Nov 22, 2023
564f236
Additional CSS: fix on change validation (#56434)
zaguiini Nov 22, 2023
e3a6917
Block Settings: Only display parent block selector on small screens (…
Mamaduka Nov 22, 2023
6ad5ca8
Add 'View site' action to 'Site updated' snackbar (#52693)
jameskoster Nov 22, 2023
aac7844
Update Changelog for 17.0.3
gutenbergplugin Nov 22, 2023
799c807
Post Schedule Panel: Fix Sass deprecation warning for division (#56412)
andrewserong Nov 22, 2023
8a2f5bc
Post Template: fix incorrect offset query (#56440)
t-hamano Nov 23, 2023
84de158
Fix fatal error when calling undefined block library function. (#56459)
tellthemachines Nov 23, 2023
084eefe
Bump plugin version to 17.1.1
gutenbergplugin Nov 23, 2023
8059f98
Update Changelog for 17.1.1
gutenbergplugin Nov 23, 2023
c57fb7b
Cover block: Pass dropZoneElement reference to fix dragging within co…
andrewserong Nov 23, 2023
6510154
Move the DisableNonContentBlocks component to the editor package (#56…
youknowriad Nov 23, 2023
c03a097
Block Editor: Optimize 'Connections' inspector controls (#56443)
Mamaduka Nov 23, 2023
56d1b71
[RNMobile] Fix ungroup functionality in `WarningMaxDepthExceeded` com…
fluiddot Nov 23, 2023
726fc06
Dataviews: Remove link from author (#56467)
ntsekouras Nov 23, 2023
2477561
useEntityRecord: Improve unit tests (#56415)
Mamaduka Nov 23, 2023
ea60d43
DataViews: Make disabled pagination buttons focusable (#56422)
ntsekouras Nov 23, 2023
0b6c4a0
DropdownMenu V2: add support for rendering in legacy popover slot (#5…
ciampo Nov 23, 2023
cc1870a
DataViews: Code Quality remove some unused props from action. (#56477)
jorgefilipecosta Nov 23, 2023
130a145
Dataviews: Add preview and grid view in templates list (#56382)
ntsekouras Nov 23, 2023
a7d76c3
Tooltip: Don't render buttons tooltip when show button text labels is…
afercia Nov 23, 2023
b55f86f
DropdownMenu V2 tweaks (#56041)
ciampo Nov 23, 2023
fc5619d
Revert "DropdownMenu V2: add support for rendering in legacy popover …
ciampo Nov 23, 2023
be5084a
Simplify dataviews view button (#56485)
jameskoster Nov 23, 2023
9e63f56
Update "All patterns" to "All" in block inserter (#55986)
SavPhill Nov 23, 2023
996004b
Site Editor: Fix template resolution for templates assigned as home p…
youknowriad Nov 23, 2023
352ab99
Performance: update base hash
youknowriad Nov 23, 2023
427fa76
Try Ariakit Select for new CustomSelectControl component (#55790)
brookewp Nov 23, 2023
fef5de2
Small tweaks to CreatePatternModal (#56016)
richtabor Nov 23, 2023
c58bb64
Bump plugin version to 17.1.2
gutenbergplugin Nov 23, 2023
d33755d
Update Changelog for 17.1.2
gutenbergplugin Nov 23, 2023
ab865c5
Core data: harmonize getRevision selector and resolver function signa…
ramonjd Nov 23, 2023
45ffee3
Try updating base performance hash again.
tellthemachines Nov 24, 2023
c6e3890
E2e tests: merge Puppeteer into single job, split Playwright further …
ellatrix Nov 24, 2023
55d0c84
Update data view menu item actions (#56398)
jameskoster Nov 24, 2023
fce345d
isResolving wasn't updated in https://github.com/WordPress/gutenberg/…
ramonjd Nov 24, 2023
7b504be
Migrate 'custom taxonomies' e2e test to Playwright (#56486)
Mamaduka Nov 24, 2023
e0c80ab
DataViews: scope names of V2 UI components (#56503)
oandregal Nov 24, 2023
af8ca1b
Documentation: Add thee block supports page to the create block tutor…
youknowriad Nov 24, 2023
543b26a
DataViews: rename `InFilter` component to `FilterSummary` (#56506)
oandregal Nov 24, 2023
88408e4
Editor: Move the template focus modes to the editor store (#56472)
youknowriad Nov 24, 2023
4d99bc2
Mobile Release v1.109.0 (#56475)
fluiddot Nov 24, 2023
1fb0d7b
Improve `Button` saving state accessibility. (#55547)
afercia Nov 24, 2023
a9720a0
Backmerge block renaming fixes/refactors from 6.4 branch into Gutenbe…
getdave Nov 24, 2023
2bcf4db
Migrating `StyleBook` to use updated `Composite` implementation (#55344)
Nov 24, 2023
cea885c
Save post button: avoid extra re-renders when enablng/disabling toolt…
ciampo Nov 25, 2023
5d86605
`BoxControl`: Update story and refactor to Typescript (#56462)
brookewp Nov 25, 2023
4a244f6
Add translator comments for strings containing date formats (#56531)
NekoJonez Nov 26, 2023
3cf3d19
the editor store action `savePost` doesn't expect to be passed an eve…
ramonjd Nov 26, 2023
26d96b6
Remove compatibility layer for WP 6.2 (#56464)
tellthemachines Nov 27, 2023
4155c00
List View: Expand state if a block is dragged to within a collapsed b…
andrewserong Nov 27, 2023
0246a6b
Design Tools: Fix last ToolsPanelItem styling (#56536)
aaronrobertshaw Nov 27, 2023
4f4386c
Style engine: allow CSS var output for fontSize and fontFamily and up…
ramonjd Nov 27, 2023
2d4000f
Fix FormTokenField suggestions broken scrollbar when `__experimentalE…
talldan Nov 27, 2023
0adb73f
Site Editor: Add a fallback template showing the title and content fo…
youknowriad Nov 27, 2023
c86154f
Dataviews: Update item actions in grid view (#56501)
ntsekouras Nov 27, 2023
e93c392
Disable renaming support for Nav Link block (#56425)
getdave Nov 27, 2023
0d75cf7
Add documentation for working with Javascript in
juanmaguitar Nov 18, 2023
563c5c8
Update JavaScript in the Block Editor
juanmaguitar Nov 18, 2023
1af993a
Update JavaScript assets enqueueing in the Editor
juanmaguitar Nov 18, 2023
017798f
added references
juanmaguitar Nov 19, 2023
6ad344f
small adjustments
juanmaguitar Nov 19, 2023
84b2c63
Update docs/getting-started/fundamentals-block-development/javascript…
juanmaguitar Nov 19, 2023
4c24719
small text adjustment
juanmaguitar Nov 19, 2023
13df8cd
Update docs/getting-started/fundamentals-block-development/javascript…
juanmaguitar Nov 19, 2023
4033de9
customized explanation about dependencies to match full example refer…
juanmaguitar Nov 19, 2023
b603127
minor adjustment
juanmaguitar Nov 19, 2023
10a374b
Update JavaScript resources and references
juanmaguitar Nov 19, 2023
5a3e823
Add custom webpack.config.js for build
juanmaguitar Nov 20, 2023
25cd80f
Added build process diagram
juanmaguitar Nov 20, 2023
f5f952d
Update build process diagram link
juanmaguitar Nov 20, 2023
bc28ab8
Check Grammar
juanmaguitar Nov 21, 2023
a3e876a
Merge branch 'fundamentals-block-development/javascript-in-the-block-…
juanmaguitar Nov 27, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 4 additions & 8 deletions .github/workflows/end2end-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,11 @@ concurrency:

jobs:
e2e-puppeteer:
name: Puppeteer - ${{ matrix.part }}
name: Puppeteer
runs-on: ubuntu-latest
if: ${{ github.repository == 'WordPress/gutenberg' || github.event_name == 'pull_request' }}
strategy:
fail-fast: false
matrix:
part: [1, 2, 3]
totalParts: [3]

steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
Expand All @@ -43,8 +40,7 @@ jobs:

- name: Running the tests
run: |
npx wp-scripts test-e2e --config=./packages/e2e-tests/jest.config.js --listTests > ~/.jest-e2e-tests
npx wp-scripts test-e2e --config=./packages/e2e-tests/jest.config.js --cacheDirectory="$HOME/.jest-cache" --runTestsByPath $( awk 'NR % ${{ matrix.totalParts }} == ${{ matrix.part }} - 1' < ~/.jest-e2e-tests )
npx wp-scripts test-e2e --config=./packages/e2e-tests/jest.config.js --cacheDirectory="$HOME/.jest-cache"

- name: Archive debug artifacts (screenshots, HTML snapshots)
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
Expand All @@ -69,8 +65,8 @@ jobs:
strategy:
fail-fast: false
matrix:
part: [1, 2, 3, 4]
totalParts: [4]
part: [1, 2, 3, 4, 5, 6, 7, 8]
totalParts: [8]

steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/performance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,13 @@ jobs:
- name: Compare performance with base branch
if: github.event_name == 'push'
# The base hash used here need to be a commit that is compatible with the current WP version
# The current one is bd2a881101727b03b0be09382b34841af5a3c03e and it needs to be updated every WP major release.
# The current one is b61dde2e5ec29d98801e623de968bfb286c5be3f and it needs to be updated every WP major release.
# It is used as a base comparison point to avoid fluctuation in the performance metrics.
run: |
WP_VERSION=$(awk -F ': ' '/^Tested up to/{print $2}' readme.txt)
IFS=. read -ra WP_VERSION_ARRAY <<< "$WP_VERSION"
WP_MAJOR="${WP_VERSION_ARRAY[0]}.${WP_VERSION_ARRAY[1]}"
./bin/plugin/cli.js perf $GITHUB_SHA bd2a881101727b03b0be09382b34841af5a3c03e --tests-branch $GITHUB_SHA --wp-version "$WP_MAJOR"
./bin/plugin/cli.js perf $GITHUB_SHA b61dde2e5ec29d98801e623de968bfb286c5be3f --tests-branch $GITHUB_SHA --wp-version "$WP_MAJOR"

- name: Compare performance with custom branches
if: github.event_name == 'workflow_dispatch'
Expand All @@ -97,7 +97,7 @@ jobs:
CODEHEALTH_PROJECT_TOKEN: ${{ secrets.CODEHEALTH_PROJECT_TOKEN }}
run: |
COMMITTED_AT=$(git show -s $GITHUB_SHA --format="%cI")
./bin/log-performance-results.js $CODEHEALTH_PROJECT_TOKEN trunk $GITHUB_SHA bd2a881101727b03b0be09382b34841af5a3c03e $COMMITTED_AT
./bin/log-performance-results.js $CODEHEALTH_PROJECT_TOKEN trunk $GITHUB_SHA b61dde2e5ec29d98801e623de968bfb286c5be3f $COMMITTED_AT

- name: Archive debug artifacts (screenshots, HTML snapshots)
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
Expand Down
47 changes: 44 additions & 3 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,46 @@
== Changelog ==

= 17.1.0-rc.1 =
= 17.1.2 =

## Changelog

### Bug Fixes

#### Block Editor

- PostCSS style transformation: fail gracefully instead of throwing an error (https://github.com/WordPress/gutenberg/pull/56093)

## Contributors

The following contributors merged PRs in this release:

@zaguiini


= 17.1.1 =

# Changelog

## Bug Fixes

### Block Library

Fix fatal error when calling undefined block library function. #56459


= 17.0.3 =

## Changelog

### Bug Fixes

#### Block Editor

- PostCSS style transformation: fail gracefully instead of throwing an error (https://github.com/WordPress/gutenberg/pull/56093)



= 17.1.0 =


## Changelog
Expand All @@ -27,7 +66,7 @@
#### Global Styles
- Global Style Revisions: Ensure consistent back button behaviour. ([55881](https://github.com/WordPress/gutenberg/pull/55881))
- Global Styles Revisions: More descriptive text timeline. ([55868](https://github.com/WordPress/gutenberg/pull/55868))
- Global styles revisions: Add route for single styles revisions. ([55827](https://github.com/WordPress/gutenberg/pull/55827))
- Global Styles Revisions: Add route for single styles revisions. ([55827](https://github.com/WordPress/gutenberg/pull/55827))

#### Block Locking
- Block Quick Navigation: Truncate text. ([56142](https://github.com/WordPress/gutenberg/pull/56142))
Expand Down Expand Up @@ -89,7 +128,7 @@
- DataViews: Make items per page an even number. ([55906](https://github.com/WordPress/gutenberg/pull/55906))
- DataViews: Make used taxonomy private. ([55918](https://github.com/WordPress/gutenberg/pull/55918))
- DataViews: Reset pagination upon filter change. ([55797](https://github.com/WordPress/gutenberg/pull/55797))
- Dataviews: Add a missing icon for the side by side view. ([55925](https://github.com/WordPress/gutenberg/pull/55925))
- DataViews: Add a missing icon for the side by side view. ([55925](https://github.com/WordPress/gutenberg/pull/55925))

#### Components
- DropdownMenu: Remove extra vertical space around the toggle button. ([56136](https://github.com/WordPress/gutenberg/pull/56136))
Expand Down Expand Up @@ -328,6 +367,8 @@ The following contributors merged PRs in this release:
@afercia @andrewhayward @andrewserong @anomiex @anton-vlasenko @aristath @artemiomorales @bph @brookewp @c4rl0sbr4v0 @chad1008 @ciampo @DAreRodz @dcalhoun @dsas @ellatrix @flootr @fluiddot @gaambo @glendaviesnz @gziolo @jameskoster @jeryj @jhnstn @joanrodas @jorgefilipecosta @JorgeVilchez95 @jsnajdr @juanmaguitar @kevin940726 @Mamaduka @masteradhoc @matiasbenedetto @ndiego @ntsekouras @oandregal @peterwilsoncc @pooja-muchandikar @priethor @ramonjd @renatho @richtabor @sacerro @scruffian @shimotmk @SiobhyB @Soean @swissspidy @t-hamano @talldan @tellthemachines @torounit @tyxla @WunderBart @youknowriad




= 17.0.2 =


Expand Down
4 changes: 2 additions & 2 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ This handbook should be considered the canonical resource for all things related
- [**WordPress Developer Blog**](https://developer.wordpress.org/news/) - An ever-growing resource of technical articles covering specific topics related to block development and a wide variety of use cases. The blog is also an excellent way to [keep up with the latest developments in WordPress](https://developer.wordpress.org/news/tag/roundup/).
- [**Learn WordPress**](https://learn.wordpress.org/) - The WordPress hub for learning resources where you can find courses like [Introduction to Block Development: Build your first custom block](https://learn.wordpress.org/course/introduction-to-block-development-build-your-first-custom-block/), [Converting a Shortcode to a Block](https://learn.wordpress.org/course/converting-a-shortcode-to-a-block/) or [Using the WordPress Data Layer](https://learn.wordpress.org/course/using-the-wordpress-data-layer/)
- [**WordPress.tv**](https://wordpress.tv/) - A hub of WordPress-related videos (from talks at WordCamps to recordings of online workshops) curated and moderated by the WordPress.org community. You’re sure to find something to aid your learning about [block development](https://wordpress.tv/?s=block%20development&sort=newest) or the [block-editor](https://wordpress.tv/?s=block%20editor&sort=relevance) here.
- [**Gutenberg repository**](https://github.com/WordPress/gutenberg/) - Development of the block editor project is carried out in this GitHub repository. It contains the code of interesting packages such as [`block-library`](https://github.com/WordPress/gutenberg/tree/trunk/packages/block-library/src) (core blocks) or [`components`](https://github.com/WordPress/gutenberg/tree/trunk/packages/components) (common UI elements). _The [block-development-examples](https://github.com/WordPress/block-development-examples) repository is another useful reference._

- [**Gutenberg repository**](https://github.com/WordPress/gutenberg/) - Development of the block editor project is carried out in this GitHub repository. It contains the code of interesting packages such as [`block-library`](https://github.com/WordPress/gutenberg/tree/trunk/packages/block-library/src) (core blocks) or [`components`](https://github.com/WordPress/gutenberg/tree/trunk/packages/components) (common UI elements). _The [gutenberg-examples](https://github.com/WordPress/gutenberg-examples) repository is another useful reference._
- [**End User Documentation**](https://wordpress.org/documentation/) - Documentation site targeted to the end user (not developers) where you can also find documentation about the [Block Editor](https://wordpress.org/documentation/category/block-editor/) and [working with blocks](https://wordpress.org/documentation/article/work-with-blocks/).

## Are you in the right place?

Expand Down
36 changes: 36 additions & 0 deletions docs/contributors/code/release.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ Similar requirements apply to releasing WordPress's [npm packages](https://devel
- [Automated cherry-picking](#automated-cherry-picking)
- [Manual cherry-picking](#manual-cherry-picking)
- [Publishing the release](#publishing-the-release)
- [Troubleshooting the release](#troubleshooting-the-release)
- [Documenting the release](#documenting-the-release)
- [Selecting the release highlights](#selecting-the-release-highlights)
- [Requesting release assets](#requesting-release-assets)
Expand Down Expand Up @@ -253,6 +254,41 @@ Once approved, the new Gutenberg version will be available to WordPress users al

The final step is to write a release post on [make.wordpress.org/core](https://make.wordpress.org/core/). You can find some tips on that below.

#### Troubleshooting the release

> The plugin was published to the WordPress.org plugin directory but the workflow failed.

This has happened ocassionally, see [this one](https://github.com/WordPress/gutenberg/actions/runs/6955409957/job/18924124118) for example.

It's important to check that:

- the plugin from the directory works as expected
- the ZIP contents (see [Downloads](https://plugins.trac.wordpress.org/browser/gutenberg/)) looks correct (doesn't have anything obvious missing)
- the [Gutenberg SVN repo](https://plugins.trac.wordpress.org/browser/gutenberg/) has two new commits (see [the log](https://plugins.trac.wordpress.org/browser/gutenberg/)):
- the `trunk` folder should have "Commiting version X.Y.Z"
- there is a new `tags/X.Y.Z` folder with the same contents as `trunk` whose latest commit is "Tagging version X.Y.Z"

Most likely, the tag folder couldn't be created. This is a [known issue](https://plugins.trac.wordpress.org/browser/gutenberg/) that [can be fixed manually](https://github.com/WordPress/gutenberg/issues/55295#issuecomment-1759292978).

Either substitute SVN_USERNAME, SVN_PASSWORD, and VERSION for the proper values or set them as global environment variables first:

```sh
# CHECKOUT THE REPOSITORY
svn checkout https://plugins.svn.wordpress.org/gutenberg/trunk --username "$SVN_USERNAME" --password "$SVN_PASSWORD" gutenberg-svn

# MOVE TO THE LOCAL FOLDER
cd gutenberg-svn

# IF YOU HAPPEN TO HAVE ALREADY THE REPO LOCALLY
# AND DIDN'T CHECKOUT, MAKE SURE IT IS UPDATED
# svn up .

# COPY CURRENT TRUNK INTO THE NEW TAGS FOLDER
svn copy https://plugins.svn.wordpress.org/gutenberg/trunk https://plugins.svn.wordpress.org/gutenberg/tags/$VERSION -m 'Tagging version $VERSION' --no-auth-cache --non-interactive --username "$SVN_USERNAME" --password "$SVN_PASSWORD"
```

Ask around if you need help with any of this.

### Documenting the release

Documenting the release is led by the release manager with the help of [Gutenberg development team](https://developer.wordpress.org/block-editor/block-editor/contributors/repository-management/#teams) members. This process is comprised of a series of sequential steps that, because of the number of people involved, and the coordination required, need to adhere to a timeline between the RC and stable releases. Stable Gutenberg releases happen on Wednesdays, one week after the initial RC.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Working with Javascript for the Block Editor

A JavaScript Build Process is recommended for most cases when working with Javascript for the Block Editor. With a build process, you'll be able to work with ESNext and JSX (among others) syntaxes and features in your code while producing code ready for the majority of the browsers.

## JavaScript Build Process

["ESNext"](https://developer.mozilla.org/en-US/docs/Web/JavaScript/JavaScript_technologies_overview#standardization_process) is a dynamic name that refers to Javascript's latest syntax and features. ["JSX"](https://react.dev/learn/writing-markup-with-jsx) is a custom syntax extension to JavaScript, created by React project, that allows you to write JavaScript using a familiar HTML tag-like syntax.

Browsers cannot interpret or run ESNext and JSX syntaxes, so a transformation step is needed to convert these syntaxes to code that browsers can understand.

["webpack"](https://webpack.js.org/concepts/why-webpack/) is a pluggable tool that processes JavaScript and creates a compiled bundle that runs in a browser. ["babel"](https://babeljs.io/) transforms JavaScript from one format to another. Babel is a webpack plugin to transform ESNext and JSX to production-ready JavaScript.

[`@wordpress/scripts`](https://developer.wordpress.org/block-editor/reference-guides/packages/packages-scripts/) package abstracts these libraries away to standardize and simplify development, so you won’t need to handle the details for configuring webpack or babel. Check the [Get started with wp-scripts](https://developer.wordpress.org/block-editor/getting-started/devenv/get-started-with-wp-scripts/) intro guide.


Among other things, with `wp-scripts` package you can use Javascript modules to distribute your code among different files and get a few bundled files at the end of the build process (see [example](https://github.com/WordPress/block-development-examples/tree/trunk/plugins/data-basics-59c8f8)).

[![Build Process Diagram](https://developer.wordpress.org/files/2023/11/build-process.png)](https://excalidraw.com/#json=4aNG9JUti3pMnsfoga35b,ihEAI8p5dwkpjWr6gQmjuw "Open Build Process Diagram in Excalidraw")

With the [proper `package.json` scripts](https://developer.wordpress.org/block-editor/getting-started/devenv/get-started-with-wp-scripts/#basic-usage) you can launch the build process with `wp-scripts` in production and development mode:

- **`npm run build` for "production" mode build** - This process [minifies the code](https://developer.mozilla.org/en-US/docs/Glossary/Minification) so it downloads faster in the browser.
- **`npm run start` for "development" mode build** - This process does not minify the code of the bundled files, provides [source maps files](https://firefox-source-docs.mozilla.org/devtools-user/debugger/how_to/use_a_source_map/index.html) for them, and additionally continues a running process to watch the source file for more changes and rebuilds as you develop.

<div class="callout callout-tip">
You can <a href="https://developer.wordpress.org/block-editor/reference-guides/packages/packages-scripts/#provide-your-own-webpack-config">provide your own custom <code>webpack.config.js</code></a> to <code>wp-scripts</code> to customize the build process to suit your needs
</div>

## Javascript without a build process

Using Javascript without a build process may be another good option for code developments with few requirements (especially those not requiring JSX).

Without a build process, you access the methods directly from the `wp` global object and must enqueue the script manually. [WordPress Javascript](https://developer.wordpress.org/block-editor/reference-guides/packages/) packages](https://developer.wordpress.org/block-editor/reference-guides/packages/) can be accessed through the `wp` [global variable](https://developer.mozilla.org/en-US/docs/Glossary/Global_variable) but every script that wants to use them through this `wp` object is responsible for adding [the handle or that package](https://developer.wordpress.org/block-editor/contributors/code/scripts/) to the dependency array when registered.

So, for example if a script wants to register a block variation using the `registerBlockVariation` method out of the ["blocks" package](https://developer.wordpress.org/block-editor/reference-guides/packages/packages-blocks/), the `wp-blocks` handle would need to get added to the dependency array to ensure that `wp.blocks.registerBlockVariation` is defined when the script tries to access it (see [example](https://github.com/wptrainingteam/block-theme-examples/blob/master/example-block-variation/functions.php)).

<div class="callout callout-tip">
Try running <code>wp.data.select('core/editor').getBlocks())</code> in your browser's dev tools while editing a post or a site. The entire editor is available from the console.
</div>

Use [`enqueue_block_editor_assets`](https://developer.wordpress.org/reference/hooks/enqueue_block_editor_assets/) hook coupled with the standard [`wp_enqueue_script`](https://developer.wordpress.org/reference/functions/wp_enqueue_script/) (and [`wp_register_script`](https://developer.wordpress.org/reference/functions/wp_register_script/)) to enqueue javascript assets for the Editor with access to these packages via `wp` (see [example](https://github.com/wptrainingteam/block-theme-examples/tree/master/example-block-variation)). Refer to [Enqueueing assets in the Editor](https://developer.wordpress.org/block-editor/how-to-guides/enqueueing-assets-in-the-editor/) for more info.

## Additional resources

- [Javascript Reference](https://developer.mozilla.org/en-US/docs/Web/JavaScript) | MDN Web Docs
- [block-development-examples](https://github.com/WordPress/block-development-examples) | GitHub repository
- [block-theme-examples](https://github.com/wptrainingteam/block-theme-examples) | GitHub repository
- [Get started with wp-scripts](https://developer.wordpress.org/block-editor/getting-started/devenv/get-started-with-wp-scripts/) | Block Editor Handbook
- [Enqueueing assets in the Editor](https://developer.wordpress.org/block-editor/how-to-guides/enqueueing-assets-in-the-editor/) | Block Editor Handbook
- [Wordpress Packages handles](https://developer.wordpress.org/block-editor/contributors/code/scripts/) | Block Editor Handbook
- [How webpack and WordPress packages interact](https://developer.wordpress.org/news/2023/04/how-webpack-and-wordpress-packages-interact/) | Developer Blog
6 changes: 6 additions & 0 deletions docs/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -785,6 +785,12 @@
"markdown_source": "../packages/components/src/confirm-dialog/README.md",
"parent": "components"
},
{
"title": "CustomSelectControlV2",
"slug": "custom-select-control-v2",
"markdown_source": "../packages/components/src/custom-select-control-v2/README.md",
"parent": "components"
},
{
"title": "CustomSelectControl",
"slug": "custom-select-control",
Expand Down
Loading
Loading