Skip to content

Conversation

fi3ework
Copy link
Member

Summary

the second step after web-infra-dev/rspack#11664.

the JavaScript parser must be set to support jsx or it will panic in paring JSX syntax.

Related Links

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

@Copilot Copilot AI review requested due to automatic review settings September 24, 2025 09:46
Copy link

netlify bot commented Sep 24, 2025

Deploy Preview for rsbuild ready!

Name Link
🔨 Latest commit 371e934
🔍 Latest deploy log https://app.netlify.com/projects/rsbuild/deploys/68d3bde4a8881b0009f147ae
😎 Deploy Preview https://deploy-preview-6240--rsbuild.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 78 (🟢 up 9 from production)
Accessibility: 97 (no change from production)
Best Practices: 100 (no change from production)
SEO: 100 (no change from production)
PWA: 60 (no change from production)
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR completes the implementation of the preserve React runtime by configuring the JavaScript parser to support JSX syntax. When using the preserve runtime mode, the parser must be explicitly configured to handle JSX, otherwise it will panic during parsing.

  • Added parser configuration to set javascript.jsx to true when preserve runtime is used
  • Added test coverage to verify the parser configuration is correctly applied

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
packages/plugin-react/src/react.ts Added conditional logic to configure JavaScript parser for JSX when preserve runtime is used
packages/plugin-react/tests/index.test.ts Added test case to verify parser configuration for preserve runtime
packages/plugin-react/tests/snapshots/index.test.ts.snap Added snapshot for the new test case

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link
Member

@chenjiahan chenjiahan left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@chenjiahan chenjiahan merged commit d74404e into web-infra-dev:main Sep 24, 2025
12 checks passed
@chenjiahan
Copy link
Member

Releasing: #6241

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants