Skip to content

Commit 54ec59a

Browse files
committed
(WIP) feat: implement react-native template
1 parent 91ef0a9 commit 54ec59a

File tree

17 files changed

+1130
-4
lines changed

17 files changed

+1130
-4
lines changed

packages/react-native/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
2-
"name": "react-native",
2+
"name": "@callstack/react-native-visionos",
33
"version": "1000.0.0",
4-
"description": "A framework for building native apps using React",
4+
"description": "React Native for visionOS",
55
"license": "MIT",
66
"repository": {
77
"type": "git",
8-
"url": "https://github.com/facebook/react-native.git",
8+
"url": "https://github.com/callstack/react-native-visionos.git",
99
"directory": "packages/react-native"
1010
},
1111
"homepage": "https://reactnative.dev/",

packages/react-native/react-native.config.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@ module.exports = {
2626
startCommand,
2727
],
2828
platforms: {
29+
visionos: {
30+
npmPackageName: '@callstack/react-native-visionos',
31+
projectConfig: ios.projectConfig,
32+
dependencyConfig: ios.dependencyConfig,
33+
},
2934
ios: {
3035
projectConfig: ios.projectConfig,
3136
dependencyConfig: ios.dependencyConfig,

packages/react-native/template/_gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ yarn-error.log
5757

5858
# Ruby / CocoaPods
5959
/ios/Pods/
60+
/visionos/Pods/
6061
/vendor/bundle/
6162

6263
# Temporary files created by Metro to check the health of the file watcher

packages/react-native/template/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
},
1212
"dependencies": {
1313
"react": "18.2.0",
14-
"react-native": "1000.0.0"
14+
"@callstack/react-native-visionos": "1000.0.0"
1515
},
1616
"devDependencies": {
1717
"@babel/core": "^7.20.0",

packages/react-native/template/visionos/HelloWorld.xcodeproj/project.pbxproj

Lines changed: 686 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Scheme
3+
LastUpgradeVersion = "1210"
4+
version = "1.3">
5+
<BuildAction
6+
parallelizeBuildables = "YES"
7+
buildImplicitDependencies = "YES">
8+
<BuildActionEntries>
9+
<BuildActionEntry
10+
buildForTesting = "YES"
11+
buildForRunning = "YES"
12+
buildForProfiling = "YES"
13+
buildForArchiving = "YES"
14+
buildForAnalyzing = "YES">
15+
<BuildableReference
16+
BuildableIdentifier = "primary"
17+
BlueprintIdentifier = "13B07F861A680F5B00A75B9A"
18+
BuildableName = "HelloWorld.app"
19+
BlueprintName = "HelloWorld"
20+
ReferencedContainer = "container:HelloWorld.xcodeproj">
21+
</BuildableReference>
22+
</BuildActionEntry>
23+
</BuildActionEntries>
24+
</BuildAction>
25+
<TestAction
26+
buildConfiguration = "Debug"
27+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
28+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29+
shouldUseLaunchSchemeArgsEnv = "YES">
30+
<Testables>
31+
<TestableReference
32+
skipped = "NO">
33+
<BuildableReference
34+
BuildableIdentifier = "primary"
35+
BlueprintIdentifier = "00E356ED1AD99517003FC87E"
36+
BuildableName = "HelloWorldTests.xctest"
37+
BlueprintName = "HelloWorldTests"
38+
ReferencedContainer = "container:HelloWorld.xcodeproj">
39+
</BuildableReference>
40+
</TestableReference>
41+
</Testables>
42+
</TestAction>
43+
<LaunchAction
44+
buildConfiguration = "Debug"
45+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
46+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
47+
launchStyle = "0"
48+
useCustomWorkingDirectory = "NO"
49+
ignoresPersistentStateOnLaunch = "NO"
50+
debugDocumentVersioning = "YES"
51+
debugServiceExtension = "internal"
52+
allowLocationSimulation = "YES">
53+
<BuildableProductRunnable
54+
runnableDebuggingMode = "0">
55+
<BuildableReference
56+
BuildableIdentifier = "primary"
57+
BlueprintIdentifier = "13B07F861A680F5B00A75B9A"
58+
BuildableName = "HelloWorld.app"
59+
BlueprintName = "HelloWorld"
60+
ReferencedContainer = "container:HelloWorld.xcodeproj">
61+
</BuildableReference>
62+
</BuildableProductRunnable>
63+
</LaunchAction>
64+
<ProfileAction
65+
buildConfiguration = "Release"
66+
shouldUseLaunchSchemeArgsEnv = "YES"
67+
savedToolIdentifier = ""
68+
useCustomWorkingDirectory = "NO"
69+
debugDocumentVersioning = "YES">
70+
<BuildableProductRunnable
71+
runnableDebuggingMode = "0">
72+
<BuildableReference
73+
BuildableIdentifier = "primary"
74+
BlueprintIdentifier = "13B07F861A680F5B00A75B9A"
75+
BuildableName = "HelloWorld.app"
76+
BlueprintName = "HelloWorld"
77+
ReferencedContainer = "container:HelloWorld.xcodeproj">
78+
</BuildableReference>
79+
</BuildableProductRunnable>
80+
</ProfileAction>
81+
<AnalyzeAction
82+
buildConfiguration = "Debug">
83+
</AnalyzeAction>
84+
<ArchiveAction
85+
buildConfiguration = "Release"
86+
revealArchiveInOrganizer = "YES">
87+
</ArchiveAction>
88+
</Scheme>
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#import <RCTAppDelegate.h>
2+
#import <UIKit/UIKit.h>
3+
4+
@interface AppDelegate : RCTAppDelegate
5+
6+
@end
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#import "AppDelegate.h"
2+
3+
#import <React/RCTBundleURLProvider.h>
4+
5+
@implementation AppDelegate
6+
7+
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
8+
{
9+
self.moduleName = @"HelloWorld";
10+
// You can add your custom initial props in the dictionary below.
11+
// They will be passed down to the ViewController used by React Native.
12+
self.initialProps = @{};
13+
14+
return [super application:application didFinishLaunchingWithOptions:launchOptions];
15+
}
16+
17+
- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
18+
{
19+
return [self getBundleURL];
20+
}
21+
22+
- (NSURL *)getBundleURL
23+
{
24+
#if DEBUG
25+
return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index"];
26+
#else
27+
return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
28+
#endif
29+
}
30+
31+
@end
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
{
2+
"images" : [
3+
{
4+
"idiom" : "iphone",
5+
"scale" : "2x",
6+
"size" : "20x20"
7+
},
8+
{
9+
"idiom" : "iphone",
10+
"scale" : "3x",
11+
"size" : "20x20"
12+
},
13+
{
14+
"idiom" : "iphone",
15+
"scale" : "2x",
16+
"size" : "29x29"
17+
},
18+
{
19+
"idiom" : "iphone",
20+
"scale" : "3x",
21+
"size" : "29x29"
22+
},
23+
{
24+
"idiom" : "iphone",
25+
"scale" : "2x",
26+
"size" : "40x40"
27+
},
28+
{
29+
"idiom" : "iphone",
30+
"scale" : "3x",
31+
"size" : "40x40"
32+
},
33+
{
34+
"idiom" : "iphone",
35+
"scale" : "2x",
36+
"size" : "60x60"
37+
},
38+
{
39+
"idiom" : "iphone",
40+
"scale" : "3x",
41+
"size" : "60x60"
42+
},
43+
{
44+
"idiom" : "ios-marketing",
45+
"scale" : "1x",
46+
"size" : "1024x1024"
47+
}
48+
],
49+
"info" : {
50+
"author" : "xcode",
51+
"version" : 1
52+
}
53+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"info" : {
3+
"version" : 1,
4+
"author" : "xcode"
5+
}
6+
}
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>CFBundleDevelopmentRegion</key>
6+
<string>en</string>
7+
<key>CFBundleDisplayName</key>
8+
<string>Hello App Display Name</string>
9+
<key>CFBundleExecutable</key>
10+
<string>$(EXECUTABLE_NAME)</string>
11+
<key>CFBundleIdentifier</key>
12+
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
13+
<key>CFBundleInfoDictionaryVersion</key>
14+
<string>6.0</string>
15+
<key>CFBundleName</key>
16+
<string>$(PRODUCT_NAME)</string>
17+
<key>CFBundlePackageType</key>
18+
<string>APPL</string>
19+
<key>CFBundleShortVersionString</key>
20+
<string>$(MARKETING_VERSION)</string>
21+
<key>CFBundleSignature</key>
22+
<string>????</string>
23+
<key>CFBundleVersion</key>
24+
<string>$(CURRENT_PROJECT_VERSION)</string>
25+
<key>LSRequiresIPhoneOS</key>
26+
<true/>
27+
<key>NSAppTransportSecurity</key>
28+
<dict>
29+
<!-- Do not change NSAllowsArbitraryLoads to true, or you will risk app rejection! -->
30+
<key>NSAllowsArbitraryLoads</key>
31+
<false/>
32+
<key>NSAllowsLocalNetworking</key>
33+
<true/>
34+
</dict>
35+
<key>NSLocationWhenInUseUsageDescription</key>
36+
<string></string>
37+
<key>UILaunchStoryboardName</key>
38+
<string>LaunchScreen</string>
39+
<key>UIRequiredDeviceCapabilities</key>
40+
<array>
41+
<string>armv7</string>
42+
</array>
43+
<key>UISupportedInterfaceOrientations</key>
44+
<array>
45+
<string>UIInterfaceOrientationPortrait</string>
46+
<string>UIInterfaceOrientationLandscapeLeft</string>
47+
<string>UIInterfaceOrientationLandscapeRight</string>
48+
</array>
49+
<key>UIViewControllerBasedStatusBarAppearance</key>
50+
<false/>
51+
</dict>
52+
</plist>
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="15702" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
3+
<device id="retina4_7" orientation="portrait" appearance="light"/>
4+
<dependencies>
5+
<deployment identifier="iOS"/>
6+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15704"/>
7+
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
8+
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
9+
</dependencies>
10+
<scenes>
11+
<!--View Controller-->
12+
<scene sceneID="EHf-IW-A2E">
13+
<objects>
14+
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
15+
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
16+
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
17+
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
18+
<subviews>
19+
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="HelloWorld" textAlignment="center" lineBreakMode="middleTruncation" baselineAdjustment="alignBaselines" minimumFontSize="18" translatesAutoresizingMaskIntoConstraints="NO" id="GJd-Yh-RWb">
20+
<rect key="frame" x="0.0" y="202" width="375" height="43"/>
21+
<fontDescription key="fontDescription" type="boldSystem" pointSize="36"/>
22+
<nil key="highlightedColor"/>
23+
</label>
24+
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Powered by React Native" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="9" translatesAutoresizingMaskIntoConstraints="NO" id="MN2-I3-ftu">
25+
<rect key="frame" x="0.0" y="626" width="375" height="21"/>
26+
<fontDescription key="fontDescription" type="system" pointSize="17"/>
27+
<nil key="highlightedColor"/>
28+
</label>
29+
</subviews>
30+
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
31+
<constraints>
32+
<constraint firstItem="Bcu-3y-fUS" firstAttribute="bottom" secondItem="MN2-I3-ftu" secondAttribute="bottom" constant="20" id="OZV-Vh-mqD"/>
33+
<constraint firstItem="Bcu-3y-fUS" firstAttribute="centerX" secondItem="GJd-Yh-RWb" secondAttribute="centerX" id="Q3B-4B-g5h"/>
34+
<constraint firstItem="MN2-I3-ftu" firstAttribute="centerX" secondItem="Bcu-3y-fUS" secondAttribute="centerX" id="akx-eg-2ui"/>
35+
<constraint firstItem="MN2-I3-ftu" firstAttribute="leading" secondItem="Bcu-3y-fUS" secondAttribute="leading" id="i1E-0Y-4RG"/>
36+
<constraint firstItem="GJd-Yh-RWb" firstAttribute="centerY" secondItem="Ze5-6b-2t3" secondAttribute="bottom" multiplier="1/3" constant="1" id="moa-c2-u7t"/>
37+
<constraint firstItem="GJd-Yh-RWb" firstAttribute="leading" secondItem="Bcu-3y-fUS" secondAttribute="leading" symbolic="YES" id="x7j-FC-K8j"/>
38+
</constraints>
39+
<viewLayoutGuide key="safeArea" id="Bcu-3y-fUS"/>
40+
</view>
41+
</viewController>
42+
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
43+
</objects>
44+
<point key="canvasLocation" x="52.173913043478265" y="375"/>
45+
</scene>
46+
</scenes>
47+
</document>
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#import <UIKit/UIKit.h>
2+
3+
#import "AppDelegate.h"
4+
5+
int main(int argc, char *argv[])
6+
{
7+
@autoreleasepool {
8+
return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
9+
}
10+
}

0 commit comments

Comments
 (0)