Skip to content

Fix production JS builds compiling JSX in development mode - #8162

Merged
Naragod merged 1 commit into
releasefrom
v2.10.2_fix_production_jsx_runtime
Sep 9, 2026
Merged

Naragod merged 1 commit into
releasefrom
v2.10.2_fix_production_jsx_runtime

Conversation

@Naragod

@Naragod Naragod commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Cherry-picks #8150 onto release so the branch builds a correct production bundle on its own.

Why

v2.10.2 shipped without this fix. @babel/preset-react compiled JSX in development mode, so the production bundle called jsxDEV, which React's production build does not provide. The bundle died on its first component and pages lost their React tables.

The workaround on the servers was an asset rebuild with NODE_ENV=production exported by hand. This commit makes the build set it itself.

Scope

File Change
babel.config.js preset-react receives development: isDevelopmentEnv || isTestEnv
webpack.production.js sets BABEL_ENV and NODE_ENV before webpack loads
Changelog.md one bug-fix line under [unreleased]

Verification

  • Clean cherry-pick of ec4bf2b from master. Zero conflicts.
  • babel.config.js and webpack.production.js md5-match master byte for byte.
  • Both files also md5-match the copies running on ben and tiny, where the rebuilt bundle carries zero jsxDEV calls.
  • Original PR Fix production JS builds compiling JSX in development mode #8150 passed jest, rspec, brakeman, CodeQL, and pre-commit on master.

Tag

The v2.10.2 tag stays where it is. This commit lands on release only, so deployed boxes stop being a hand patch. #8150 keeps its v2.10.3 milestone.

@david-yz-liu david-yz-liu left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks good to me, thanks @Naragod

@coveralls

Copy link
Copy Markdown
Collaborator

Coverage Report for CI Build 34390073319

Warning

No base build found for commit 8b3a14a on release.
Coverage changes can't be calculated without a base build.
If a base build is processing, this comment will update automatically when it completes.

Coverage: 90.514%

Details

  • Patch coverage: No coverable lines changed in this PR.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

Requires a base build to compare against. How to fix this →


Coverage Stats

Coverage Status
Relevant Lines: 51662
Covered Lines: 47781
Line Coverage: 92.49%
Relevant Branches: 2471
Covered Branches: 1217
Branch Coverage: 49.25%
Branches in Coverage %: Yes
Coverage Strength: 133.89 hits per line

💛 - Coveralls

@Naragod
Naragod merged commit 4fcc452 into release Sep 9, 2026
9 checks passed
This was referenced Sep 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants