Skip to content

Conversation

@sapphi-red
Copy link
Member

@sapphi-red sapphi-red commented Jul 28, 2025

Description

Removed development: command === 'serve' so that the development JSX transform is used for NODE_ENV=development build.

I didn't add a test case as I though it requires setting up a custom setup (otherwise the process.env change leaks to other tests) and this is a bit edge case one. But I'll add one if you have any ideas.

fixes #622

@sapphi-red sapphi-red added p3-minor-bug 🔨 An edge case that only affects very specific usage (priority) plugin: react labels Jul 28, 2025
@sapphi-red sapphi-red marked this pull request as ready for review July 28, 2025 09:09
Copy link
Member

@ArnaudBarre ArnaudBarre left a comment

Choose a reason for hiding this comment

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

To be sure to understand: vite-rolldown core set the initial value of oxc.jsx.devlopment based on NODE_ENV?

I'm fine with no tests for this case

@sapphi-red
Copy link
Member Author

To be sure to understand: vite-rolldown core set the initial value of oxc.jsx.devlopment based on NODE_ENV?

Yes 👍
https://github.com/vitejs/rolldown-vite/blob/e2bb54e794947c45e2a438c2df187e953ac5916c/packages/vite/src/node/config.ts#L1749

Copy link
Contributor

@hi-ogawa hi-ogawa left a comment

Choose a reason for hiding this comment

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

Isn't this tested by dev-production and build-development in packages/plugin-rsc/e2e/starter.test.ts, which now pass?

@sapphi-red
Copy link
Member Author

Isn't this tested by dev-production and build-development in packages/plugin-rsc/e2e/starter.test.ts, which now pass?

Yes, it is covered by them. But it's indirect.

@sapphi-red sapphi-red merged commit 9ffd86d into main Jul 28, 2025
30 of 31 checks passed
@sapphi-red sapphi-red deleted the fix/react-node-env-development-build branch July 28, 2025 10:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

p3-minor-bug 🔨 An edge case that only affects very specific usage (priority) plugin: react

Projects

None yet

Development

Successfully merging this pull request may close these issues.

(oxc) Support jsx development runtime transform on vite build (and vice verse)

3 participants