diff --git a/.github/setup-node/action.yml b/.github/setup-node/action.yml index 22cb81618a1ef..fccce2e4e93bc 100644 --- a/.github/setup-node/action.yml +++ b/.github/setup-node/action.yml @@ -14,6 +14,7 @@ runs: with: node-version-file: '.nvmrc' node-version: ${{ inputs.node-version }} + check-latest: true cache: npm - name: Get Node.js and npm version diff --git a/.github/workflows/build-plugin-zip.yml b/.github/workflows/build-plugin-zip.yml index 8f649f1e15889..a2628bf7af616 100644 --- a/.github/workflows/build-plugin-zip.yml +++ b/.github/workflows/build-plugin-zip.yml @@ -174,6 +174,7 @@ jobs: uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0 with: node-version-file: '.nvmrc' + check-latest: true cache: npm - name: Build Gutenberg plugin ZIP file @@ -336,6 +337,7 @@ jobs: with: node-version-file: 'main/.nvmrc' registry-url: 'https://registry.npmjs.org' + check-latest: true - name: Publish packages to npm ("latest" dist-tag) run: | diff --git a/.github/workflows/bundle-size.yml b/.github/workflows/bundle-size.yml index 3b4d51bddbda0..23b245cb6f114 100644 --- a/.github/workflows/bundle-size.yml +++ b/.github/workflows/bundle-size.yml @@ -46,6 +46,7 @@ jobs: uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0 with: node-version-file: '.nvmrc' + check-latest: true cache: npm - uses: preactjs/compressed-size-action@8119d3d31b6e57b167e09c81dfa877eada3bcb35 # v2.5.0 diff --git a/.github/workflows/create-block.yml b/.github/workflows/create-block.yml index 0e4325b53f69d..d817ac1e0be97 100644 --- a/.github/workflows/create-block.yml +++ b/.github/workflows/create-block.yml @@ -14,14 +14,14 @@ concurrency: jobs: checks: - name: Checks + name: Checks w/Node.js ${{ matrix.node }} on ${{ matrix.os }} runs-on: ${{ matrix.os }} if: ${{ github.repository == 'WordPress/gutenberg' || github.event_name == 'pull_request' }} strategy: fail-fast: false matrix: - node: ['16'] - os: [macos-latest, ubuntu-latest, windows-latest] + node: ['20', '21'] + os: ['macos-latest', 'ubuntu-latest', 'windows-latest'] steps: - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 diff --git a/.github/workflows/end2end-test.yml b/.github/workflows/end2end-test.yml index ddbf714cb5023..d065bf8afad44 100644 --- a/.github/workflows/end2end-test.yml +++ b/.github/workflows/end2end-test.yml @@ -20,8 +20,6 @@ jobs: name: Puppeteer runs-on: ubuntu-latest if: ${{ github.repository == 'WordPress/gutenberg' || github.event_name == 'pull_request' }} - strategy: - fail-fast: false steps: - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 diff --git a/.github/workflows/publish-npm-packages.yml b/.github/workflows/publish-npm-packages.yml index 18bdb63a6c377..163012451d600 100644 --- a/.github/workflows/publish-npm-packages.yml +++ b/.github/workflows/publish-npm-packages.yml @@ -71,6 +71,7 @@ jobs: with: node-version-file: 'cli/.nvmrc' registry-url: 'https://registry.npmjs.org' + check-latest: true - name: Setup Node.js (for WP major version) if: ${{ github.event.inputs.release_type == 'wp' && github.event.inputs.wp_version }} @@ -78,6 +79,7 @@ jobs: with: node-version-file: 'publish/.nvmrc' registry-url: 'https://registry.npmjs.org' + check-latest: true - name: Publish development packages to npm ("next" dist-tag) if: ${{ github.event.inputs.release_type == 'development' }} diff --git a/.github/workflows/pull-request-automation.yml b/.github/workflows/pull-request-automation.yml index b8154e335776a..785b42a19054d 100644 --- a/.github/workflows/pull-request-automation.yml +++ b/.github/workflows/pull-request-automation.yml @@ -8,9 +8,6 @@ jobs: pull-request-automation: runs-on: ubuntu-latest if: ${{ github.repository == 'WordPress/gutenberg' }} - strategy: - matrix: - node: ['16'] steps: # Checkout defaults to using the branch which triggered the event, which @@ -23,7 +20,8 @@ jobs: - name: Use desired version of Node.js uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0 with: - node-version: ${{ matrix.node }} + node-version-file: '.nvmrc' + check-latest: true - name: Cache NPM packages uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3.3.2 diff --git a/.github/workflows/static-checks.yml b/.github/workflows/static-checks.yml index ff8c27b14e39e..2465f357a97cf 100644 --- a/.github/workflows/static-checks.yml +++ b/.github/workflows/static-checks.yml @@ -30,6 +30,7 @@ jobs: uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0 with: node-version-file: '.nvmrc' + check-latest: true cache: npm - name: Npm install diff --git a/.github/workflows/unit-test.yml b/.github/workflows/unit-test.yml index 78f70cc4ed9f7..b6d5465ab43a6 100644 --- a/.github/workflows/unit-test.yml +++ b/.github/workflows/unit-test.yml @@ -21,14 +21,13 @@ concurrency: jobs: unit-js: - name: JavaScript + name: JavaScript (Node.js ${{ matrix.node }}) runs-on: ubuntu-latest if: ${{ github.repository == 'WordPress/gutenberg' || github.event_name == 'pull_request' }} - strategy: fail-fast: false matrix: - node: ['16'] + node: ['20', '21'] steps: - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 @@ -40,7 +39,7 @@ jobs: with: node-version: ${{ matrix.node }} - - name: Npm build + - name: npm build # It's not necessary to run the full build, since Jest can interpret # source files with `babel-jest`. Some packages have their own custom # build tasks, however. These must be run. diff --git a/.nvmrc b/.nvmrc index b6a7d89c68e0c..209e3ef4b6247 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -16 +20 diff --git a/docs/contributors/code/getting-started-with-code-contribution.md b/docs/contributors/code/getting-started-with-code-contribution.md index c3282c0f8003d..30a78037ab75e 100644 --- a/docs/contributors/code/getting-started-with-code-contribution.md +++ b/docs/contributors/code/getting-started-with-code-contribution.md @@ -5,7 +5,7 @@ The following guide is for setting up your local environment to contribute to th ## Prerequisites - Node.js - Gutenberg is a JavaScript project and requires [Node.js](https://nodejs.org/). The project is built using Node.js v16, and npm v8. See the [LTS release schedule](https://github.com/nodejs/Release#release-schedule) for details. + Gutenberg is a JavaScript project that requires [Node.js](https://nodejs.org/). The project is currently built using Node.js v20 and npm v10. Though best efforts are made to always use the Active LTS version of Node.js, this will not always be the case. For more details, please refer to the [Node.js release schedule](https://github.com/nodejs/Release#release-schedule). We recommend using the [Node Version Manager](https://github.com/nvm-sh/nvm) (nvm) since it is the easiest way to install and manage node for macOS, Linux, and Windows 10 using WSL2. See [our Development Tools guide](/docs/getting-started/devenv/README.md#development-tools) or the Nodejs site for additional installation instructions. diff --git a/package-lock.json b/package-lock.json index 478570140e51a..88404c01a18a9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -249,8 +249,8 @@ "worker-farm": "1.7.0" }, "engines": { - "node": ">=16.0.0", - "npm": ">=8 <9" + "node": ">=20.10.0", + "npm": ">=10.2.3" } }, "node_modules/@aashutoshrathi/word-wrap": { diff --git a/package.json b/package.json index e1dd7fba27077..489a55cd90453 100644 --- a/package.json +++ b/package.json @@ -15,8 +15,8 @@ "url": "https://github.com/WordPress/gutenberg/issues" }, "engines": { - "node": ">=16.0.0", - "npm": ">=8 <9" + "node": ">=20.10.0", + "npm": ">=10.2.3" }, "config": { "IS_GUTENBERG_PLUGIN": true diff --git a/platform-docs/docs/intro.md b/platform-docs/docs/intro.md index 79a142731891e..b8961040715c7 100644 --- a/platform-docs/docs/intro.md +++ b/platform-docs/docs/intro.md @@ -9,7 +9,7 @@ Let's discover how to use the **Gutenberg Block Editor** to build your own block ## What you'll need -- [Node.js](https://nodejs.org/en/download/) version 16.14 or above. +- [Node.js](https://nodejs.org/en/download/) version 20.10 or above. - We're going to be using "vite" to setup our single page application (SPA) that contains a block editor. You can use your own setup, and your own application for this. ## Preparing the SPA powered by Vite. @@ -59,7 +59,7 @@ registerCoreBlocks(); function Editor() { const [blocks, setBlocks] = useState([]); return ( - {/* + {/* The BlockEditorProvider is the wrapper of the block editor's state. All the UI elements of the block editor need to be rendered within this provider. */} @@ -82,4 +82,4 @@ const root = createRoot(document.getElementById("app")); root.render(); ``` -That's it! You now have a very basic block editor with several block types included by default: paragraphs, headings, lists, quotes, images... \ No newline at end of file +That's it! You now have a very basic block editor with several block types included by default: paragraphs, headings, lists, quotes, images...