Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add oxc jsxInclude and jsxExclude #63

Merged
merged 6 commits into from
Oct 18, 2024
Merged

Conversation

underfin
Copy link
Collaborator

@underfin underfin commented Oct 18, 2024

Description

Conside the react plugin has two edge case

  • ssr need to disable refresh transformer, here disabled refresh at internal
  • the js mdx extension should be enabled refresh transformer, here add a jsxInclude option to do it.

Comment on lines 200 to 203
// disable refresh at ssr
if (options?.ssr && oxcTransformOptions.jsx?.refresh) {
oxcTransformOptions.jsx.refresh = false
}

Choose a reason for hiding this comment

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

Just to confirm, this refresh option is only for React and won't be used by other JSX frameworks, right? (If it can be used then, I guess we cannot use the assumption that refresh should be false for ssr.)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'm not sure other JSX frameworks hmr how to works. Let me check it.

Copy link
Collaborator Author

@underfin underfin Oct 18, 2024

Choose a reason for hiding this comment

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

I think it is only for react at now. We could change it if here found other cases.

packages/vite/src/node/plugins/oxc.ts Outdated Show resolved Hide resolved
packages/vite/src/node/plugins/oxc.ts Outdated Show resolved Hide resolved
underfin and others added 3 commits October 18, 2024 19:46
Co-authored-by: 翠 / green <green@sapphi.red>
Co-authored-by: 翠 / green <green@sapphi.red>
@underfin underfin merged commit 3a82b11 into rolldown-v6 Oct 18, 2024
10 checks passed
@IWANABETHATGUY IWANABETHATGUY deleted the add-oxc-jsx-include branch October 18, 2024 13:09
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.

2 participants