-
Notifications
You must be signed in to change notification settings - Fork 314
[Do not merge till RNW 0.82 is released] Picker - Upgrade Windows to New Arch using XAML Islands #664
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
[Do not merge till RNW 0.82 is released] Picker - Upgrade Windows to New Arch using XAML Islands #664
Changes from 16 commits
7b8a4bc
9904b13
435e2a5
3e052bf
94499df
5bc3404
cbe6f64
ea185f4
352b164
e3b0dd2
5d2523b
47d7fb6
730b077
243c3a6
85f8823
f83c759
3ed7945
ab0884c
0beacfe
73e3afe
667750d
90209bd
c570b47
8c3d3e8
df3f40a
327e812
156eef0
bbccf46
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| <?xml version="1.0" encoding="utf-8"?> | ||
| <configuration> | ||
| <!-- This placeholder file is reserved for future use, but also to prevent | ||
| using the config from the cpp-app template, allowing the lib to rely on | ||
| config file added to its root. --> | ||
| </configuration> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,9 +1,10 @@ | ||
| /** | ||
| * @format | ||
| */ | ||
|
|
||
| import {AppRegistry} from 'react-native'; | ||
| import App from './src/App'; | ||
| import {name as appName} from './app.json'; | ||
|
|
||
| AppRegistry.registerComponent(appName, () => App); | ||
| /** | ||
|
Check failure on line 1 in example/index.js
|
||
| * @format | ||
|
Check failure on line 2 in example/index.js
|
||
| */ | ||
|
Check failure on line 3 in example/index.js
|
||
|
|
||
|
Check failure on line 4 in example/index.js
|
||
| import {AppRegistry} from 'react-native'; | ||
|
Check failure on line 5 in example/index.js
|
||
| import App from './src/App'; | ||
|
Check failure on line 6 in example/index.js
|
||
| import {name as appName} from './app.json'; | ||
|
Check failure on line 7 in example/index.js
|
||
|
|
||
|
Check failure on line 8 in example/index.js
|
||
| console.log('AppRegistry running the app:', appName); | ||
|
Check failure on line 9 in example/index.js
|
||
| AppRegistry.registerComponent(appName, () => App); | ||
|
Check failure on line 10 in example/index.js
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| const config = {}; | ||
|
|
||
| module.exports = require('@rnx-kit/jest-preset')('windows', config); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,11 +1,40 @@ | ||
| const {makeMetroConfig} = require('@rnx-kit/metro-config'); | ||
| module.exports = makeMetroConfig({ | ||
| transformer: { | ||
| getTransformOptions: async () => ({ | ||
| transform: { | ||
| experimentalImportSupport: false, | ||
| inlineRequires: false, | ||
| }, | ||
| }), | ||
| }, | ||
| }); | ||
| const {getDefaultConfig, mergeConfig} = require('@react-native/metro-config'); | ||
| const path = require('path'); | ||
|
|
||
| const root = path.resolve(__dirname, '..'); | ||
|
|
||
| const defaultConfig = getDefaultConfig(__dirname); | ||
|
|
||
| /** | ||
| * Metro configuration | ||
| * https://reactnative.dev/docs/metro | ||
| * | ||
| * @type {import('metro-config').MetroConfig} | ||
| */ | ||
| const config = { | ||
| watchFolders: [root], | ||
| resolver: { | ||
| // Make sure Metro can resolve the picker package from the parent folder | ||
| extraNodeModules: { | ||
| '@react-native-picker/picker': root, | ||
| }, | ||
| // Block duplicate react-native packages | ||
| blockList: [ | ||
| new RegExp(`${root.replace(/[/\\]/g, '[/\\\\]')}/node_modules/react-native/.*`), | ||
| ], | ||
| nodeModulesPaths: [ | ||
| path.resolve(__dirname, 'node_modules'), | ||
| path.resolve(root, 'node_modules'), | ||
| ], | ||
| }, | ||
| transformer: { | ||
| getTransformOptions: async () => ({ | ||
| transform: { | ||
| experimentalImportSupport: false, | ||
| inlineRequires: true, | ||
| }, | ||
| }), | ||
| }, | ||
| }; | ||
|
|
||
| module.exports = mergeConfig(defaultConfig, config); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,23 +1,47 @@ | ||
| const project = (() => { | ||
| try { | ||
| const {configureProjects} = require('react-native-test-app'); | ||
| return configureProjects({ | ||
| android: { | ||
| sourceDir: 'android', | ||
| }, | ||
| ios: { | ||
| sourceDir: 'ios', | ||
| }, | ||
| windows: { | ||
| sourceDir: 'windows', | ||
| solutionFile: 'windows/Example.sln', | ||
| }, | ||
| }); | ||
| } catch (_) { | ||
| return undefined; | ||
| } | ||
| })(); | ||
|
|
||
| module.exports = { | ||
| ...(project ? {project} : undefined), | ||
| }; | ||
| const path = require('path'); | ||
|
|
||
| const project = (() => { | ||
| try { | ||
| const {configureProjects} = require('react-native-test-app'); | ||
| return configureProjects({ | ||
| android: { | ||
| sourceDir: 'android', | ||
| }, | ||
| ios: { | ||
| sourceDir: 'ios', | ||
| }, | ||
| windows: { | ||
| sourceDir: 'windows', | ||
| solutionFile: 'PickerExample.sln', | ||
| }, | ||
| }); | ||
| } catch (_) { | ||
| return undefined; | ||
| } | ||
| })(); | ||
|
|
||
| module.exports = { | ||
| ...(project ? {project} : undefined), | ||
| dependencies: { | ||
| '@react-native-picker/picker': { | ||
| root: path.resolve(__dirname, '..'), | ||
| platforms: { | ||
| windows: { | ||
| sourceDir: 'windows', | ||
| solutionFile: 'Picker.sln', | ||
| projects: [ | ||
| { | ||
| projectFile: 'Picker\\Picker.vcxproj', | ||
| projectName: 'Picker', | ||
| projectLang: 'cpp', | ||
| projectGuid: '{170F439F-1AC2-40F6-94D2-FB6511EDF052}', | ||
| directDependency: true, | ||
| cppHeaders: ['winrt/Picker.h'], | ||
| cppPackageProviders: ['Picker::ReactPackageProvider'], | ||
| }, | ||
| ], | ||
| }, | ||
| }, | ||
| }, | ||
| }, | ||
| }; |
Uh oh!
There was an error while loading. Please reload this page.