Skip to content

Commit 50e37f0

Browse files
authored
Upgrade to RNW 0.73 (#273)
This PR updates RNX's dev dependency to RN(W) 0.73, updates the example apps, and adds the configuration to the PR/CI test matrix.
1 parent 398ff39 commit 50e37f0

24 files changed

+1943
-1662
lines changed

.github/workflows/main.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,11 @@ jobs:
3030
strategy:
3131
fail-fast: false
3232
matrix:
33-
rnwVersion: [ '0.72-stable', '0.71-stable'] # test *all* versions that use VS 2022. aka any RNW version >= min in package.json and >= 0.71
33+
rnwVersion: [ 'latest', '0.72-stable', '0.71-stable'] # test *all* versions that use VS 2022. aka any RNW version >= min in package.json and >= 0.71
3434
useRnwNuGet: [false, true] # test building with both RNW source and RNW NuGet
3535
include:
36+
- rnwVersion: 'latest'
37+
rnTemplate: 'react-native@latest'
3638
- rnwVersion: '0.72-stable'
3739
rnTemplate: 'react-native@0.72-stable'
3840
- rnwVersion: '0.71-stable'

.github/workflows/pr.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,11 @@ jobs:
4242
strategy:
4343
fail-fast: true
4444
matrix:
45-
rnwVersion: ['0.72-stable', '0.71-stable'] # test *key* versions that use VS 2022. aka any RNW version >= 0.71 used by supported partners and/or Active/Maintenance from https://microsoft.github.io/react-native-windows/support
45+
rnwVersion: ['latest', '0.72-stable', '0.71-stable'] # test *key* versions that use VS 2022. aka any RNW version >= 0.71 used by supported partners and/or Active/Maintenance from https://microsoft.github.io/react-native-windows/support
4646
useRnwNuGet: [false, true] # test building with both RNW source and RNW NuGet
4747
include:
48+
- rnwVersion: 'latest'
49+
rnTemplate: 'react-native@latest'
4850
- rnwVersion: '0.72-stable'
4951
rnTemplate: 'react-native@0.72-stable'
5052
- rnwVersion: '0.71-stable'

.github/workflows/template-runcodegen.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
- uses: nuget/setup-nuget@v1
2727

2828
- name: NuGet restore
29-
run: nuget restore example\windows\example.sln
29+
run: nuget restore package\windows\ReactNativeXaml.sln
3030

3131
- name: run CodeGen
3232
run: yarn codegen
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "patch",
3+
"comment": "Upgrade to RNW 0.73",
4+
"packageName": "react-native-xaml",
5+
"email": "jthysell@microsoft.com",
6+
"dependentChangeType": "patch"
7+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ import 'react-native';
66
import React from 'react';
77
import App from '../App';
88

9+
// Note: import explicitly to use the types shipped with jest.
10+
import {it} from '@jest/globals';
11+
912
// Note: test renderer must be required after react-native.
1013
import renderer from 'react-test-renderer';
1114

example/babel.config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module.exports = {
2-
presets: ['module:metro-react-native-babel-preset'],
3-
};
2+
presets: ['module:@react-native/babel-preset'],
3+
};

example/metro.config.js

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
1-
/**
2-
* Metro configuration for React Native
3-
* https://github.com/facebook/react-native
4-
*
5-
* @format
6-
*/
1+
const {getDefaultConfig, mergeConfig} = require('@react-native/metro-config');
2+
73
const fs = require('fs');
84
const path = require('path');
95
const exclusionList = require('metro-config/src/defaults/exclusionList');
@@ -12,13 +8,14 @@ const rnwPath = fs.realpathSync(
128
path.resolve(require.resolve('react-native-windows/package.json'), '..'),
139
);
1410

15-
module.exports = {
16-
watchFolders: [
17-
// Include hoisted modules
18-
path.resolve(__dirname, '..', 'node_modules'),
19-
// Include main react-native-xaml package root
20-
path.resolve(__dirname, '..', 'package'),
21-
],
11+
/**
12+
* Metro configuration
13+
* https://facebook.github.io/metro/docs/configuration
14+
*
15+
* @type {import('metro-config').MetroConfig}
16+
*/
17+
18+
const config = {
2219
resolver: {
2320
blockList: exclusionList([
2421
// This stops "react-native run-windows" from causing the metro server to crash if its already running
@@ -47,3 +44,5 @@ module.exports = {
4744
assetRegistryPath: 'react-native/Libraries/Image/AssetRegistry',
4845
},
4946
};
47+
48+
module.exports = mergeConfig(getDefaultConfig(__dirname), config);

example/package.json

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,37 +3,36 @@
33
"version": "0.0.1",
44
"private": true,
55
"scripts": {
6+
"lint": "eslint .",
67
"start": "react-native start",
78
"test": "jest",
8-
"lint": "eslint .",
99
"windows": "react-native run-windows"
1010
},
1111
"dependencies": {
1212
"react": "18.2.0",
13-
"react-native": "0.72.3",
14-
"react-native-windows": "0.72.2",
13+
"react-native": "0.73.0",
14+
"react-native-windows": "0.73.4",
1515
"react-native-xaml": "*"
1616
},
1717
"devDependencies": {
1818
"@babel/core": "^7.20.0",
1919
"@babel/preset-env": "^7.20.0",
2020
"@babel/runtime": "^7.20.0",
21-
"@react-native/eslint-config": "^0.72.2",
22-
"@react-native/metro-config": "^0.72.6",
23-
"@tsconfig/react-native": "^3.0.0",
24-
"@types/metro-config": "^0.76.3",
25-
"@types/react": "^18.0.24",
21+
"@react-native/babel-preset": "^0.73.18",
22+
"@react-native/eslint-config": "^0.73.1",
23+
"@react-native/metro-config": "^0.73.2",
24+
"@react-native/typescript-config": "^0.73.1",
25+
"@types/react": "^18.2.6",
2626
"@types/react-test-renderer": "^18.0.0",
27-
"babel-jest": "^29.2.1",
27+
"babel-jest": "^29.6.3",
2828
"eslint": "^8.19.0",
29-
"jest": "^29.2.1",
30-
"metro-react-native-babel-preset": "0.76.5",
31-
"prettier": "^2.4.1",
29+
"jest": "^29.6.3",
30+
"prettier": "2.8.8",
3231
"react-test-renderer": "18.2.0",
33-
"typescript": "4.8.4",
34-
"metro-config": "^0.76.5"
32+
"typescript": "5.0.4",
33+
"metro-config": "^0.80.2"
3534
},
3635
"engines": {
37-
"node": ">=16"
36+
"node": ">=18"
3837
}
39-
}
38+
}

example/tsconfig.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"extends": "@react-native/typescript-config/tsconfig.json"
3+
}

example/windows/ExperimentalFeatures.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
1515
See https://microsoft.github.io/react-native-windows/docs/hermes
1616
-->
17-
<UseHermes>false</UseHermes>
17+
<UseHermes>true</UseHermes>
1818

1919
<!--
2020
Changes compilation to assume use of WinUI 3 instead of System XAML.

0 commit comments

Comments
 (0)