Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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: 5 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ mise install # installs pinned Node, Yarn, and Ruby versions
| Command | Purpose |
|---|---|
| `yarn` | Install deps (Yarn 4.11.0, **npm won't work**) |
| `cd example && bundle install` | Install Ruby gems for the example app (CocoaPods version pinned in `example/Gemfile.lock`) |
| `cd example/ios && bundle exec pod install` | Install iOS pods for the example app |
| `yarn lint` | ESLint on `src/` + `example/` |
| `yarn expo-plugin lint` | ESLint on `plugin/` |
| `yarn typecheck` | tsc (root) |
Expand All @@ -46,6 +48,9 @@ CI runs: lint → typecheck → test → build-library → build-android → bui
## Key constraints

- **Only Yarn** (v4.11.0, nodeLinker: node-modules). Do not use npm.
- **CocoaPods only through Bundler** (`bundle exec pod …`), never a global `pod`: the version is pinned in
`example/Gemfile.lock` and must match the `COCOAPODS:` line of `example/ios/Podfile.lock`. The `Gemfile` follows the
React Native template (`xcodeproj < 1.26.0`), which caps CocoaPods at 1.15.x.
- **New architecture only** (Fabric, TurboModules). Old arch not supported since v3.0.0.
- `lib/` is gitignored (generated). After modifying source, run `yarn prepare` to rebuild.
- JS changes hot-reload in example app; native changes need `yarn example android` / `yarn example ios` rebuild.
Expand Down
7 changes: 4 additions & 3 deletions example/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ GEM
benchmark (0.2.1)
bigdecimal (3.1.3)
claide (1.1.0)
cocoapods (1.14.3)
cocoapods (1.15.2)
addressable (~> 2.8)
claide (>= 1.0.2, < 2.0)
cocoapods-core (= 1.14.3)
cocoapods-core (= 1.15.2)
cocoapods-deintegrate (>= 1.0.3, < 2.0)
cocoapods-downloader (>= 2.1, < 3.0)
cocoapods-plugins (>= 1.0.0, < 2.0)
Expand All @@ -39,7 +39,7 @@ GEM
nap (~> 1.0)
ruby-macho (>= 2.3.0, < 3.0)
xcodeproj (>= 1.23.0, < 2.0)
cocoapods-core (1.14.3)
cocoapods-core (1.15.2)
activesupport (>= 5.0, < 8)
addressable (~> 2.8)
algoliasearch (~> 1.0)
Expand Down Expand Up @@ -108,6 +108,7 @@ DEPENDENCIES
concurrent-ruby (< 1.3.4)
logger
mutex_m
nkf
xcodeproj (< 1.26.0)

RUBY VERSION
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; };
2A603DDB2D59212A00CE7330 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2A603DDA2D59212A00CE7330 /* AppDelegate.swift */; };
46F4B524B930F94B9315F63A /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = 1B92D7FA4703F1B0B676C06C /* PrivacyInfo.xcprivacy */; };
5CE0D0012E80000000A0B001 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5CE0D0002E80000000A0B001 /* SceneDelegate.swift */; };
81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */; };
/* End PBXBuildFile section */

Expand All @@ -23,6 +24,7 @@
2A603DDA2D59212A00CE7330 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = AppDelegate.swift; path = OrientationDirectorExample/AppDelegate.swift; sourceTree = "<group>"; };
3B4392A12AC88292D35C810B /* Pods-OrientationDirectorExample.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-OrientationDirectorExample.debug.xcconfig"; path = "Target Support Files/Pods-OrientationDirectorExample/Pods-OrientationDirectorExample.debug.xcconfig"; sourceTree = "<group>"; };
5709B34CF0A7D63546082F79 /* Pods-OrientationDirectorExample.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-OrientationDirectorExample.release.xcconfig"; path = "Target Support Files/Pods-OrientationDirectorExample/Pods-OrientationDirectorExample.release.xcconfig"; sourceTree = "<group>"; };
5CE0D0002E80000000A0B001 /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = SceneDelegate.swift; path = OrientationDirectorExample/SceneDelegate.swift; sourceTree = "<group>"; };
5DCACB8F33CDC322A6C60F78 /* libPods-OrientationDirectorExample.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-OrientationDirectorExample.a"; sourceTree = BUILT_PRODUCTS_DIR; };
81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = LaunchScreen.storyboard; path = OrientationDirectorExample/LaunchScreen.storyboard; sourceTree = "<group>"; };
ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; };
Expand All @@ -49,6 +51,7 @@
13B07FB81A68108700A75B9A /* PrivacyInfo.xcprivacy */,
1B92D7FA4703F1B0B676C06C /* PrivacyInfo.xcprivacy */,
2A603DDA2D59212A00CE7330 /* AppDelegate.swift */,
5CE0D0002E80000000A0B001 /* SceneDelegate.swift */,
);
name = OrientationDirectorExample;
sourceTree = "<group>";
Expand Down Expand Up @@ -249,6 +252,7 @@
buildActionMask = 2147483647;
files = (
2A603DDB2D59212A00CE7330 /* AppDelegate.swift in Sources */,
5CE0D0012E80000000A0B001 /* SceneDelegate.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -393,6 +397,7 @@
"$(inherited)",
" ",
);
PODFILE_DIR = "$(SRCROOT)";
REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native";
SDKROOT = iphoneos;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) DEBUG";
Expand Down Expand Up @@ -475,6 +480,7 @@
"$(inherited)",
" ",
);
PODFILE_DIR = "$(SRCROOT)";
REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native";
SDKROOT = iphoneos;
SWIFT_ENABLE_EXPLICIT_MODULES = NO;
Expand Down
12 changes: 3 additions & 9 deletions example/ios/OrientationDirectorExample/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ import OrientationDirector

@main
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
// Owned by SceneDelegate. Kept here because RN still reads
// `delegate.window` (e.g. RCTLogBoxView dealloc) — react/react-native#56571
@objc weak var window: UIWindow?

var reactNativeDelegate: ReactNativeDelegate?
var reactNativeFactory: RCTReactNativeFactory?
Expand All @@ -22,14 +24,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
reactNativeDelegate = delegate
reactNativeFactory = factory

window = UIWindow(frame: UIScreen.main.bounds)

factory.startReactNative(
withModuleName: "OrientationDirectorExample",
in: window,
launchOptions: launchOptions
)

return true
}

Expand Down
17 changes: 17 additions & 0 deletions example/ios/OrientationDirectorExample/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,23 @@
<array>
<string>arm64</string>
</array>
<key>UIApplicationSceneManifest</key>
<dict>
<key>UIApplicationSupportsMultipleScenes</key>
<false/>
<key>UISceneConfigurations</key>
<dict>
<key>UIWindowSceneSessionRoleApplication</key>
<array>
<dict>
<key>UISceneConfigurationName</key>
<string>Default Configuration</string>
<key>UISceneDelegateClassName</key>
<string>$(PRODUCT_MODULE_NAME).SceneDelegate</string>
</dict>
</array>
</dict>
</dict>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
Expand Down
29 changes: 29 additions & 0 deletions example/ios/OrientationDirectorExample/SceneDelegate.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import UIKit
import React_RCTAppDelegate

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 factory = appDelegate.reactNativeFactory
else {
return
}

let window = UIWindow(windowScene: windowScene)
self.window = window
appDelegate.window = window

factory.startReactNative(
withModuleName: "OrientationDirectorExample",
in: window,
launchOptions: nil
)
}
}
Loading
Loading