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

Enable New Architecture in Bluesky on RN 0.76 #6755

Open
wants to merge 36 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 34 commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
4973bda
install, cleanup some patches
haileyok Nov 10, 2024
00a0036
update expo notifications patch
haileyok Nov 10, 2024
0071f8f
rm kotlin override
haileyok Nov 10, 2024
358ccee
remove mask view
haileyok Nov 10, 2024
6d239ec
remove legacy camera permissions
haileyok Nov 10, 2024
fed292f
fix compiler
haileyok Nov 10, 2024
7f24a7a
fix compiler
haileyok Nov 10, 2024
4b3f938
more compiler fixes
haileyok Nov 10, 2024
9c5a3e7
Merge remote-tracking branch 'origin/main' into hailey/0.76
haileyok Nov 10, 2024
5c9e0fe
bump android target
haileyok Nov 10, 2024
194808c
bump glide version
haileyok Nov 10, 2024
932fc75
update glide usage from ver bump
haileyok Nov 10, 2024
82c92ec
building on android
haileyok Nov 10, 2024
323f5a0
patch rn screens
haileyok Nov 10, 2024
698ae27
fix expo-notifs patch
haileyok Nov 10, 2024
cccc01f
downgrade rn-screens
haileyok Nov 10, 2024
fdba6ea
patch compressor
haileyok Nov 11, 2024
ad2c5fd
Merge remote-tracking branch 'origin/main' into hailey/0.76
haileyok Nov 11, 2024
a310cfd
fix glide
haileyok Nov 11, 2024
f6aa111
a bunch of type fixes
haileyok Nov 11, 2024
4129c02
temp
haileyok Nov 11, 2024
54de3dd
temp fix rn types
haileyok Nov 11, 2024
7c64e75
revert massive changes to yarn lock (linux ftw)
haileyok Nov 11, 2024
cdb7efe
feat: run new arch on 0.76 branch
WoLewicki Nov 26, 2024
d17f2c1
fix: change bottomsheet to gorhom's and add patch for pasteInput on 76
WoLewicki Nov 27, 2024
5e35145
fix: revert one of patches and make android compile
WoLewicki Nov 27, 2024
17c2630
chore: merge current main
WoLewicki Dec 9, 2024
fd08e37
fix: align with main
WoLewicki Dec 9, 2024
09fbdf7
chore: merge current main
WoLewicki Dec 12, 2024
58b04f2
Revert "Fix web build (#7069)"
gaearon Dec 12, 2024
8bfa8fe
Revert "configure the bitdrift Capture SDK (#6979)"
gaearon Dec 12, 2024
af0dea5
fix: make bottomsheet work on new arch
WoLewicki Dec 13, 2024
82f8ace
chore: merge current main
WoLewicki Dec 17, 2024
5236888
chore: revert bitdrift changes
WoLewicki Dec 17, 2024
5db38d7
fix: revert change in app.config.js
WoLewicki Dec 18, 2024
a7476f9
chore: merge current main
WoLewicki Dec 18, 2024
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: 2 additions & 3 deletions app.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -203,13 +203,13 @@ module.exports = function (config) {
{
ios: {
deploymentTarget: '15.1',
newArchEnabled: false,
newArchEnabled: true,
},
android: {
compileSdkVersion: 35,
targetSdkVersion: 35,
buildToolsVersion: '35.0.0',
newArchEnabled: false,
newArchEnabled: true,
},
},
],
Expand All @@ -222,7 +222,6 @@ module.exports = function (config) {
},
],
'react-native-compressor',
'@bitdrift/react-native',
gaearon marked this conversation as resolved.
Show resolved Hide resolved
'./plugins/starterPackAppClipExtension/withStarterPackAppClip.js',
'./plugins/withAndroidManifestPlugin.js',
'./plugins/withAndroidManifestFCMIconPlugin.js',
Expand Down
4 changes: 4 additions & 0 deletions modules/bottom-sheet/ios/BottomSheet-Bridging-Header.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
//
// Use this file to import your target's public headers that you would like to expose to Swift.
//
#import <React/RCTSurfaceTouchHandler.h>
6 changes: 5 additions & 1 deletion modules/bottom-sheet/ios/BottomSheet.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,14 @@ Pod::Spec.new do |s|

s.dependency 'ExpoModulesCore'

new_arch_enabled = ENV['RCT_NEW_ARCH_ENABLED'] == '1'
new_arch_compiler_flags = '-DRCT_NEW_ARCH_ENABLED'

# Swift/Objective-C compatibility
s.pod_target_xcconfig = {
'DEFINES_MODULE' => 'YES',
'SWIFT_COMPILATION_MODE' => 'wholemodule'
'SWIFT_COMPILATION_MODE' => 'wholemodule',
'OTHER_SWIFT_FLAGS' => "$(inherited) #{new_arch_enabled ? new_arch_compiler_flags : ''}",
}

s.source_files = "**/*.{h,m,swift}"
Expand Down
21 changes: 20 additions & 1 deletion modules/bottom-sheet/ios/SheetView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ class SheetView: ExpoView, UISheetPresentationControllerDelegate {
// Views
private var sheetVc: SheetViewController?
private var innerView: UIView?
#if RCT_NEW_ARCH_ENABLED
private var touchHandler: RCTSurfaceTouchHandler?
#else
private var touchHandler: RCTTouchHandler?
#endif

// Events
private let onAttemptDismiss = EventDispatcher()
Expand Down Expand Up @@ -73,7 +77,11 @@ class SheetView: ExpoView, UISheetPresentationControllerDelegate {
required init (appContext: AppContext? = nil) {
super.init(appContext: appContext)
self.maxHeight = Util.getScreenHeight()
#if RCT_NEW_ARCH_ENABLED
self.touchHandler = RCTSurfaceTouchHandler()
#else
self.touchHandler = RCTTouchHandler(bridge: appContext?.reactBridge)
#endif
SheetManager.shared.add(self)
}

Expand All @@ -87,6 +95,15 @@ class SheetView: ExpoView, UISheetPresentationControllerDelegate {
self.touchHandler?.attach(to: subview)
self.innerView = subview
}

#if RCT_NEW_ARCH_ENABLED
override func mountChildComponentView(_ childComponentView: UIView, index: Int) {
self.touchHandler?.attach(to: childComponentView)
self.innerView = childComponentView
}

override func unmountChildComponentView(_ childComponentView: UIView, index: Int) {}
#endif

// We'll grab the content height from here so we know the initial detent to set
override func layoutSubviews() {
Expand All @@ -107,7 +124,9 @@ class SheetView: ExpoView, UISheetPresentationControllerDelegate {
self.isClosing = false
self.isOpen = false
self.sheetVc = nil
self.touchHandler?.detach(from: self.innerView)
if let innerView = self.innerView {
self.touchHandler?.detach(from: innerView)
}
self.touchHandler = nil
self.innerView = nil
SheetManager.shared.remove(self)
Expand Down
2 changes: 2 additions & 0 deletions modules/bottom-sheet/src/BottomSheetNativeComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ export class BottomSheetNativeComponent extends React.Component<
}}
containerBackgroundColor={backgroundColor}>
<View
collapsable={false}
style={[
{
flex: 1,
Expand All @@ -122,6 +123,7 @@ export class BottomSheetNativeComponent extends React.Component<
extraStyles,
]}>
<View
collapsable={false}
onLayout={e => {
const {height} = e.nativeEvent.layout
this.setState({viewHeight: height})
Expand Down
2 changes: 1 addition & 1 deletion modules/expo-bluesky-gif-view/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -94,5 +94,5 @@ dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:${getKotlinVersion()}"

// Keep glide version up to date with expo-image so that we don't have duplicate deps
implementation 'com.github.bumptech.glide:glide:4.13.2'
implementation 'com.github.bumptech.glide:glide:4.16.0'
}
32 changes: 16 additions & 16 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
},
"dependencies": {
"@atproto/api": "^0.13.20",
"@bitdrift/react-native": "0.4.0",
"@bitdrift/react-native": "0.5.0",
"@braintree/sanitize-url": "^6.0.2",
"@discord/bottom-sheet": "bluesky-social/react-native-bottom-sheet",
"@emoji-mart/react": "^1.1.1",
Expand All @@ -74,21 +74,21 @@
"@haileyok/bluesky-video": "0.2.4",
"@ipld/dag-cbor": "^9.2.0",
"@lingui/react": "^4.14.1",
"@mattermost/react-native-paste-input": "^0.7.1",
"@mattermost/react-native-paste-input": "bluesky-social/react-native-paste-input",
"@miblanchard/react-native-slider": "^2.3.1",
"@mozzius/expo-dynamic-app-icon": "^1.5.0",
"@radix-ui/react-dismissable-layer": "^1.1.1",
"@radix-ui/react-dropdown-menu": "2.0.1",
"@radix-ui/react-focus-guards": "^1.1.1",
"@radix-ui/react-focus-scope": "^1.1.0",
"@react-native-async-storage/async-storage": "1.23.1",
"@react-native-async-storage/async-storage": "1.24.0",
"@react-native-menu/menu": "^1.1.7",
"@react-native-picker/picker": "2.10.2",
"@react-navigation/bottom-tabs": "^6.5.20",
"@react-navigation/drawer": "^6.6.15",
"@react-navigation/native": "^6.1.17",
"@react-navigation/native-stack": "^6.9.26",
"@sentry/react-native": "5.24.3",
"@react-navigation/bottom-tabs": "^6.6.1",
"@react-navigation/drawer": "^6.7.2",
"@react-navigation/native": "^6.1.18",
"@react-navigation/native-stack": "^6.11.0",
"@sentry/react-native": "~6.1.0",
"@tanstack/query-async-storage-persister": "^5.25.0",
"@tanstack/react-query": "^5.8.1",
"@tanstack/react-query-persist-client": "^5.25.0",
Expand Down Expand Up @@ -164,9 +164,9 @@
"patch-package": "^6.5.1",
"postinstall-postinstall": "^2.1.0",
"psl": "^1.9.0",
"react": "18.2.0",
"react": "18.3.1",
"react-compiler-runtime": "19.0.0-beta-a7bf2bd-20241110",
"react-dom": "^18.2.0",
"react-dom": "18.3.1",
"react-image-crop": "^11.0.7",
"react-keyed-flatten-children": "^3.0.0",
"react-native": "0.76.3",
Expand All @@ -175,20 +175,20 @@
"react-native-drawer-layout": "^4.0.4",
"react-native-gesture-handler": "2.20.2",
"react-native-get-random-values": "~1.11.0",
"react-native-image-crop-picker": "^0.41.6",
"react-native-image-crop-picker": "0.41.6",
"react-native-ios-context-menu": "^1.15.3",
"react-native-keyboard-controller": "^1.14.5",
"react-native-mmkv": "^2.12.2",
"react-native-mmkv": "3.1.0",
"react-native-pager-view": "6.6.1",
"react-native-picker-select": "^9.3.1",
"react-native-progress": "bluesky-social/react-native-progress",
"react-native-qrcode-styled": "^0.3.3",
"react-native-reanimated": "3.17.0-nightly-20241211-17e89ca24",
"react-native-root-siblings": "^4.1.1",
"react-native-root-siblings": "^5.0.1",
"react-native-safe-area-context": "4.14.0",
"react-native-screens": "~4.3.0",
"react-native-svg": "^15.8.0",
"react-native-uitextview": "^1.4.0",
"react-native-svg": "^15.10.1",
"react-native-uitextview": "2.0.0-rc.0",
"react-native-url-polyfill": "^1.3.0",
"react-native-uuid": "^2.0.2",
"react-native-view-shot": "^4.0.3",
Expand All @@ -203,7 +203,7 @@
"tippy.js": "^6.3.7",
"tlds": "^1.234.0",
"tldts": "^6.1.46",
"zeego": "^1.6.2",
"zeego": "^1.10.0",
"zod": "^3.20.2"
},
"devDependencies": {
Expand Down
16 changes: 0 additions & 16 deletions patches/@mattermost+react-native-paste-input+0.7.1.patch

This file was deleted.

126 changes: 126 additions & 0 deletions patches/@mattermost+react-native-paste-input+0.8.1-rc.6.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
diff --git a/node_modules/@mattermost/react-native-paste-input/android/src/main/jni/CMakeLists.txt b/node_modules/@mattermost/react-native-paste-input/android/src/main/jni/CMakeLists.txt
index f9e4dfc..c71ef6e 100644
--- a/node_modules/@mattermost/react-native-paste-input/android/src/main/jni/CMakeLists.txt
+++ b/node_modules/@mattermost/react-native-paste-input/android/src/main/jni/CMakeLists.txt
@@ -20,26 +20,10 @@ target_include_directories(react_codegen_PasteTextInputSpecs PUBLIC . react/rend

target_link_libraries(
react_codegen_PasteTextInputSpecs
- fbjni
- folly_runtime
- glog
+ reactnative
jsi
- react_codegen_rncore
- react_debug
- react_nativemodule_core
- react_featureflags
- react_render_textlayoutmanager
- react_render_componentregistry
- react_render_core
- react_render_debug
- react_render_graphics
- react_render_imagemanager
- react_render_mapbuffer
- react_utils
- rrc_view
- rrc_text
- rrc_textinput
- yoga
+ fbjni
+ android
${log-lib}
)

diff --git a/node_modules/@mattermost/react-native-paste-input/ios/PasteInputView.m b/node_modules/@mattermost/react-native-paste-input/ios/PasteInputView.m
index e916023..811574c 100644
--- a/node_modules/@mattermost/react-native-paste-input/ios/PasteInputView.m
+++ b/node_modules/@mattermost/react-native-paste-input/ios/PasteInputView.m
@@ -22,6 +22,11 @@ - (instancetype)initWithBridge:(RCTBridge *)bridge
_backedTextInputView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
_backedTextInputView.textInputDelegate = self;

+ // Disable inline predictions to prevent jank in the composer
+ if (@available(iOS 17.0, *)) {
+ _backedTextInputView.inlinePredictionType = UITextInlinePredictionTypeNo;
+ }
+
[self addSubview:_backedTextInputView];
}

diff --git a/node_modules/@mattermost/react-native-paste-input/ios/PasteTextInput.mm b/node_modules/@mattermost/react-native-paste-input/ios/PasteTextInput.mm
index 65aa7d9..c088635 100644
--- a/node_modules/@mattermost/react-native-paste-input/ios/PasteTextInput.mm
+++ b/node_modules/@mattermost/react-native-paste-input/ios/PasteTextInput.mm
@@ -361,16 +361,12 @@ - (NSString *)textInputShouldChangeText:(NSString *)text inRange:(NSRange)range

if (!_backedTextInputView.textWasPasted) {
if (_eventEmitter) {
- KeyPressMetrics keyPressMetrics;
+ TextInputEventEmitter::KeyPressMetrics keyPressMetrics;
keyPressMetrics.text = RCTStringFromNSString(text);
keyPressMetrics.eventCount = _mostRecentEventCount;

- const auto eventEmitter = [self getEventEmitter];
- if (props.onKeyPressSync) {
- eventEmitter->onKeyPressSync(keyPressMetrics);
- } else {
- eventEmitter->onKeyPress(keyPressMetrics);
- }
+ const auto eventEmitter = [self getEventEmitter];
+ eventEmitter->onKeyPress(keyPressMetrics);
}
}

@@ -416,12 +412,7 @@ - (void)textInputDidChange

if (_eventEmitter) {
const auto eventEmitter = [self getEventEmitter];
- const auto &props = static_cast<const PasteTextInputProps &>(*_props);
- if (props.onChangeSync) {
- eventEmitter->onChangeSync([self _textInputMetrics]);
- } else {
- eventEmitter->onChange([self _textInputMetrics]);
- }
+ eventEmitter->onChange([self _textInputMetrics]);
}
}

@@ -551,9 +542,9 @@ - (void)handleInputAccessoryDoneButton

#pragma mark - Other

-- (TextInputMetrics)_textInputMetrics
+- (TextInputEventEmitter::Metrics)_textInputMetrics
{
- TextInputMetrics metrics;
+ TextInputEventEmitter::Metrics metrics;
metrics.text = RCTStringFromNSString(_backedTextInputView.attributedText.string);
metrics.selectionRange = [self _selectionRange];
metrics.eventCount = _mostRecentEventCount;
diff --git a/node_modules/@mattermost/react-native-paste-input/ios/PasteTextInputManager.mm b/node_modules/@mattermost/react-native-paste-input/ios/PasteTextInputManager.mm
index d1aee72..ba8934e 100644
--- a/node_modules/@mattermost/react-native-paste-input/ios/PasteTextInputManager.mm
+++ b/node_modules/@mattermost/react-native-paste-input/ios/PasteTextInputManager.mm
@@ -10,20 +10,14 @@
#import <React/RCTUIManagerUtils.h>
#import <React/RCTShadowView+Layout.h>
#import <React/RCTShadowView.h>
+#import <React/RCTMultilineTextInputViewManager.h>

#import "PasteTextInput.h"
#import "PasteInputView.h"

-#ifdef RCT_NEW_ARCH_ENABLED
-@interface PasteTextInputManager : RCTViewManager
-@end
-#else
-#import <React/RCTMultilineTextInputViewManager.h>
-
@interface PasteTextInputManager : RCTMultilineTextInputViewManager

@end
-#endif

@implementation PasteTextInputManager {
NSHashTable<RCTBaseTextInputShadowView *> *_shadowViews;
36 changes: 0 additions & 36 deletions patches/@sentry+react-native+5.24.3.patch

This file was deleted.

Loading