Skip to content

Commit bbd2c20

Browse files
HariniMalothu17Harini Malothu
andauthored
Update warning deprecating paper for 0.82 release version (#15610)
* Update warning deprecating paper * Change files --------- Co-authored-by: Harini Malothu <hmalothu@microsoft.com>
1 parent d33fd3a commit bbd2c20

3 files changed

Lines changed: 17 additions & 7 deletions

File tree

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "none",
3+
"comment": "Update warning deprecating paper",
4+
"packageName": "@react-native-windows/cli",
5+
"email": "hmalothu@microsoft.com",
6+
"dependentChangeType": "none"
7+
}

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,15 @@ export class InitWindows {
161161

162162
spinner.info(`Using template '${this.options.template}'...`);
163163
if (!this.templates.has(this.options.template.replace(/[\\]/g, '/'))) {
164+
// Check if user is trying to use an old architecture template
165+
const isOldArchTemplate = this.options.template.startsWith('old');
166+
if (isOldArchTemplate) {
167+
showOldArchitectureWarning();
168+
throw new CodedError(
169+
'InvalidTemplateName',
170+
`The template '${this.options.template}' is no longer available. Please use 'cpp-app' template instead.`,
171+
);
172+
}
164173
throw new CodedError(
165174
'InvalidTemplateName',
166175
`Unable to find template '${this.options.template}'.`,

packages/@react-native-windows/cli/src/utils/oldArchWarning.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,7 @@ import chalk from 'chalk';
1212
export function showOldArchitectureWarning(): void {
1313
console.log(
1414
chalk.yellow(
15-
`⚠️ This project is using the React Native (for Windows) Old Architecture. The old architecture will begin to be removed starting with react-native-windows@0.82.0.`,
16-
),
17-
);
18-
console.log();
19-
console.log(
20-
chalk.cyan(
21-
'💡 It is strongly recommended to move to the new architecture as soon as possible to take advantage of improved performance, long-term support, and modern capabilities.',
15+
`⚠️ The old architecture (Paper) is not supported in RNW version v0.82. Please enable your projects using new architecture (Fabric).`,
2216
),
2317
);
2418
console.log();

0 commit comments

Comments
 (0)