Update Expo iOS tooling and native glass header
This commit is contained in:
1 parent
8351e7ca31
commit
babbf90197
8 files changed
+547
-330
No files matched your search
@@ -163,6 +163,7 @@ const config: ExpoConfig = {
|
||||
],
|
||||
},
|
||||
],
|
||||
"./plugins/withIosSceneLifecycle.cjs",
|
||||
"./plugins/withAndroidCleartextTraffic.cjs",
|
||||
],
|
||||
extra: {
|
||||
|
||||
+20
-19
@@ -43,7 +43,8 @@
|
||||
"@clerk/expo": "catalog:",
|
||||
"@effect/atom-react": "catalog:",
|
||||
"@expo-google-fonts/dm-sans": "^0.4.2",
|
||||
"@expo/ui": "~56.0.8",
|
||||
"@expo/metro-runtime": "~56.0.15",
|
||||
"@expo/ui": "~56.0.18",
|
||||
"@legendapp/list": "3.2.0",
|
||||
"@noble/curves": "catalog:",
|
||||
"@noble/hashes": "catalog:",
|
||||
@@ -62,38 +63,38 @@
|
||||
"clsx": "^2.1.1",
|
||||
"diff": "8.0.3",
|
||||
"effect": "catalog:",
|
||||
"expo": "^56.0.0",
|
||||
"expo-asset": "~56.0.15",
|
||||
"expo-auth-session": "~56.0.12",
|
||||
"expo-build-properties": "~56.0.15",
|
||||
"expo-camera": "~56.0.7",
|
||||
"expo-clipboard": "~56.0.3",
|
||||
"expo-constants": "~56.0.16",
|
||||
"expo": "~56.0.12",
|
||||
"expo-asset": "~56.0.17",
|
||||
"expo-auth-session": "~56.0.14",
|
||||
"expo-build-properties": "~56.0.19",
|
||||
"expo-camera": "~56.0.8",
|
||||
"expo-clipboard": "~56.0.4",
|
||||
"expo-constants": "~56.0.18",
|
||||
"expo-crypto": "~56.0.4",
|
||||
"expo-dev-client": "~56.0.16",
|
||||
"expo-file-system": "~56.0.7",
|
||||
"expo-font": "~56.0.5",
|
||||
"expo-dev-client": "~56.0.20",
|
||||
"expo-file-system": "~56.0.8",
|
||||
"expo-font": "~56.0.7",
|
||||
"expo-glass-effect": "~56.0.4",
|
||||
"expo-haptics": "~56.0.3",
|
||||
"expo-image-picker": "~56.0.14",
|
||||
"expo-linking": "~56.0.12",
|
||||
"expo-image-picker": "~56.0.18",
|
||||
"expo-linking": "~56.0.14",
|
||||
"expo-network": "~56.0.5",
|
||||
"expo-notifications": "~56.0.14",
|
||||
"expo-notifications": "~56.0.18",
|
||||
"expo-paste-input": "^0.1.15",
|
||||
"expo-router": "~56.2.7",
|
||||
"expo-router": "~56.2.11",
|
||||
"expo-secure-store": "~56.0.4",
|
||||
"expo-splash-screen": "~56.0.10",
|
||||
"expo-symbols": "~56.0.5",
|
||||
"expo-updates": "~56.0.17",
|
||||
"expo-symbols": "~56.0.6",
|
||||
"expo-updates": "~56.0.19",
|
||||
"expo-web-browser": "~56.0.5",
|
||||
"expo-widgets": "~56.0.15",
|
||||
"expo-widgets": "~56.0.19",
|
||||
"punycode": "^2.3.1",
|
||||
"react": "19.2.3",
|
||||
"react-dom": "19.2.3",
|
||||
"react-native": "0.85.3",
|
||||
"react-native-gesture-handler": "~2.31.1",
|
||||
"react-native-image-viewing": "^0.2.2",
|
||||
"react-native-keyboard-controller": "1.21.7",
|
||||
"react-native-keyboard-controller": "1.21.6",
|
||||
"react-native-nitro-markdown": "^0.5.0",
|
||||
"react-native-nitro-modules": "0.35.9",
|
||||
"react-native-reanimated": "4.3.1",
|
||||
|
||||
@@ -0,0 +1,81 @@
|
||||
const { withAppDelegate, withInfoPlist } = require("expo/config-plugins");
|
||||
|
||||
const SCENE_DELEGATE = `
|
||||
|
||||
class SceneDelegate: UIResponder, UIWindowSceneDelegate {
|
||||
var window: UIWindow?
|
||||
|
||||
func scene(
|
||||
_ scene: UIScene,
|
||||
willConnectTo session: UISceneSession,
|
||||
options connectionOptions: UIScene.ConnectionOptions
|
||||
) {
|
||||
guard
|
||||
let windowScene = scene as? UIWindowScene,
|
||||
let appDelegate = UIApplication.shared.delegate as? AppDelegate,
|
||||
let appWindow = appDelegate.window
|
||||
else {
|
||||
return
|
||||
}
|
||||
|
||||
window = appWindow
|
||||
appWindow.windowScene = windowScene
|
||||
appWindow.makeKeyAndVisible()
|
||||
|
||||
if let url = connectionOptions.urlContexts.first?.url {
|
||||
_ = appDelegate.application(UIApplication.shared, open: url, options: [:])
|
||||
}
|
||||
}
|
||||
|
||||
func scene(_ scene: UIScene, openURLContexts URLContexts: Set<UIOpenURLContext>) {
|
||||
guard
|
||||
let url = URLContexts.first?.url,
|
||||
let appDelegate = UIApplication.shared.delegate as? AppDelegate
|
||||
else {
|
||||
return
|
||||
}
|
||||
|
||||
_ = appDelegate.application(UIApplication.shared, open: url, options: [:])
|
||||
}
|
||||
|
||||
func scene(_ scene: UIScene, continue userActivity: NSUserActivity) {
|
||||
guard let appDelegate = UIApplication.shared.delegate as? AppDelegate else {
|
||||
return
|
||||
}
|
||||
|
||||
_ = appDelegate.application(
|
||||
UIApplication.shared,
|
||||
continue: userActivity,
|
||||
restorationHandler: { _ in })
|
||||
}
|
||||
}`;
|
||||
|
||||
module.exports = function withIosSceneLifecycle(config) {
|
||||
config = withInfoPlist(config, (nextConfig) => {
|
||||
nextConfig.modResults.UIApplicationSceneManifest = {
|
||||
UIApplicationSupportsMultipleScenes: false,
|
||||
UISceneConfigurations: {
|
||||
UIWindowSceneSessionRoleApplication: [
|
||||
{
|
||||
UISceneConfigurationName: "Default Configuration",
|
||||
UISceneDelegateClassName: "$(PRODUCT_MODULE_NAME).SceneDelegate",
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
|
||||
return nextConfig;
|
||||
});
|
||||
|
||||
return withAppDelegate(config, (nextConfig) => {
|
||||
if (nextConfig.modResults.language !== "swift") {
|
||||
throw new Error("The iOS scene lifecycle plugin requires a Swift AppDelegate.");
|
||||
}
|
||||
|
||||
if (!nextConfig.modResults.contents.includes("class SceneDelegate:")) {
|
||||
nextConfig.modResults.contents += SCENE_DELEGATE;
|
||||
}
|
||||
|
||||
return nextConfig;
|
||||
});
|
||||
};
|
||||
@@ -570,8 +570,10 @@ function ThreadRouteContent(
|
||||
options={{
|
||||
headerShown: true,
|
||||
headerTransparent: USES_NATIVE_GLASS_HEADER,
|
||||
headerBlurEffect: USES_NATIVE_GLASS_HEADER ? "systemThinMaterial" : undefined,
|
||||
headerShadowVisible: false,
|
||||
...(USES_NATIVE_GLASS_HEADER
|
||||
? {}
|
||||
? { headerStyle: { backgroundColor: "transparent" } }
|
||||
: {
|
||||
headerStyle: { backgroundColor: "transparent" },
|
||||
headerShadowVisible: false,
|
||||
@@ -580,10 +582,10 @@ function ThreadRouteContent(
|
||||
headerBackVisible: !layout.usesSplitView,
|
||||
headerBackTitle: "",
|
||||
scrollEdgeEffects: {
|
||||
// iOS 27 beta currently renders automatic/soft as transparent.
|
||||
// Keep UIKit's subtler automatic style on iOS 26 and use its
|
||||
// native hard edge treatment on iOS 27+.
|
||||
top: TOP_SCROLL_EDGE_EFFECT,
|
||||
// The native header material handles the effect on iOS 27 because
|
||||
// this virtualized list is not discoverable by the stack's native
|
||||
// first-descendant scroll-view lookup.
|
||||
top: USES_NATIVE_GLASS_HEADER ? "hidden" : TOP_SCROLL_EDGE_EFFECT,
|
||||
bottom: "hidden",
|
||||
left: "hidden",
|
||||
right: "hidden",
|
||||
|
||||
File renamed without changes.
@@ -0,0 +1,21 @@
|
||||
diff --git a/apple/Sources/ExpoModulesJSI/Runtime/JavaScriptRuntime.swift b/apple/Sources/ExpoModulesJSI/Runtime/JavaScriptRuntime.swift
|
||||
index a0e3e24d6070c5ec0a220af3cb56fe3373fe1968..d610cc38dd8dee363ea2f1822aea0c4a492cf825 100644
|
||||
--- a/apple/Sources/ExpoModulesJSI/Runtime/JavaScriptRuntime.swift
|
||||
+++ b/apple/Sources/ExpoModulesJSI/Runtime/JavaScriptRuntime.swift
|
||||
@@ -215,8 +215,15 @@ open class JavaScriptRuntime: Equatable, @unchecked Sendable {
|
||||
.toOpaque()
|
||||
// Pass a null setter to C++ when the Swift setter is nil so that JS assignment
|
||||
// raises a `jsi::JSError` directly, without crossing the Swift boundary.
|
||||
+ if set == nil {
|
||||
+ let callbacks = expo.HostObjectCallbacks(
|
||||
+ context, getter, nil, propertyNamesGetter, deallocate)
|
||||
+ let hostObject = expo.HostObject.makeObject(pointee, consume callbacks)
|
||||
+
|
||||
+ return JavaScriptObject(self, hostObject)
|
||||
+ }
|
||||
let callbacks = expo.HostObjectCallbacks(
|
||||
- context, getter, set == nil ? nil : setter, propertyNamesGetter, deallocate)
|
||||
+ context, getter, setter, propertyNamesGetter, deallocate)
|
||||
let hostObject = expo.HostObject.makeObject(pointee, consume callbacks)
|
||||
|
||||
return JavaScriptObject(self, hostObject)
|
||||
Generated
+414
-304
File diff suppressed because it is too large.
Load diff
+3
-2
@@ -71,7 +71,7 @@ overrides:
|
||||
# @effect/vitest is patched to use vite-plus/test; do not auto-install its
|
||||
# upstream Vitest peer and create a second Vite/Vitest toolchain.
|
||||
"@effect/vitest>vitest": "-"
|
||||
"@expo/metro-config": 56.0.13
|
||||
"@expo/metro-config": 56.0.14
|
||||
"@pierre/diffs>@shikijs/transformers": ^4.2.0
|
||||
"@types/node": "catalog:"
|
||||
effect: "catalog:"
|
||||
@@ -91,10 +91,11 @@ packageExtensions:
|
||||
|
||||
patchedDependencies:
|
||||
"@effect/[email protected]": patches/@[email protected]
|
||||
"@expo/[email protected]3": patches/@expo%[email protected]3.patch
|
||||
"@expo/[email protected]4": patches/@expo%[email protected]4.patch
|
||||
"@ff-labs/[email protected]": patches/@[email protected]
|
||||
"@pierre/[email protected]": patches/@pierre%[email protected]
|
||||
[email protected]: patches/[email protected]
|
||||
[email protected]: patches/[email protected]
|
||||
[email protected]: patches/[email protected]
|
||||
|
||||
peerDependencyRules:
|
||||
|
||||
Reference in new issue
Block a user