Skip to content

feat(expo): export and check the example on the web - #1051

Open
owjs3901 wants to merge 2 commits into
feat/react-native-compatfrom
feat/react-native-web
Open

owjs3901 wants to merge 2 commits into
feat/react-native-compatfrom
feat/react-native-web

Conversation

@owjs3901

Copy link
Copy Markdown
Contributor

Part of #411, depends on #1050 (base: feat/react-native-compat). PR 11 of the React Native plan: Expo web (D5).

What it does

As decided in D5, the web build of an Expo app uses the same native output as iOS and Android. Metro compiles it with platform: 'web', and react-native-web turns the StyleSheet objects into CSS. The compiler already took web as a platform (with _web blocks) since #1044, so this PR proves the whole path end to end and documents it.

  • apps/expo:
    • It adds the web dependencies Expo SDK 58 asks for: react-native-web ~0.21.4 and @expo/metro-runtime ~58.0.17. It also adds react-dom ^19.3.1, so that it matches the workspace's React exactly. SDK 58's 19.3.0 would have moved the hoisted react-dom under every other app.
    • It adds "web" to platforms in app.json, and --platform web to export.
    • It adds testIDs to the card, the input and the two buttons. react-native-web renders them as data-testid.
  • check-bundle.mjs: it now checks the web bundle as well, with the same assertions as iOS and Android:
    • no placeholder and no Devup UI module except the runtime;
    • the hoisted styles and Pressable's style function;
    • Reanimated and the runtime used by App.tsx.
  • check-web.mjs (new): it serves dist/ and opens it in Chromium (Playwright), then checks what react-native-web renders:
    • the card is rgb(255, 255, 255) in the light theme;
    • the count button is #5a44ff;
    • the input's border turns #5a44ff on focus, through the runtime's Focused;
    • a press counts;
    • pressing "Switch to dark" turns the card rgb(31, 31, 46).
    • Any page error fails the check.
  • CI:
    • The expo job exports all three platforms, then installs Chromium with the existing Playwright steps (record revisions, restore cache, install) and runs check:web.
    • The job's path filter also matches packages/react/src/utils/(theme-context|with-theme), which the native runtime now imports (feat(native): compile styled-components/native and @emotion/native #1050).
    • feat/react-native-compat is added to the pull_request branches of the workflow. It will be removed when this PR is retargeted.
  • README: a new "Expo web" section covers:
    • the same output through react-native-web;
    • _web blocks, and _hover/_focus following the mouse and the keyboard;
    • the dependencies to install;
    • that a site that is not an Expo app keeps using the Vite/Next/Webpack/Rsbuild/Bun plugins, which output atomic CSS.

bun.lock adds the three packages. Hoisting moved styleq 0.2.1 under @stylexjs/stylex, which keeps it, because react-native-web needs 0.1.x. Nothing else changes.

Verification

Locally:

  • bun run export writes iOS (951 modules), Android (949) and web (667) bundles;
  • node check-bundle.mjs passes for all three;
  • node check-web.mjs prints "web: react-native-web renders the compiled styles".

No library code changes in this PR.


#411의 일부이며 #1050에 의존합니다 (base: feat/react-native-compat). React Native 계획의 11번째 PR인 Expo web(D5)입니다.

변경 내용

D5 결정대로 Expo 앱의 웹 빌드는 iOS·Android와 같은 네이티브 출력을 씁니다. Metro가 platform: 'web'으로 컴파일하고, react-native-web이 StyleSheet 객체를 CSS로 바꿉니다. 컴파일러는 #1044부터 web 플랫폼(_web 블록 포함)을 받았으므로, 이 PR은 전체 경로가 끝까지 동작함을 검증하고 문서화합니다.

  • apps/expo:
    • Expo SDK 58이 요구하는 웹 의존성 react-native-web ~0.21.4와 @expo/metro-runtime ~58.0.17을 추가했습니다. react-dom은 워크스페이스의 React와 정확히 맞도록 ^19.3.1을 씁니다. SDK 58의 19.3.0을 쓰면 hoist된 react-dom이 다른 모든 앱 아래로 바뀌기 때문입니다.
    • app.json의 platforms에 "web"을, export에 --platform web을 추가했습니다.
    • 카드·입력란·두 버튼에 testID를 추가했습니다. react-native-web은 이를 data-testid로 렌더링합니다.
  • check-bundle.mjs: 이제 웹 번들도 iOS·Android와 같은 항목으로 검사합니다:
    • placeholder가 없고, 런타임 외의 Devup UI 모듈이 없음;
    • hoist된 스타일과 Pressable의 style 함수;
    • Reanimated, 그리고 App.tsx가 쓰는 런타임.
  • check-web.mjs(신규): dist/를 서빙해 Chromium(Playwright)으로 연 뒤, react-native-web이 렌더링한 결과를 확인합니다:
    • light 테마에서 카드가 rgb(255, 255, 255);
    • 카운트 버튼이 #5a44ff;
    • 런타임의 Focused를 통해, focus하면 입력란 테두리가 #5a44ff;
    • 누르면 카운트가 올라감;
    • "Switch to dark"를 누르면 카드가 rgb(31, 31, 46).
    • 페이지 에러가 있으면 실패합니다.
  • CI:
    • expo job은 세 플랫폼을 export한 뒤, 기존 Playwright 단계(revision 기록, cache 복원, 설치)로 Chromium을 설치하고 check:web을 실행합니다.
    • job의 경로 필터는 네이티브 런타임이 이제 import하는 packages/react/src/utils/(theme-context|with-theme)(feat(native): compile styled-components/native and @emotion/native #1050)도 포함합니다.
    • workflow의 pull_request branches에 feat/react-native-compat을 추가했습니다. 이 PR의 base를 바꿀 때 제거합니다.
  • README: 새 "Expo web" 섹션이 다루는 것:
    • react-native-web을 통한 같은 출력;
    • _web 블록, 마우스·키보드를 따르는 _hover/_focus;
    • 설치할 의존성;
    • Expo 앱이 아닌 사이트는 atomic CSS를 출력하는 Vite/Next/Webpack/Rsbuild/Bun 플러그인을 그대로 쓴다는 점.

bun.lock에는 세 패키지가 추가되었습니다. react-native-web이 0.1.x를 요구하므로, hoisting으로 styleq 0.2.1은 그것을 쓰는 @stylexjs/stylex 아래로 옮겨졌습니다. 그 밖의 변경은 없습니다.

검증

로컬에서:

  • bun run export가 iOS(951 modules)·Android(949)·web(667) 번들을 만듭니다;
  • node check-bundle.mjs가 세 번들 모두 통과합니다;
  • node check-web.mjs가 "web: react-native-web renders the compiled styles"를 출력합니다.

이 PR에는 라이브러리 코드 변경이 없습니다.

🤖 Generated with Claude Code

owjs3901 and others added 2 commits November 21, 2026 15:26
The Expo example exports for the web through react-native-web with the
same compiled output as iOS and Android. CI checks the web bundle as the
others and opens it in Chromium: the card's theme color and its switch,
the input's focus style and a button press.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@codecov

codecov Bot commented Nov 21, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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