Skip to content

Port app to Fabric #119

@chrisglein

Description

@chrisglein

Overview

Well before RNW's Fabric support moved into public preview (0.76, December 2025) or to the default option (0.80, pending), I decided to port this app from Paper to RNW's very-much-cutting-edge early Fabric implementation in 2023. This issue captures a lot of that journey.

Through the PR history you may see a lot of strata of the implementation, first from a hand-coded app, then in 0.73 replaced with the early app template, and eventually on the official preview in 0.76. It's been a journey! This app's journey is not what I'd expect is the case for an app starting today, when everything is implemented and fixed and streamlined. But this issue captures the journey of following that cutting edge.

Note that for RNW, migrating a Paper app into a Fabric isn't a simple switch. Fabric apps are an entirely different app type. Paper is UWP, Fabric is Win32+WinAppSDK. It is necessary to create a new app and then restore the native connections and dependencies.

  • JS-only functionality should work (largely) as before, including imported modules.
  • Native code should work mostly as before... except for needing to handle the UWP->Win32 app model move.
  • Modules hosting native UI are going to be more problematic at this point in time (where those modules haven't been updated to support Fabric)

Plan

  • Create a new blank Fabric app from template
  • Delete all contents in existing Paper app (backed up through source control, of course!)
  • Copy newly created Fabric app over gutted Paper app
  • Restore (from source control) all the relevant native code files and JS files that weren't part of the app generated originally from the Paper app template
  • Thoughtfully merge files from app template that had been intentionally modified (in this case, few)
  • Copy app .png assets to .ico files (change from UWP->Win32 app type)
  • Stubbed out all import dependencies in JS
  • Made a quick JS-only implementation of key components essential to the flow of the app (like Picker and Popup)
  • Bring in the JS-only dependencies (Markdown rendering, for example), as these should work regardless of Paper/Fabric
  • Restore in-app native code (VersionInfo wrapper, for example)
  • Restore imported native code module dependencies
    • Find non-UWP alternatives for other non-UI module dependencies (If needed?)
    • Modify min Fabric app sample to be packaged to get access to some of the UWP-style APIs? (e.g. Clipboard via DataTransfer) (note that this was eventually handled by the default app template)
    • Clipboard
      • Local workaround
      • Restore use of "@react-native-clipboard/clipboard"
    • AsyncStorage
      • Restore use of "@react-native-async-storage/async-storage"
    • react-native-winrt (for Speech Synthesis)
      • ⚠️Workaround (switched from codegenJS to turbo module)
  • UI module dependencies
    • Picker
      • ⚠️Workaround (recreated a Picker replacement using Modal)
      • Restore use of "@react-native-picker/picker"
    • fluent-ui-reactnative
      • ⚠️Workaround: Created FluentControls library in app with JS replacements
      • Figure out blocking issues with FURN
    • react-native-content-dialog (JS only)
      • ⚠️Workaround: Local package patch of PlatformColor usage, changing color string constants
      • Figure out how module can have different versions for Fabric vs. Paper
    • react-native-syntax-highlighter (JS only)
      • ⚠️Workaround: Removed
      • Figure out how to get working again
  • Review app's behavior with Accessibility Insights
  • Merge Fabric version to main
  • Release Fabric version of app to store

Issues Found Along the Way

Screenshot of In-Progress Implementation

artificialChatOnFabric

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions