Skip to content

Commit fcc3b7f

Browse files
JasonVMoCopilot
andauthored
Add macOS Paper Storybook mode and PR coverage (#4355)
* initial package framing for native-core * move callout and focus-zone into native-core package * move existing implementations to legacy submodule * Fix native-core macOS interoperability and validate migration Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * fix tsconfig configuration * add the ability to run the macos storybook app in paper mode and add a pipeline run for it * Constrain LayoutStableText labels to their reserved width Fix the macOS Paper CI geometry failure without relaxing its native alignment assertions. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Measure the native reserved Text instead of its wrapper View Compare Text line boxes with the same Paper pixel-rounding policy, preserve the native assertions, and remove the ineffective max-width production change. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Deduplicate compatible Storybook runtime dependencies Align locked React, theming, and UI-common packages after the main-branch UI upgrades while preserving strict Metro duplicate checks and existing dependency ranges. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Fix moved rnx-kit dependency-management documentation links Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 27dc8eb commit fcc3b7f

23 files changed

Lines changed: 403 additions & 57 deletions

File tree

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
'@fluentui-react-native/storybook-desktop': minor
3+
'@fluentui-react-native/components': patch
4+
---
5+
6+
Add a macOS-only `--paper` option to prepare, build, launch, and smoke test Storybook with Paper while preserving Fabric as the default renderer.
7+
8+
Use centered alignment in macOS Paper CompoundItemLayout stories to avoid the native Yoga baseline crash without changing the primitive or Fabric demonstrations.
9+
10+
Measure LayoutStableText's hidden reserve Text directly in native alignment stories, avoiding Paper Text-versus-View pixel-rounding mismatches without relaxing the geometry assertions.
11+
12+
Deduplicate compatible Storybook React, theming, and shared UI dependencies in the lockfile after desktop UI updates, keeping strict Metro duplicate checks enabled.

‎.github/workflows/pr.yml‎

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,57 @@ jobs:
244244
apps/storybook/artifacts/storybook-commands
245245
${{ steps.desktop-driver.outputs.doctor-path }}
246246
247+
macos-paper-storybook:
248+
name: macOS Paper Storybook PR
249+
runs-on: macos-26
250+
timeout-minutes: 40
251+
steps:
252+
- name: Checkout
253+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
254+
255+
- name: Set up toolchain
256+
uses: microsoft/react-native-test-app/.github/actions/setup-toolchain@c75754b0fedce160a4dcf7193fae1a6ece76efe2 # 5.4.11
257+
with:
258+
platform: macos
259+
node-version: 22
260+
261+
- name: Install dependencies
262+
run: yarn
263+
264+
- name: Build packages
265+
run: yarn build
266+
267+
- name: Set up macOS Desktop Driver
268+
id: desktop-driver
269+
uses: ./.github/actions/setup-desktop-driver
270+
with:
271+
platform: macos
272+
disabled-input-features: physicalClick
273+
274+
- name: Bundle macOS Paper
275+
run: yarn storybook bundle --macos --paper
276+
working-directory: apps/storybook
277+
278+
- name: Pod install (Paper)
279+
run: yarn storybook prep --macos --paper
280+
working-directory: apps/storybook
281+
282+
- name: Run through Paper storybook smoke tests
283+
run: yarn storybook smoke --macos --paper --mode stories-and-tests
284+
working-directory: apps/storybook
285+
env:
286+
CCACHE_DISABLE: 1
287+
288+
- name: Upload macOS Paper Storybook artifacts
289+
if: ${{ always() }}
290+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
291+
with:
292+
name: Storybook_macos_Paper_Dump
293+
path: |
294+
apps/storybook/artifacts/macos
295+
apps/storybook/artifacts/storybook-commands
296+
${{ steps.desktop-driver.outputs.doctor-path }}
297+
247298
ios:
248299
name: iOS PR
249300
runs-on: macos-26

‎apps/fluent-tester/docs/android.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ yarn rnx-align-deps --set-version
4444
This command will ensure that all relevant packages are bumped correctly.
4545

4646
You can read more about this tool here:
47-
[`@rnx-kit/align-deps` design document](https://github.com/microsoft/rnx-kit/blob/main/docsite/docs/architecture/dependency-management.md)
47+
[`@rnx-kit/align-deps` design document](https://github.com/microsoft/rnx-kit/blob/main/docsite/src/content/docs/docs/architecture/dependency-management.md)
4848

4949
## Debugging
5050

‎apps/fluent-tester/docs/ios.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ yarn rnx-align-deps --set-version
4242
This command will ensure that all relevant packages are bumped correctly.
4343

4444
You can read more about this tool here:
45-
[`@rnx-kit/align-deps` design document](https://github.com/microsoft/rnx-kit/blob/main/docsite/docs/architecture/dependency-management.md)
45+
[`@rnx-kit/align-deps` design document](https://github.com/microsoft/rnx-kit/blob/main/docsite/src/content/docs/docs/architecture/dependency-management.md)
4646

4747
## Debugging
4848

‎apps/fluent-tester/docs/macos.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ yarn rnx-align-deps --set-version
5151
This command will ensure that all relevant packages are bumped correctly.
5252

5353
You can read more about this tool here:
54-
[`@rnx-kit/align-deps` design document](https://github.com/microsoft/rnx-kit/blob/main/docsite/docs/architecture/dependency-management.md)
54+
[`@rnx-kit/align-deps` design document](https://github.com/microsoft/rnx-kit/blob/main/docsite/src/content/docs/docs/architecture/dependency-management.md)
5555

5656
## Troubleshooting
5757

‎apps/fluent-tester/docs/windows.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ yarn rnx-align-deps --set-version
4141
This command will ensure that all relevant packages are bumped correctly.
4242

4343
You can read more about this tool here:
44-
[`@rnx-kit/align-deps` design document](https://github.com/microsoft/rnx-kit/blob/main/docsite/docs/architecture/dependency-management.md)
44+
[`@rnx-kit/align-deps` design document](https://github.com/microsoft/rnx-kit/blob/main/docsite/src/content/docs/docs/architecture/dependency-management.md)
4545

4646
## Troubleshooting
4747

‎apps/storybook/AGENTS.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,8 @@ Read [`agent-map.yaml`](agent-map.yaml) first for the compact architecture, look
8282
repository root because subprocess dependency resolution must start in this workspace.
8383
- Run `yarn storybook bundle --macos` for the JavaScript bundle, `yarn storybook build --macos` for a non-launching
8484
native build, and `yarn storybook smoke --macos` for the complete owned lifecycle.
85+
- macOS defaults to Fabric. Add `--paper` to `prep`, `build`, `run`, or `smoke` for Paper; regenerate with `prep`
86+
whenever switching renderers because both modes share the generated project and Pods. Keep the endpoint `macos`.
8587
- Preserve the shared smoke instance context: its canonical-root hash coordinates the macOS bundle identifier,
8688
Storybook port, Metro port, generated runtime polyfill, and exact app shutdown. Do not replace those values with
8789
process-name matching or fixed smoke ports.

‎apps/storybook/README.md‎

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,29 @@ yarn storybook run --macos
9595

9696
Requires Xcode + CocoaPods.
9797

98+
Fabric is the default macOS renderer. Add `--paper` to use Paper with the same
99+
macOS story catalog and native Desktop Driver:
100+
101+
```sh
102+
yarn storybook prep --macos --paper
103+
yarn storybook build --macos --paper
104+
yarn storybook smoke --macos --paper --mode stories-and-tests
105+
```
106+
107+
For interactive development, use `yarn storybook driver --macos --paper` and
108+
`yarn storybook run --macos --paper` in separate terminals. `--paper` is supported
109+
only on macOS; it sets `RCT_NEW_ARCH_ENABLED=0` for child commands. Omitting it
110+
selects Fabric explicitly, even if the parent environment disables the New Architecture.
111+
Run `prep` again whenever switching renderers: the generated Xcode project and
112+
Pods are shared, so Paper and Fabric cannot run concurrently from one enlistment.
113+
To return to Fabric, run `yarn storybook prep --macos` before building or launching.
114+
The **macOS Paper Storybook PR** job runs the full catalog traversal and authored
115+
tests separately from the existing Fabric job.
116+
CompoundItemLayout's demos use centered alignment in macOS Paper because the
117+
current native text-baseline callback can return NaN and terminate Yoga
118+
([upstream issue](https://github.com/microsoft/react-native-macos/issues/3121)).
119+
Fabric and other platforms retain the baseline demonstration. The primitive itself is unchanged.
120+
98121
Run `yarn storybook smoke --macos` for the complete server, Metro, build/launch, all-story traversal, and
99122
ownership-safe shutdown lifecycle. The shared CLI hashes this enlistment's canonical project root,
100123
uses that suffix in the native bundle identifier, and selects dedicated Storybook and Metro ports.
@@ -165,6 +188,11 @@ them. Win32 continues to exercise Callout through its Paper endpoint.
165188
Storybook's development bundle intentionally contains separate `pretty-format` and `react-is`
166189
versions used by its internal tooling. They are excluded from the duplicate-module enforcement;
167190
React, React Native, and application dependencies remain checked.
191+
After upgrading Storybook UI or addon packages, run
192+
`yarn dedupe '@storybook/*' storybook --strategy highest` from the repository
193+
root to align compatible locked React, theming, and shared UI dependencies.
194+
Keep these runtime packages covered by Metro's duplicate checks rather than
195+
adding exclusions for mismatched versions.
168196

169197
## Running on Win32
170198

‎apps/storybook/agent-map.yaml‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,11 @@ native:
6565
disabled_input_env: FURN_DESKTOP_DRIVER_DISABLED_INPUT_FEATURES
6666
ci_policy: explicit-build-then-prebuilt-only
6767
macos:
68+
renderer:
69+
default: fabric
70+
paper_flag: --paper
71+
switching: rerun-prep-before-build-or-launch
72+
concurrency: one-renderer-per-enlistment
6873
process: ReactTestApp
6974
app_bundle: macos/DerivedData/Build/Products/Debug/ReactTestApp.app
7075
coordinate_notes:

‎apps/storybook/macos/Podfile‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ end
3232
# react-native-test-app runs codegen before autolinking, so seed its clean-install input first.
3333
write_storybook_autolinking_config!(File.expand_path('..', __dir__))
3434

35-
use_test_app!(:fabric_enabled => true, :bridgeless_enabled => false) do |target|
35+
use_test_app!(:fabric_enabled => ENV.fetch('RCT_NEW_ARCH_ENABLED', '1') != '0', :bridgeless_enabled => false) do |target|
3636
target.app do
3737
platform :osx, '14'
3838
end

0 commit comments

Comments
 (0)