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: support Fabric #1754

Closed
wants to merge 58 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
4cf59b8
feat: add FabricExample app
WoLewicki Mar 24, 2022
73898fc
feat: add first look on Android implementation
WoLewicki Mar 24, 2022
ff85474
feat: android compiling
WoLewicki Mar 28, 2022
2b421a2
feat: first look at adding Circle
WoLewicki Mar 28, 2022
0539a45
feat: start iOS work with svgView and Circle
WoLewicki Mar 29, 2022
7ebd829
feat: use contentViews and add group and circle
WoLewicki Apr 8, 2022
b5336b5
feat: circle rendered on iOS
WoLewicki Apr 19, 2022
c13fa3a
feat: add fill on Android
WoLewicki Apr 19, 2022
ae77760
chore: upgrade rn version to 0.68.1
WoLewicki Apr 19, 2022
cbb8abe
feat: add implicit changes from 0.68.1
WoLewicki Apr 19, 2022
9927404
fix: add proper ndk resolving for m1
WoLewicki Apr 19, 2022
0bdc342
feat: visible circle on Android
WoLewicki Apr 19, 2022
adb7d0d
feat: add CI for Fabric
WoLewicki Apr 20, 2022
b9655f5
Merge branch 'main' into @wolewicki/add-fabric
WoLewicki Apr 21, 2022
aa0fd08
feat: add fill prop on iOS by changing prop to object
WoLewicki Apr 25, 2022
c9b539e
feat: add fill prop on Android by changing prop to object
WoLewicki Apr 25, 2022
82fcd44
feat: add compiling of macos and Android on paper
WoLewicki Apr 26, 2022
e4fe662
feat: all props in svgView and NumberProp to string
WoLewicki Apr 26, 2022
44cc926
feat: add almost all props to group component
WoLewicki May 5, 2022
03ec651
feat: add common props parsing to group and circle
WoLewicki May 10, 2022
02f0f2d
fix: minor improvements
WoLewicki May 10, 2022
57fd538
fix: rename contentView and props so it is easier to replicate
WoLewicki May 10, 2022
0ee49fb
feat: add clipPath
WoLewicki May 10, 2022
67d7eae
feat: add defs
WoLewicki May 10, 2022
b080954
feat: add ellipse
WoLewicki May 10, 2022
b3bf699
fix: remove properties from circle header
WoLewicki May 10, 2022
a50eab0
feat: add foreignObject and make template functions static
WoLewicki May 11, 2022
aa2c427
fix: remove static for now
WoLewicki May 11, 2022
9826a9a
feat: add line
WoLewicki May 11, 2022
870bf0b
feat: add rect
WoLewicki May 11, 2022
5ca6a74
fix: change include to import and name of FabricConversions
WoLewicki May 11, 2022
d86f73c
feat: add linearGradient
WoLewicki May 11, 2022
56113b6
feat: add radialGradient
WoLewicki May 11, 2022
187f526
feat: add marker and abstract meetOrSlice
WoLewicki May 11, 2022
53b4f91
feat: add mask
WoLewicki May 11, 2022
5858877
feat: add path
WoLewicki May 11, 2022
7b67ee3
feat: add pattern
WoLewicki May 12, 2022
ab45eac
feat: add symbol and change its viewManager inheritance to match view
WoLewicki May 12, 2022
27fbd5f
fix: dont stringify undefined and null values
WoLewicki May 12, 2022
d9be439
feat: add use
WoLewicki May 12, 2022
33abbb8
fix: better stringifying implementation
WoLewicki May 12, 2022
ddbafe2
feat: add text
WoLewicki May 12, 2022
6a0cae6
feat: add textPath
WoLewicki May 12, 2022
6642d0b
feat: add tspan
WoLewicki May 12, 2022
fbff912
feat: add image without src prop
WoLewicki May 13, 2022
284acce
fix: add adding children to text components
WoLewicki May 13, 2022
87a7d4f
fix: color resolving issues
WoLewicki Jul 15, 2022
7e08472
feat: add Example app files to FabricExample
WoLewicki Jul 15, 2022
22d5a56
fix: remove unnecessary files with components
WoLewicki Jul 15, 2022
8c29e33
feat: first look at image source
WoLewicki Jul 15, 2022
e8de06b
feat: exlude fabric-specific files on old arch
WoLewicki Jul 18, 2022
17c4758
fix: cleanup svgView and add missing prop updates
WoLewicki Jul 18, 2022
3150b7e
chore: extract mount and unmount to functions
WoLewicki Jul 18, 2022
f05a2eb
fix: extract group props to methods and types and fix text handling b…
WoLewicki Jul 19, 2022
182d623
fix: wrong prop
WoLewicki Jul 19, 2022
2bb622d
fix: make commands work and add example to FabricExample
WoLewicki Jul 19, 2022
d52e224
fix: make touch responders work with kinda hacky solution
WoLewicki Jul 20, 2022
e27adad
fix: use currentBridge directly each time so it works after reloads
WoLewicki Jul 20, 2022
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
38 changes: 38 additions & 0 deletions .github/workflows/android-build-test-fabric.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Test Android build on Fabric
on:
pull_request:
branches:
- main
paths:
- 'android/**'
- 'common/**'
- 'src/fabric/**'
- 'FabricExample/**'
- 'package.json'
push:
branches:
- main
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
env:
WORKING_DIRECTORY: FabricExample
concurrency:
group: android-fabric-${{ github.ref }}
cancel-in-progress: true
steps:
- name: checkout
uses: actions/checkout@v2
- name: Use Node.js 14
uses: actions/setup-node@v2
with:
node-version: 14
cache: 'yarn'
cache-dependency-path: 'FabricExample/yarn.lock'
- name: Install node dependencies
working-directory: ${{ env.WORKING_DIRECTORY }}
run: yarn
- name: Build app
working-directory: ${{ env.WORKING_DIRECTORY }}/android
run: ./gradlew assembleDebug --console=plain
42 changes: 42 additions & 0 deletions .github/workflows/ios-build-test-fabric.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Test iOS build on Fabric
on:
pull_request:
branches:
- main
paths:
- 'ios/**'
- 'common/**'
- 'src/fabric/**'
- 'FabricExample/**'
- 'package.json'
- 'RNScreens.podspec'
push:
branches:
- main
workflow_dispatch:
jobs:
build:
runs-on: macos-latest
env:
WORKING_DIRECTORY: FabricExample
concurrency:
group: ios-fabric-${{ github.ref }}
cancel-in-progress: true
steps:
- name: checkout
uses: actions/checkout@v2
- name: Use Node.js 14
uses: actions/setup-node@v2
with:
node-version: 14
cache: 'yarn'
cache-dependency-path: 'FabricExample/yarn.lock'
- name: Install node dependencies
working-directory: ${{ env.WORKING_DIRECTORY }}
run: yarn
- name: Install pods
working-directory: ${{ env.WORKING_DIRECTORY }}/ios
run: RCT_NEW_ARCH_ENABLED=1 pod install
- name: Build app
working-directory: ${{ env.WORKING_DIRECTORY }}
run: yarn ios
6 changes: 3 additions & 3 deletions Example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,7 @@ SPEC CHECKSUMS:
CocoaAsyncSocket: 065fd1e645c7abab64f7a6a2007a48038fdc6a99
DoubleConversion: 831926d9b8bf8166fd87886c4abab286c2422662
FBLazyVector: bcdeff523be9f87a135b7c6fde8736db94904716
FBReactNativeSpec: c01fba40ea819e68030d0d9b9094a173b2a3d127
FBReactNativeSpec: 0c3f104f594b34d7b3a923cd12e03b0d4e12eaf5
Flipper: 26fc4b7382499f1281eb8cb921e5c3ad6de91fe0
Flipper-Boost-iOSX: fd1e2b8cbef7e662a122412d7ac5f5bea715403c
Flipper-DoubleConversion: 57ffbe81ef95306cc9e69c4aa3aeeeeb58a6a28c
Expand Down Expand Up @@ -540,11 +540,11 @@ SPEC CHECKSUMS:
React-RCTVibration: 5cab6419b68d5750482b0fc34dbb27af550469cc
React-runtimeexecutor: 10cda3a396b14a764a5f86088e7e3810b9c66cec
ReactCommon: 73a01eb83f22c84a6b09dfb60f3463888ebd4975
RNSVG: 302bfc9905bd8122f08966dc2ce2d07b7b52b9f8
RNSVG: 86ae7766bc3f6735c98319352f6ff6f2b98d7716
SocketRocket: fccef3f9c5cedea1353a9ef6ada904fde10d6608
Yoga: d29dba374c1a582b40cfb736647b5e1b5ed35dba
YogaKit: f782866e155069a2cca2517aafea43200b01fd5a

PODFILE CHECKSUM: e30a289393eb06dc243ea6a44784bc9e84b1129f

COCOAPODS: 1.11.2
COCOAPODS: 1.11.3
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
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',
};
67 changes: 67 additions & 0 deletions FabricExample/.flowconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
[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
signature-verification-failure=warn

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

[version]
^0.170.0
61 changes: 61 additions & 0 deletions FabricExample/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# 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

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

# 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

# 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/.watchmanconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
33 changes: 33 additions & 0 deletions FabricExample/App.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import React, { useRef } from 'react';
import {Circle, G, Svg} from 'react-native-svg';
import { PlatformColor, Platform, DynamicColorIOS, Text } from 'react-native';

const color = PlatformColor(Platform.select({
ios: 'systemTealColor',
android: '@android:color/holo_blue_bright',
default: 'black',
}))

// const customContrastDynamicTextColor = DynamicColorIOS({
// dark: 'purple',//'hsla(360, 40%, 30%, 1.0)',
// light: 'green',//'#ff00ff55',
// highContrastDark: 'blue',
// highContrastLight: 'red',
// });

export default () => {
return (
<>
<Svg height="100" width={140} color='hsla(360, 40%, 30%, 1.0)' fontSize={15} fontWeight={20} font={{fontSize: 15}}>
{/* <G fontSize={15} fontWeight={200}/> */}
<Circle
cx={50}
cy="50"
r={45}
fill="currentColor"
/>
</Svg>
<Text>TEST</Text>
</>
);
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New line 🙂

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.4'

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