Skip to content
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

feat: add Fabric support #456

Merged
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
c2b01a3
feat: add FabricExample app
WoLewicki Nov 16, 2022
e9f8ce1
feat: make project compile on ios
WoLewicki Nov 16, 2022
73bcf6f
feat: add all ios props
WoLewicki Nov 17, 2022
70a5761
fix: some quirks and remove setNativeProps
WoLewicki Nov 17, 2022
f63b694
feat: some work on Android
WoLewicki Nov 17, 2022
6f5373b
Add c++ files and make them compile
j-piasecki Nov 19, 2022
b2cff6c
Finish up the dialog picker
j-piasecki Nov 21, 2022
fb9d3e5
Add dropdown picker shadow node
j-piasecki Nov 21, 2022
78c54ad
Clean up component descriptors
j-piasecki Nov 21, 2022
fb19d41
Make paper and fabric work at the same time
j-piasecki Nov 21, 2022
bd63493
Make events work
j-piasecki Nov 21, 2022
b73e9b6
Use native commands instead of `setNativeProps`
j-piasecki Nov 21, 2022
0cfd37a
Apply suggestions from code review
WoLewicki Nov 21, 2022
2ea07ab
fix: change flag as suggested
WoLewicki Nov 21, 2022
d495eed
Remove comments in CMake
j-piasecki Nov 21, 2022
fb33ad0
Add comments
j-piasecki Nov 22, 2022
1f41b69
Clean up config
j-piasecki Nov 22, 2022
f7706d0
Add comments
j-piasecki Nov 23, 2022
5e2fa0e
fix: change setting state to command on ios
WoLewicki Nov 23, 2022
b13a7db
Update js/PickerAndroid.android.js
WoLewicki Nov 24, 2022
9f2750c
feat: change implementation on ios to align with the core-style compo…
WoLewicki Nov 25, 2022
ad8472e
fix: handle commands in a proper way
WoLewicki Nov 25, 2022
06e2599
Merge branch '@wolewicki/add-fabric' of https://github.com/WoLewicki/…
WoLewicki Nov 25, 2022
04e8dad
feat: add some optimizations
WoLewicki Nov 25, 2022
aa45683
fix: update font and compare with ===
WoLewicki Nov 25, 2022
ff60882
fix: format
WoLewicki Nov 28, 2022
55a739e
feat: align android impl with ios one
WoLewicki Nov 28, 2022
c9088df
feat: updated example Podfile.lock
WoLewicki Nov 28, 2022
f8f021f
Update measuring logic for dialog picker
j-piasecki Nov 30, 2022
963ef63
Update measurement for dropdown picker
j-piasecki Nov 30, 2022
d1540e9
Use measurement from `onMeasure` on fabric
j-piasecki Nov 30, 2022
2d42ec5
fix: fix all eslint errors and most of flow checks
WoLewicki Dec 5, 2022
6fa0978
Support RN 0.71 when using the new arch
j-piasecki Apr 13, 2023
54b2cbf
Update to 0.73.0-rc.5
j-piasecki Nov 27, 2023
624af21
Merge branch 'master' into @wolewicki/add-fabric
j-piasecki Nov 27, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions FabricExample/.buckconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

[android]
target = Google Inc.:Google APIs:23

[maven_repositories]
central = https://repo1.maven.org/maven2
2 changes: 2 additions & 0 deletions FabricExample/.bundle/config
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
BUNDLE_PATH: "vendor/bundle"
BUNDLE_FORCE_RUBY_PLATFORM: 1
4 changes: 4 additions & 0 deletions FabricExample/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module.exports = {
root: true,
extends: '@react-native-community',
};
66 changes: 66 additions & 0 deletions FabricExample/.flowconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
[ignore]
; We fork some components by platform
.*/*[.]android.js

; Ignore "BUCK" generated dirs
<PROJECT_ROOT>/\.buckd/

; Ignore polyfills
node_modules/react-native/Libraries/polyfills/.*

; Flow doesn't support platforms
.*/Libraries/Utilities/LoadingView.js

.*/node_modules/resolve/test/resolver/malformed_package_json/package\.json$

[untyped]
.*/node_modules/@react-native-community/cli/.*/.*

[include]

[libs]
node_modules/react-native/interface.js
node_modules/react-native/flow/

[options]
emoji=true

exact_by_default=true

format.bracket_spacing=false

module.file_ext=.js
module.file_ext=.json
module.file_ext=.ios.js

munge_underscores=true

module.name_mapper='^react-native/\(.*\)$' -> '<PROJECT_ROOT>/node_modules/react-native/\1'
module.name_mapper='^@?[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\)$' -> '<PROJECT_ROOT>/node_modules/react-native/Libraries/Image/RelativeImageStub'

suppress_type=$FlowIssue
suppress_type=$FlowFixMe
suppress_type=$FlowFixMeProps
suppress_type=$FlowFixMeState

[lints]
sketchy-null-number=warn
sketchy-null-mixed=warn
sketchy-number=warn
untyped-type-import=warn
nonstrict-import=warn
deprecated-type=warn
unsafe-getters-setters=warn
unnecessary-invariant=warn

[strict]
deprecated-type
nonstrict-import
sketchy-null
unclear-type
unsafe-getters-setters
untyped-import
untyped-type-import

[version]
^0.182.0
64 changes: 64 additions & 0 deletions FabricExample/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# OSX
#
.DS_Store

# Xcode
#
build/
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata
*.xccheckout
*.moved-aside
DerivedData
*.hmap
*.ipa
*.xcuserstate
ios/.xcode.env.local

# Android/IntelliJ
#
build/
.idea
.gradle
local.properties
*.iml
*.hprof
.cxx/

# node.js
#
node_modules/
npm-debug.log
yarn-error.log

# BUCK
buck-out/
\.buckd/
*.keystore
!debug.keystore

# fastlane
#
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
# screenshots whenever they are needed.
# For more information about the recommended setup visit:
# https://docs.fastlane.tools/best-practices/source-control/

**/fastlane/report.xml
**/fastlane/Preview.html
**/fastlane/screenshots
**/fastlane/test_output

# Bundle artifact
*.jsbundle

# Ruby / CocoaPods
/ios/Pods/
/vendor/bundle/
7 changes: 7 additions & 0 deletions FabricExample/.prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module.exports = {
arrowParens: 'avoid',
bracketSameLine: true,
bracketSpacing: false,
singleQuote: true,
trailingComma: 'all',
};
1 change: 1 addition & 0 deletions FabricExample/.ruby-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2.7.5
1 change: 1 addition & 0 deletions FabricExample/.watchmanconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
86 changes: 86 additions & 0 deletions FabricExample/App.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
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';

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>
)}
</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,
},
});
6 changes: 6 additions & 0 deletions FabricExample/Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
source 'https://rubygems.org'

# You may use http://rbenv.org/ or https://rvm.io/ to install and use this version
ruby '2.7.5'

gem 'cocoapods', '~> 1.11', '>= 1.11.2'
Loading