Skip to content

Free: Upgrade WP babel-preset-default#22491

Merged
thijsoo merged 2 commits intotrunkfrom
253-upgrade-wordpressbabel-preset-default
Sep 29, 2025
Merged

Free: Upgrade WP babel-preset-default#22491
thijsoo merged 2 commits intotrunkfrom
253-upgrade-wordpressbabel-preset-default

Conversation

@igorschoester
Copy link
Copy Markdown
Contributor

@igorschoester igorschoester commented Aug 12, 2025

Context

Important

Branched out (and pointing into) the branch of #22466 to have the latest WP package versions already.
Ensure that gets merged before this and GitHub should auto-adjust this to be merged into trunk instead.

Basically following these versions: https://make.wordpress.org/core/2024/06/06/jsx-in-wordpress-6-6/
In React 19 the JSX transform is required: https://react.dev/blog/2024/04/25/react-19-upgrade-guide#new-jsx-transform-is-now-required

Summary

This PR can be summarized in the following changelog entry:

  • [@yoast/babel-preset 1.0.0 enhancement] Upgrades @wordpress/babel-preset-default to v8 from v6. Breaking due to Node 18 requirement and incompatibility with WP v6.5 and below.

Relevant technical choices:

What is affected? Search for where this preset is being used

What changed? Before the #22466 the React code was transpiled using createElement from react. Which changed to now jsx from react/jsx-runtime.
See https://legacy.reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html
You can inspect an JS asset in js/dist, say editor-modules.js.
If you build on trunk you will see something like react__WEBPACK_IMPORTED_MODULE_0__.createElement and on this (and the parent branch already) you will instead see something like react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs

Test instructions

Test instructions for the acceptance test before the PR gets merged

This PR can be acceptance tested by following these steps:

Relevant test scenarios

  • Changes should be tested with the browser console open
  • Changes should be tested on different posts/pages/taxonomies/custom post types/custom taxonomies
  • Changes should be tested on different editors (Default Block/Gutenberg/Classic/Elementor/other)
  • Changes should be tested on different browsers
  • Changes should be tested on multisite

Test instructions for QA when the code is in the RC

  • QA should use the same steps as above.

QA can test this PR by following these steps:

  • Not more than normal smoke tests for RCs I reckon.

Impact check

This PR affects the following parts of the plugin, which may require extra testing:

  • All our React code

UI changes

  • This PR changes the UI in the plugin. I have added the 'UI change' label to this PR.

Other environments

  • This PR also affects Shopify. I have added a changelog entry starting with [shopify-seo], added test instructions for Shopify and attached the Shopify label to this PR.

Documentation

  • I have written documentation for this change. For example, comments in the Relevant technical choices, comments in the code, documentation on Confluence / shared Google Drive / Yoast developer portal, or other.

Quality assurance

  • I have tested this code to the best of my abilities.
  • During testing, I had activated all plugins that Yoast SEO provides integrations for.
  • I have added unit tests to verify the code works as intended.
  • If any part of the code is behind a feature flag, my test instructions also cover cases where the feature flag is switched off.
  • I have written this PR in accordance with my team's definition of done.
  • I have checked that the base branch is correctly set.

Innovation

  • No innovation project is applicable for this PR.
  • This PR falls under an innovation project. I have attached the innovation label.
  • I have added my hours to the WBSO document.

Fixes https://github.com/Yoast/reserved-tasks/issues/253

@igorschoester igorschoester added the changelog: non-user-facing Needs to be included in the 'Non-userfacing' category in the changelog label Aug 12, 2025
@github-actions
Copy link
Copy Markdown

@igorschoester Please be aware that following packages have been abandoned and are not actively maintained anymore:

Package name Path
@yoast/babel-preset packages/babel-preset
@yoast/components packages/components
@yoast/e2e-tests packages/e2e-tests
@yoast/helpers packages/helpers
@yoast/jest-preset packages/jest-preset
@yoast/style-guide packages/style-guide
eslint-config-yoast packages/esling-config-yoast

Please consider using the other packages instead.

Base automatically changed from 681-free-bump-wp-packages-to-minimum-supported-wp-version to trunk August 13, 2025 14:11
@github-actions
Copy link
Copy Markdown

A merge conflict has been detected for the proposed code changes in this PR. Please resolve the conflict by either rebasing the PR or merging in changes from the base branch.

@github-actions
Copy link
Copy Markdown

@thijsoo Please be aware that following packages have been abandoned and are not actively maintained anymore:

Package name Path
@yoast/babel-preset packages/babel-preset
@yoast/components packages/components
@yoast/e2e-tests packages/e2e-tests
@yoast/helpers packages/helpers
@yoast/jest-preset packages/jest-preset
@yoast/style-guide packages/style-guide
eslint-config-yoast packages/esling-config-yoast

Please consider using the other packages instead.

@coveralls
Copy link
Copy Markdown

Pull Request Test Coverage Report for Build 3c47d8ece53b36f5e8cf90440da6131a13f3b595

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall first build on 253-upgrade-wordpressbabel-preset-default at 30.109%

Totals Coverage Status
Change from base Build ed41ad5dbaf816698bf747d566d76927bb467dc9: 30.1%
Covered Lines: 4862
Relevant Lines: 14873

💛 - Coveralls

Copy link
Copy Markdown
Contributor

@thijsoo thijsoo left a comment

Choose a reason for hiding this comment

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

CR + ACC 👍

@thijsoo thijsoo added this to the 26.2 milestone Sep 29, 2025
@thijsoo thijsoo merged commit 321522b into trunk Sep 29, 2025
21 of 22 checks passed
@thijsoo thijsoo deleted the 253-upgrade-wordpressbabel-preset-default branch September 29, 2025 08:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog: non-user-facing Needs to be included in the 'Non-userfacing' category in the changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants