Skip to content

Commit 1d04e27

Browse files
authored
Change init-windows default new app template to New Architecture (#14750)
## Description This PR changes the default template for `init-windows` to the New Architecture `cpp-app` template. ### Type of Change - This change requires a documentation update ### Why Starting in RNW 0.80.0, the New Architecture will be the default for new apps. Resolves #13935 Resolves #14749 ### What Switched the default from `old\uwp-cpp-app` to `cpp-app` and updated the descriptions of both. ## Screenshots N/A ## Testing Verified the default changes when listing the available templates. ## Changelog Should this change be included in the release notes: _yes_ Change `init-windows` default new app template to New Architecture
1 parent 241ba7a commit 1d04e27

File tree

6 files changed

+19
-4
lines changed

6 files changed

+19
-4
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "prerelease",
3+
"comment": "Change `init-windows` default new app template to New Architecture",
4+
"packageName": "@react-native-windows/cli",
5+
"email": "[email protected]",
6+
"dependentChangeType": "patch"
7+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "prerelease",
3+
"comment": "Change `init-windows` default new app template to New Architecture",
4+
"packageName": "react-native-windows",
5+
"email": "[email protected]",
6+
"dependentChangeType": "patch"
7+
}

packages/@react-native-windows/cli/src/commands/initWindows/initWindowsOptions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export const initOptions: CommandOption[] = [
2424
{
2525
name: '--template [string]',
2626
description: 'Specify the template to use',
27-
default: undefined,
27+
default: 'cpp-app',
2828
},
2929
{
3030
name: '--name [string]',

vnext/templates/cpp-app/template.config.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,9 @@ async function postInstall(config = {}, options = {}) {
144144
module.exports = {
145145
name: 'React Native Windows Application (New Arch, WinAppSDK, C++)',
146146
description:
147-
"[Preview] A RNW app using RN's New Architecture, built in C++ and targeting WinAppSDK.",
147+
"A RNW app using RN's New Architecture, built in C++ and targeting WinAppSDK.",
148148
preInstall,
149149
getFileMappings,
150150
postInstall,
151+
isDefault: true,
151152
};

vnext/templates/old/generateWrapper.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ function makeGenerateWindowsWrapper(language = 'cpp', isDefault = false) {
1313
const name = `React Native Windows Application (Old Arch, UWP, ${
1414
language === 'cs' ? 'C#' : 'C++'
1515
})`;
16-
const description = `A RNW app using RN's Old Architecture, built in ${
16+
const description = `[Legacy] A RNW app using RN's Old Architecture, built in ${
1717
language === 'cs' ? 'C#' : 'C++'
1818
} and targeting UWP.`;
1919

vnext/templates/old/uwp-cpp-app/template.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@
1212

1313
const {makeGenerateWindowsWrapper} = require('../generateWrapper');
1414

15-
module.exports = makeGenerateWindowsWrapper('cpp', true); // TODO: Remove this as the default
15+
module.exports = makeGenerateWindowsWrapper('cpp');

0 commit comments

Comments
 (0)