Skip to content

fix(vxrn): inject TAMAGUI_TARGET into native rolldown bundle defines#714

Merged
natew merged 1 commit into
mainfrom
fix/rolldown-native-tamagui-target
Jun 9, 2026
Merged

fix(vxrn): inject TAMAGUI_TARGET into native rolldown bundle defines#714
natew merged 1 commit into
mainfrom
fix/rolldown-native-tamagui-target

Conversation

@natew

@natew natew commented Jun 9, 2026

Copy link
Copy Markdown
Collaborator

Problem

Native iOS Tests (prod, rolldown) fails on main:

FAIL tests/vite-features/import-meta-env.test.ios.ts > import.meta.env
AssertionError: expected '' to be 'native'
  ❯ import-meta-env.test.ios.ts:51  expect(tamaguiTarget).toBe('native')

The test page reads import.meta.env.TAMAGUI_TARGET directly. In the rolldown native build that identifier was never defined, so it resolved to ''. The metro variants passed because metro's getPlatformEnvDefine (vite-plugin-metro/src/env/platformEnv.ts) injects the full PlatformEnv set — including TAMAGUI_TARGET: 'native'.

The shared rolldown native define-builder (getNativeTransformConfig in vxrn/src/utils/createNativeDevEngine.ts, used by both the dev engine and prod buildNativeBundle) injected VITE_ENVIRONMENT/VITE_NATIVE/EXPO_OS and process.env.TAMAGUI_ENVIRONMENT, but omitted TAMAGUI_TARGET entirely (both process.env.* and import.meta.env.*, and from the whole-object import.meta.env define).

Fix

Add to the native define-builder, matching metro parity (native → TAMAGUI_TARGET: 'native', TAMAGUI_ENVIRONMENT: platform):

  • envObject: TAMAGUI_TARGET, TAMAGUI_ENVIRONMENT
  • process.env.TAMAGUI_TARGET
  • import.meta.env.TAMAGUI_TARGET, import.meta.env.TAMAGUI_ENVIRONMENT

Verification

  • New regression test createNativeDevEngine.test.ts (ios/android × dev/prod) asserting the defines — passes, and fails without the change (keys absent).
  • Full vxrn suite: 37/37 pass · typecheck exit 0 · oxlint 0/0.
  • Real iOS E2E validates on this PR's CI run.

import.meta.env.TAMAGUI_TARGET resolved to '' in prod rolldown native
builds because the shared native define-builder omitted it (metro's
platformEnv had it, rolldown didn't). Adds TAMAGUI_TARGET + import.meta
TAMAGUI_ENVIRONMENT to match metro parity, plus a regression test.

Fixes Native iOS Tests (prod, rolldown) import-meta-env failure.
@railway-app railway-app Bot temporarily deployed to onestack.dev / one-pr-714 June 9, 2026 03:50 Destroyed
@railway-app

railway-app Bot commented Jun 9, 2026

Copy link
Copy Markdown

🚅 Deployed to the one-pr-714 environment in onestack.dev

Service Status Web Updated (UTC)
one ✅ Success (View Logs) Web Jun 9, 2026 at 3:55 am

@natew natew added this pull request to the merge queue Jun 9, 2026
Merged via the queue into main with commit 49fd5d0 Jun 9, 2026
7 of 9 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.

1 participant