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

Fix loading react-jsxdev instead of react-jsx #17013

Merged
merged 6 commits into from
Feb 3, 2025
Merged

Conversation

Jarred-Sumner
Copy link
Collaborator

What does this PR do?

Fixes #3768

Fix loading react-jsxdev instead of react-jsx

The main bug: the state of the resolver sometimes got out of sync with the state of the transpiler for tracking if it should use development JSX or non-development JSX. This meant that setting NODE_ENV to a value in the parent process that is different than the environment seen from Bun.build would cause this to not work properly.

Separately, I also implemented tracking react-jsx and react-jsxdev to work as expected.

How did you verify your code works?

There is a test that runs each permutation of NODE_ENV for runtime and bundler.

There is also a test for Bun.serve() static

@robobun
Copy link

robobun commented Feb 3, 2025

Updated 2:07 PM PT - Feb 3rd, 2025

@paperclover, your commit 523bf96 has 1 failures in Build #11064:


🧪   try this PR locally:

bunx bun-pr 17013

Copy link
Member

@paperclover paperclover left a comment

Choose a reason for hiding this comment

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

review comments addressed in person. i will probably fix these last points

  • convert ?bool into an enum tristate between unspecified, production, development
  • document the behavior

src/options.zig Show resolved Hide resolved
src/options.zig Outdated Show resolved Hide resolved
- print "DEV" when running index.html
- tla check error message fixes
- tidy up internal docs
@Jarred-Sumner Jarred-Sumner merged commit 7a918d2 into main Feb 3, 2025
68 of 69 checks passed
@Jarred-Sumner Jarred-Sumner deleted the jarred/jsx-prod branch February 3, 2025 22:10
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.

Bun.build always assume "react-jsxdev" even when set "react-jsx"
3 participants