-
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
Open
anupriya13
wants to merge
28
commits into
react-native-picker:master
Choose a base branch
from
anupriya13:user/anuverma/xamlRNW
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
[Do not merge till RNW 0.82 is released] Picker - Upgrade Windows to New Arch using XAML Islands #664
Changes from 22 commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
7b8a4bc
init windows new arch
anupriya13 9904b13
upgrade rnw
anupriya13 435e2a5
tes template code
anupriya13 3e052bf
fix spec file - start with dummy multiply
anupriya13 94499df
windows - start with dummy multiply
anupriya13 5bc3404
fix some errors
anupriya13 cbe6f64
fix some errors
anupriya13 ea185f4
upgrade version rnw
anupriya13 352b164
add more apis
anupriya13 e3b0dd2
add more apis for open close
anupriya13 5d2523b
Picker working basic
anupriya13 47d7fb6
improve ui
anupriya13 730b077
improve ui
anupriya13 243c3a6
add error handling
anupriya13 85f8823
remove openpicker and closepicker apis
anupriya13 f83c759
update versions
anupriya13 3ed7945
resolve comments
anupriya13 ab0884c
fix editable
anupriya13 0beacfe
resolve comments
anupriya13 73e3afe
resolve comments
anupriya13 667750d
fix editable
anupriya13 90209bd
resolve comments
anupriya13 c570b47
Update windows/Picker/RNCPickerComponentView.cpp
anupriya13 8c3d3e8
Update windows/Picker/RNCPickerComponentView.cpp
anupriya13 df3f40a
resolve comment
anupriya13 327e812
resolve comment
anupriya13 156eef0
fix ios and android issues for build
anupriya13 bbccf46
Update RNW packages to 0.82
vineethkuttan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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'], | ||
| }, | ||
| ], | ||
| }, | ||
| }, | ||
| }, | ||
| }, | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,93 +1,94 @@ | ||
| import * as React from 'react'; | ||
| import { | ||
| Platform, | ||
| ScrollView, | ||
| StyleSheet, | ||
| Text, | ||
| View, | ||
| SafeAreaView, | ||
| I18nManager, | ||
| Switch, | ||
| } from 'react-native'; | ||
|
|
||
| import * as PickerExamples from './PickerExample'; | ||
| import * as PickerIOSExamples from './PickerIOSExample'; | ||
| import * as PickerWindowsExamples from './PickerWindowsExamples'; | ||
|
|
||
| export default function App() { | ||
| const [isRTL, setIsRTL] = React.useState(I18nManager.isRTL); | ||
| React.useEffect(() => { | ||
| I18nManager.allowRTL(true); | ||
| }, []); | ||
| return ( | ||
| <SafeAreaView style={styles.main}> | ||
| <ScrollView> | ||
| <View style={styles.rtlSwitchContainer}> | ||
| <Switch | ||
| value={isRTL} | ||
| onValueChange={(newValue) => { | ||
| setIsRTL(newValue); | ||
| I18nManager.forceRTL(newValue); | ||
| }} | ||
| /> | ||
| <Text>{I18nManager.isRTL ? 'RTL' : 'LTR'}</Text> | ||
| </View> | ||
| <View style={styles.container}> | ||
| <Text style={styles.heading}>Picker Examples</Text> | ||
| {PickerExamples.examples.map((element) => ( | ||
| <View style={styles.elementContainer} key={element.title}> | ||
| <Text style={styles.title}> {element.title} </Text> | ||
| {element.render()} | ||
| </View> | ||
| ))} | ||
| {Platform.OS === 'ios' && ( | ||
| <Text style={styles.heading}>PickerIOS Examples</Text> | ||
| )} | ||
| {Platform.OS === 'ios' && | ||
| PickerIOSExamples.examples.map((element) => ( | ||
| <View style={styles.elementContainer} key={element.title}> | ||
| <Text style={styles.title}> {element.title} </Text> | ||
| {element.render()} | ||
| </View> | ||
| ))} | ||
| {Platform.OS === 'windows' && ( | ||
| <Text style={styles.heading}>PickerWindows Examples</Text> | ||
| )} | ||
| {Platform.OS === 'windows' && | ||
| PickerWindowsExamples.examples.map((element) => ( | ||
| <View style={styles.elementContainer} key={element.title}> | ||
| <Text style={styles.title}> {element.title} </Text> | ||
| {element.render()} | ||
| </View> | ||
| ))} | ||
| </View> | ||
| </ScrollView> | ||
| </SafeAreaView> | ||
| ); | ||
| } | ||
|
|
||
| const styles = StyleSheet.create({ | ||
| main: { | ||
| backgroundColor: '#F5FCFF', | ||
| }, | ||
| container: { | ||
| padding: 24, | ||
| paddingBottom: 60, | ||
| }, | ||
| title: { | ||
| fontSize: 18, | ||
| }, | ||
| elementContainer: { | ||
| marginTop: 8, | ||
| }, | ||
| heading: { | ||
| fontSize: 22, | ||
| color: 'black', | ||
| }, | ||
| rtlSwitchContainer: { | ||
| flexDirection: 'row', | ||
| justifyContent: 'space-between', | ||
| paddingHorizontal: 40, | ||
| paddingTop: 20, | ||
| }, | ||
| }); | ||
| import * as React from 'react'; | ||
| import { | ||
| Platform, | ||
| ScrollView, | ||
| StyleSheet, | ||
| Text, | ||
| View, | ||
| SafeAreaView, | ||
| I18nManager, | ||
| Switch, | ||
| } from 'react-native'; | ||
|
|
||
| import * as PickerExamples from './PickerExample'; | ||
| import * as PickerIOSExamples from './PickerIOSExample'; | ||
| import * as PickerWindowsExamples from './PickerWindowsExample'; | ||
|
|
||
| export default function App() { | ||
| const [isRTL, setIsRTL] = React.useState(I18nManager.isRTL); | ||
| React.useEffect(() => { | ||
| I18nManager.allowRTL(true); | ||
| }, []); | ||
| return ( | ||
| <SafeAreaView style={styles.main}> | ||
| <ScrollView> | ||
| <View style={styles.rtlSwitchContainer}> | ||
| <Switch | ||
| value={isRTL} | ||
| onValueChange={(newValue) => { | ||
| setIsRTL(newValue); | ||
| I18nManager.forceRTL(newValue); | ||
| }} | ||
| /> | ||
| <Text>{I18nManager.isRTL ? 'RTL' : 'LTR'}</Text> | ||
| </View> | ||
| <View style={styles.container}> | ||
| {Platform.OS === 'android' && (<Text style={styles.heading}>Picker Examples</Text>)} | ||
| {Platform.OS === 'android' && | ||
| PickerExamples.examples.map((element) => ( | ||
| <View style={styles.elementContainer} key={element.title}> | ||
| <Text style={styles.title}> {element.title} </Text> | ||
| {element.render()} | ||
| </View> | ||
| ))} | ||
| {Platform.OS === 'ios' && ( | ||
| <Text style={styles.heading}>PickerIOS Examples</Text> | ||
| )} | ||
| {Platform.OS === 'ios' && | ||
| PickerIOSExamples.examples.map((element) => ( | ||
| <View style={styles.elementContainer} key={element.title}> | ||
| <Text style={styles.title}> {element.title} </Text> | ||
| {element.render()} | ||
| </View> | ||
| ))} | ||
| {Platform.OS === 'windows' && ( | ||
| <Text style={styles.heading}>PickerWindows Examples</Text> | ||
| )} | ||
| {Platform.OS === 'windows' && | ||
| PickerWindowsExamples.examples.map((element) => ( | ||
| <View style={styles.elementContainer} key={element.title}> | ||
| <Text style={styles.title}> {element.title} </Text> | ||
| {element.render()} | ||
| </View> | ||
| ))} | ||
| </View> | ||
| </ScrollView> | ||
| </SafeAreaView> | ||
| ); | ||
| } | ||
|
|
||
| const styles = StyleSheet.create({ | ||
| main: { | ||
| backgroundColor: '#F5FCFF', | ||
| }, | ||
| container: { | ||
| padding: 24, | ||
| paddingBottom: 60, | ||
| }, | ||
| title: { | ||
| fontSize: 18, | ||
| }, | ||
| elementContainer: { | ||
| marginTop: 8, | ||
| }, | ||
| heading: { | ||
| fontSize: 22, | ||
| color: 'black', | ||
| }, | ||
| rtlSwitchContainer: { | ||
| flexDirection: 'row', | ||
| justifyContent: 'space-between', | ||
| paddingHorizontal: 40, | ||
| paddingTop: 20, | ||
| }, | ||
| }); | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.