Skip to content

Update CLI Prompt for Architecture Selections on Old Arch #15027

@anupriya13

Description

@anupriya13

Prompt for Old Architecture Template in React Native Windows v0.80

Objective

Display a clear prompt to developers when they create a new React Native Windows project using the react-native init-windows command with the Old Architecture template for version 0.80, encouraging them to switch to the New Architecture.


Trigger Condition

This message is shown when:

  • A developer creates a new project and runs the init-windows and run-windows command.
  • The selected or default template (${this.options.template}) targets the Old Architecture on v0.80.

Message to Display

⚠️ The '${this.options.template}' template is based on the React Native Old Architecture, which will eventually be deprecated in future releases.

💡 We recommend switching to the New Architecture to take advantage of improved performance, long-term support, and modern capabilities.

🔗 Learn more: https://microsoft.github.io/react-native-windows/docs/new-architecture

Would you like to continue using the Old Architecture? (Y/N)

Expected Behaviour

User Input Expected Result Message to be Shown
Y / y Continue initializing using the Old Architecture. Proceeding with Old Architecture. You can migrate later using our migration guide: https://microsoft.github.io/react-native-windows/docs/new-architecture
N / n Switch to using the New Architecture template instead. Great choice! Setting up the project with New Architecture support.
Invalid input Show an error and prompt again. Invalid input. Please enter 'Y' for Yes or 'N' for No. Max 3 tries else run old arch.
No input (optional timeout) Proceed with Old Architecture by default, after showing a reminder. (optional) No input received. Proceeding with Old Architecture by default. You can opt into the New Architecture later.

Goal

Encourage more developers to adopt the New Architecture, while still giving them the option to proceed with Old Architecture temporarily.
This helps improve React Native Windows project quality and futureproofing.

For Copilot Prompt

Update these 2 files:

  1. packages/@react-native-windows/cli/src/commands/initWindows/initWindows.ts
  2. packages/@react-native-windows/cli/src/commands/runWindows/runWindows.ts
    where there is a condition " if (config.project.windows?.rnwConfig?.projectArch === 'old') {" and add above items listed instead of
  newWarn(
       'This project is using the React Native (for Windows) Old Architecture, which will eventually be deprecated. See https://microsoft.github.io/react-native-windows/docs/new-architecture for details on switching to the New Architecture.',
     );

Related PR: #14757

Metadata

Metadata

Type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions