Skip to content

Add interactive prompt for Old Architecture template selection in CLI - #15028

Closed
anupriya13 with Copilot wants to merge 1 commit into
mainfrom
copilot/fix-15027
Closed

Add interactive prompt for Old Architecture template selection in CLI#15028
anupriya13 with Copilot wants to merge 1 commit into
mainfrom
copilot/fix-15027

Conversation

Copilot AI commented Aug 8, 2025

Copy link
Copy Markdown
Contributor

This PR implements an interactive prompt feature that encourages developers to switch from Old Architecture to New Architecture when initializing React Native Windows projects with v0.80.

Overview

When developers run npx @react-native-community/cli init-windows with an Old Architecture template (templates starting with 'old/'), they now see:

  1. Clear warning about Old Architecture deprecation
  2. Recommendation to switch to New Architecture with benefits
  3. Interactive prompt asking if they want to continue with Old Architecture
  4. Automatic template switching to New Architecture if they choose 'No'

User Experience

⚠️ The 'old/uwp-cpp-app' 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? › No

✅ Great choice! Setting up the project with New Architecture support.

Technical Implementation

  • Detection: Automatically identifies Old Architecture templates (those starting with 'old/')
  • Template Switching: Switches to 'cpp-app' (New Architecture) when user chooses 'N'
  • Error Handling: Comprehensive retry logic (max 3 attempts) and graceful fallback
  • User Input: Uses existing prompts library for consistent CLI interaction
  • Backward Compatibility: Preserves all existing behavior for non-Old Architecture templates

Response Handling

User Input Result Message
Y/y Continue with Old Architecture "Proceeding with Old Architecture. You can migrate later..."
N/n Switch to New Architecture "Great choice! Setting up the project with New Architecture support."
Invalid Retry prompt (max 3 times) "Invalid input. Please enter 'Y' for Yes or 'N' for No."
No input (Ctrl+C) Default to Old Architecture "No input received. Proceeding with Old Architecture by default..."

Benefits

  • Increased New Architecture Adoption: Proactive prompting encourages modern development practices
  • Better Developer Experience: Clear guidance with easy migration path
  • Future-Proofing: Prepares developers for eventual Old Architecture deprecation
  • Flexibility: Developers retain choice to use Old Architecture when needed

The implementation includes comprehensive test coverage and passes all quality checks (build, lint, format).

Fixes #15027.

Warning

Firewall rules blocked me from connecting to one or more addresses

I tried to connect to the following addresses, but was blocked by firewall rules:

  • googlechromelabs.github.io
    • Triggering command: /usr/local/bin/node install.mjs (dns block)
  • https://storage.googleapis.com/chrome-for-testing-public/130.0.6723.116/linux64/chrome-linux64.zip
    • Triggering command: /usr/local/bin/node install.mjs (http block)

If you need me to access, download, or install something from one of these locations, you can either:


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Microsoft Reviewers: Open in CodeFlow

@anupriya13 anupriya13 closed this Aug 8, 2025
Copilot AI changed the title [WIP] Update CLI Prompt for Architecture Selections on Old Arch Add interactive prompt for Old Architecture template selection in CLI Aug 8, 2025
Copilot AI requested a review from anupriya13 August 8, 2025 04:32
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.

Update CLI Prompt for Architecture Selections on Old Arch

2 participants