Skip to content

Conversation

@dannyhw
Copy link
Collaborator

@dannyhw dannyhw commented Dec 8, 2025

fixes: #1312 #1295

Summary

Fixes NativeWind integration being broken when using SWC loader.

The issue was in getTransformReactRuntimeConfig which unconditionally overwrote runtime and importSource from reactRuntimeConfig, even when those values were undefined. This would clobber the custom importSource that NativeWind sets in the SWC config (e.g., nativewind).

The fix uses nullish coalescing (??) to preserve existing values when reactRuntimeConfig doesn't provide overrides.

Test plan

  1. Set up a project with NativeWind configured
  2. Run the app with SWC loader
  3. Verify NativeWind styles work correctly (previously they would break because importSource was overwritten)

@changeset-bot
Copy link

changeset-bot bot commented Dec 8, 2025

🦋 Changeset detected

Latest commit: c943fc9

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 6 packages
Name Type
@callstack/repack Patch
@callstack/repack-plugin-expo-modules Patch
@callstack/repack-plugin-nativewind Patch
@callstack/repack-plugin-reanimated Patch
@callstack/repack-dev-server Patch
@callstack/repack-init Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel
Copy link

vercel bot commented Dec 8, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
repack-website Ready Ready Preview Comment Dec 9, 2025 4:08pm

@jbroma
Copy link
Member

jbroma commented Dec 9, 2025

btw @dannyhw we should totally have unit tests for this and test the possible scenarios 💯

@dannyhw
Copy link
Collaborator Author

dannyhw commented Dec 9, 2025

tests added 👍

Copy link
Member

@jbroma jbroma left a comment

Choose a reason for hiding this comment

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

LGTM 🎉

@jbroma
Copy link
Member

jbroma commented Dec 9, 2025

@dannyhw can you please add changeset entry? Run pnpm changeset add in the root of the repo and follow instructions. You can take a look at release notes of @callstack/repack to see how the descriptions should roughly look like

@dannyhw
Copy link
Collaborator Author

dannyhw commented Dec 9, 2025

On it 👍

…case

fix: use a better fallback

docs: remove some notes that are no longer necessary

docs: more clarification

docs: fix formatting and wording

moving docs changes to separate pr

review: inline default values

test: add coverage for react transforms being included

fix: add changeset

fix: adjust changeset

fix: adjust changeset
@dannyhw dannyhw force-pushed the dannyhw/fix/nativewind-importsource-overwritten branch from 69e781e to c943fc9 Compare December 9, 2025 16:08
Copy link
Member

@jbroma jbroma left a comment

Choose a reason for hiding this comment

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

LGTM 🎉

@jbroma jbroma merged commit 8964e05 into main Dec 9, 2025
6 checks passed
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.

Whats the status of nativewind support

3 participants