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 on iOS without ComponentViews #1821

Merged
merged 93 commits into from
Aug 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
93 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
1a2cbd7
feat: make project compile with all .mm files and transfer circle
WoLewicki Jul 29, 2022
82675cf
feat: reset all props of circle so it recycles correctly
WoLewicki Aug 1, 2022
3b8767f
feat: add rest of the shapes
WoLewicki Aug 1, 2022
fe51eae
feat: add imgae
WoLewicki Aug 2, 2022
5ff0854
feat: add defs
WoLewicki Aug 2, 2022
bf8c7de
feat: add gradients
WoLewicki Aug 2, 2022
29bdf34
feat: add path
WoLewicki Aug 2, 2022
3c3a7a7
feat: add use
WoLewicki Aug 2, 2022
fcb7104
feat: add group
WoLewicki Aug 2, 2022
4ccd529
feat: add clipPath
WoLewicki Aug 2, 2022
c1b0d91
feat: add foreignObject
WoLewicki Aug 2, 2022
ddcc1fe
feat: add marker
WoLewicki Aug 2, 2022
1762c33
feat: add mask
WoLewicki Aug 2, 2022
cef8380
feat: add pattern
WoLewicki Aug 2, 2022
877dd16
feat: add symbol
WoLewicki Aug 2, 2022
26a3aaa
feat: add text
WoLewicki Aug 2, 2022
c865132
feat: add textPath
WoLewicki Aug 2, 2022
60bd064
feat: add TSpan
WoLewicki Aug 2, 2022
e37c7ba
feat: add svgView with black background
WoLewicki Aug 2, 2022
da22d8d
fix: remove opaque background of svg
WoLewicki Aug 2, 2022
cac788d
feat: apply review suggestions
WoLewicki Aug 8, 2022
634f1c3
fix: make non-fabric compile
WoLewicki Aug 8, 2022
9c1cddf
fix: remove contentView from VMs
WoLewicki Aug 8, 2022
9fa4c63
fix: remove unnecessary code and fix textPath recycling
WoLewicki Aug 8, 2022
61a430e
feat: clean up code
WoLewicki Aug 8, 2022
eb5f1c7
feat: add tranform handling via core tranform prop
WoLewicki Aug 8, 2022
6275823
fix: remove all android-related changes
WoLewicki Aug 10, 2022
1492e41
chore: merge current main
WoLewicki Aug 10, 2022
8425fbb
feat: make ios compile wo fabric
WoLewicki Aug 10, 2022
94a3caf
fix: apply changes to CI for Fabric
WoLewicki Aug 10, 2022
23f7e87
fix: run format
WoLewicki Aug 10, 2022
e75abe1
fix: tests
WoLewicki Aug 10, 2022
d33087d
fix: changes for macos
WoLewicki Aug 10, 2022
e8614eb
fix: macos not compiling
WoLewicki Aug 11, 2022
6aa9a82
chore: remove App.tsx from main folder
WoLewicki Aug 11, 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
5 changes: 4 additions & 1 deletion .github/workflows/ios-build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ on:
- 'RNSVG.podspec'
- 'apple/**'
- 'Example/ios/**'
- 'src/fabric/**'
- 'FabricExample/**'
- 'package.json'
push:
branches:
- main
Expand All @@ -15,7 +18,7 @@ jobs:
runs-on: macos-12
strategy:
matrix:
working-directory: [Example]
working-directory: [Example, FabricExample]
concurrency:
group: ios-${{ matrix.working-directory }}-${{ github.ref }}
steps:
Expand Down
4 changes: 2 additions & 2 deletions Example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ PODS:
- React-jsi (= 0.68.0-rc.1)
- React-logger (= 0.68.0-rc.1)
- React-perflogger (= 0.68.0-rc.1)
- RNSVG (12.4.0):
- RNSVG (12.4.4):
- React-Core
- SocketRocket (0.6.0)
- Yoga (1.14.0)
Expand Down Expand Up @@ -540,7 +540,7 @@ SPEC CHECKSUMS:
React-RCTVibration: 5cab6419b68d5750482b0fc34dbb27af550469cc
React-runtimeexecutor: 10cda3a396b14a764a5f86088e7e3810b9c66cec
ReactCommon: 73a01eb83f22c84a6b09dfb60f3463888ebd4975
RNSVG: 3dd44d99d1c18e1342aee4bfa53ab3f6a8c4865f
RNSVG: ce63dc0dfa033974c70812171a76a5973db7c64a
SocketRocket: fccef3f9c5cedea1353a9ef6ada904fde10d6608
Yoga: d29dba374c1a582b40cfb736647b5e1b5ed35dba
YogaKit: f782866e155069a2cca2517aafea43200b01fd5a
Expand Down
6 changes: 3 additions & 3 deletions Example/macos/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ PODS:
- React-jsi (= 0.66.17)
- React-logger (= 0.66.17)
- React-perflogger (= 0.66.17)
- RNSVG (12.2.0):
- RNSVG (12.4.4):
- React-Core
- Yoga (1.14.0)
- YogaKit (1.18.1):
Expand Down Expand Up @@ -528,10 +528,10 @@ SPEC CHECKSUMS:
React-RCTVibration: 2a3a67f22b60d7a8faa805c69a18dee356669320
React-runtimeexecutor: 3404d9c610a682e710e91e69b45b1e07fb6efad0
ReactCommon: 89d1b7528338d4ae4c44d3459582785d212832ea
RNSVG: 4ecc2e8f38b6ebe7889909570c26f3abe8059767
RNSVG: ce63dc0dfa033974c70812171a76a5973db7c64a
Yoga: 0664982d23529e0767fc7f364ad9b8e06aa713c7
YogaKit: f782866e155069a2cca2517aafea43200b01fd5a

PODFILE CHECKSUM: 3977aa53ea9660368db33335fc1e16c0a720ca09

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 @@
{}
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'
Copy link
Member

Choose a reason for hiding this comment

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

Ruby was bumped up to '2.7.5' with React Native 0.69.0 however I doubt it would cause any problems.


gem 'cocoapods', '~> 1.11', '>= 1.11.2'
100 changes: 100 additions & 0 deletions FabricExample/Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
GEM
remote: https://rubygems.org/
specs:
CFPropertyList (3.0.5)
rexml
activesupport (6.1.5)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 1.6, < 2)
minitest (>= 5.1)
tzinfo (~> 2.0)
zeitwerk (~> 2.3)
addressable (2.8.0)
public_suffix (>= 2.0.2, < 5.0)
algoliasearch (1.27.5)
httpclient (~> 2.8, >= 2.8.3)
json (>= 1.5.1)
atomos (0.1.3)
claide (1.1.0)
cocoapods (1.11.3)
addressable (~> 2.8)
claide (>= 1.0.2, < 2.0)
cocoapods-core (= 1.11.3)
cocoapods-deintegrate (>= 1.0.3, < 2.0)
cocoapods-downloader (>= 1.4.0, < 2.0)
cocoapods-plugins (>= 1.0.0, < 2.0)
cocoapods-search (>= 1.0.0, < 2.0)
cocoapods-trunk (>= 1.4.0, < 2.0)
cocoapods-try (>= 1.1.0, < 2.0)
colored2 (~> 3.1)
escape (~> 0.0.4)
fourflusher (>= 2.3.0, < 3.0)
gh_inspector (~> 1.0)
molinillo (~> 0.8.0)
nap (~> 1.0)
ruby-macho (>= 1.0, < 3.0)
xcodeproj (>= 1.21.0, < 2.0)
cocoapods-core (1.11.3)
activesupport (>= 5.0, < 7)
addressable (~> 2.8)
algoliasearch (~> 1.0)
concurrent-ruby (~> 1.1)
fuzzy_match (~> 2.0.4)
nap (~> 1.0)
netrc (~> 0.11)
public_suffix (~> 4.0)
typhoeus (~> 1.0)
cocoapods-deintegrate (1.0.5)
cocoapods-downloader (1.5.1)
cocoapods-plugins (1.0.0)
nap
cocoapods-search (1.0.1)
cocoapods-trunk (1.6.0)
nap (>= 0.8, < 2.0)
netrc (~> 0.11)
cocoapods-try (1.2.0)
colored2 (3.1.2)
concurrent-ruby (1.1.9)
escape (0.0.4)
ethon (0.15.0)
ffi (>= 1.15.0)
ffi (1.15.5)
fourflusher (2.3.1)
fuzzy_match (2.0.4)
gh_inspector (1.1.3)
httpclient (2.8.3)
i18n (1.10.0)
concurrent-ruby (~> 1.0)
json (2.6.1)
minitest (5.15.0)
molinillo (0.8.0)
nanaimo (0.3.0)
nap (1.1.0)
netrc (0.11.0)
public_suffix (4.0.6)
rexml (3.2.5)
ruby-macho (2.5.1)
typhoeus (1.4.0)
ethon (>= 0.9.0)
tzinfo (2.0.4)
concurrent-ruby (~> 1.0)
xcodeproj (1.21.0)
CFPropertyList (>= 2.3.3, < 4.0)
atomos (~> 0.1.3)
claide (>= 1.0.2, < 2.0)
colored2 (~> 3.1)
nanaimo (~> 0.3.0)
rexml (~> 3.2.4)
zeitwerk (2.5.4)

PLATFORMS
ruby

DEPENDENCIES
cocoapods (~> 1.11, >= 1.11.2)

RUBY VERSION
ruby 2.7.4p191

BUNDLED WITH
2.2.27
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
1 change: 1 addition & 0 deletions FabricExample/_ruby-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2.7.4
55 changes: 55 additions & 0 deletions FabricExample/android/app/_BUCK
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# To learn about Buck see [Docs](https://buckbuild.com/).
# To run your application with Buck:
# - install Buck
# - `npm start` - to start the packager
# - `cd android`
# - `keytool -genkey -v -keystore keystores/debug.keystore -storepass android -alias androiddebugkey -keypass android -dname "CN=Android Debug,O=Android,C=US"`
# - `./gradlew :app:copyDownloadableDepsToLibs` - make all Gradle compile dependencies available to Buck
# - `buck install -r android/app` - compile, install and run application
#

load(":build_defs.bzl", "create_aar_targets", "create_jar_targets")

lib_deps = []

create_aar_targets(glob(["libs/*.aar"]))

create_jar_targets(glob(["libs/*.jar"]))

android_library(
name = "all-libs",
exported_deps = lib_deps,
)

android_library(
name = "app-code",
srcs = glob([
"src/main/java/**/*.java",
]),
deps = [
":all-libs",
":build_config",
":res",
],
)

android_build_config(
name = "build_config",
package = "com.fabricexample",
)

android_resource(
name = "res",
package = "com.fabricexample",
res = "src/main/res",
)

android_binary(
name = "app",
keystore = "//android/keystores:debug",
manifest = "src/main/AndroidManifest.xml",
package_type = "debug",
deps = [
":app-code",
],
)
Loading