Skip to content

Commit

Permalink
Add initializers to make the RC8 changes not breaking
Browse files Browse the repository at this point in the history
  • Loading branch information
cipolleschi committed Apr 10, 2024
1 parent cb2d93e commit 7b47ef5
Show file tree
Hide file tree
Showing 13 changed files with 116 additions and 76 deletions.
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
//localhost:4873/:_authToken=secretToken
22 changes: 5 additions & 17 deletions packages/community-cli-plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@
"name": "@react-native/community-cli-plugin",
"version": "0.74.78",
"description": "Core CLI commands for React Native",
"keywords": [
"react-native",
"tools"
],
"keywords": ["react-native", "tools"],
"homepage": "https://github.com/facebook/react-native/tree/HEAD/packages/community-cli-plugin#readme",
"bugs": "https://github.com/facebook/react-native/issues",
"repository": {
Expand All @@ -14,13 +11,8 @@
"directory": "packages/community-cli-plugin"
},
"license": "MIT",
"exports": {
".": "./src/index.js",
"./package.json": "./package.json"
},
"files": [
"dist"
],
"exports": { ".": "./dist/index.js", "./package.json": "./package.json" },
"files": ["dist"],
"dependencies": {
"@react-native-community/cli-server-api": "13.6.4",
"@react-native-community/cli-tools": "13.6.4",
Expand All @@ -35,10 +27,6 @@
"querystring": "^0.2.1",
"readline": "^1.3.0"
},
"devDependencies": {
"metro-resolver": "^0.80.3"
},
"engines": {
"node": ">=18"
}
"devDependencies": { "metro-resolver": "^0.80.3" },
"engines": { "node": ">=18" }
}
18 changes: 4 additions & 14 deletions packages/dev-middleware/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@
"name": "@react-native/dev-middleware",
"version": "0.74.78",
"description": "Dev server middleware for React Native",
"keywords": [
"react-native",
"tools"
],
"keywords": ["react-native", "tools"],
"homepage": "https://github.com/facebook/react-native/tree/HEAD/packages/dev-middleware#readme",
"bugs": "https://github.com/facebook/react-native/issues",
"repository": {
Expand All @@ -14,13 +11,8 @@
"directory": "packages/dev-middleware"
},
"license": "MIT",
"exports": {
".": "./src/index.js",
"./package.json": "./package.json"
},
"files": [
"dist"
],
"exports": { ".": "./dist/index.js", "./package.json": "./package.json" },
"files": ["dist"],
"dependencies": {
"@isaacs/ttlcache": "^1.4.1",
"@react-native/debugger-frontend": "0.74.78",
Expand All @@ -36,9 +28,7 @@
"temp-dir": "^2.0.0",
"ws": "^6.2.2"
},
"engines": {
"node": ">=18"
},
"engines": { "node": ">=18" },
"devDependencies": {
"data-uri-to-buffer": "^6.0.1",
"undici": "^5.27.2",
Expand Down
19 changes: 4 additions & 15 deletions packages/metro-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,11 @@
"directory": "packages/metro-config"
},
"homepage": "https://github.com/facebook/react-native/tree/HEAD/packages/metro-config#readme",
"keywords": [
"metro",
"config",
"react-native"
],
"keywords": ["metro", "config", "react-native"],
"bugs": "https://github.com/facebook/react-native/issues",
"engines": {
"node": ">=18"
},
"exports": {
".": "./src/index.js",
"./package.json": "./package.json"
},
"files": [
"dist"
],
"engines": { "node": ">=18" },
"exports": { ".": "./dist/index.js", "./package.json": "./package.json" },
"files": ["dist"],
"dependencies": {
"@react-native/js-polyfills": "0.74.78",
"@react-native/metro-babel-transformer": "0.74.78",
Expand Down
8 changes: 8 additions & 0 deletions packages/react-native/React/Base/RCTBridgeProxy.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,14 @@ NS_ASSUME_NONNULL_BEGIN

@interface RCTBridgeProxy : NSProxy

- (instancetype)initWithViewRegistry:(RCTViewRegistry *)viewRegistry
moduleRegistry:(RCTModuleRegistry *)moduleRegistry
bundleManager:(RCTBundleManager *)bundleManager
callableJSModules:(RCTCallableJSModules *)callableJSModules
dispatchToJSThread:(void (^)(dispatch_block_t))dispatchToJSThread
registerSegmentWithId:(void (^)(NSNumber *, NSString *))registerSegmentWithId
runtime:(void *)runtime __deprecated;

- (instancetype)initWithViewRegistry:(RCTViewRegistry *)viewRegistry
moduleRegistry:(RCTModuleRegistry *)moduleRegistry
bundleManager:(RCTBundleManager *)bundleManager
Expand Down
18 changes: 18 additions & 0 deletions packages/react-native/React/Base/RCTBridgeProxy.mm
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,24 @@ @implementation RCTBridgeProxy {
void *_runtime;
}

- (instancetype)initWithViewRegistry:(RCTViewRegistry *)viewRegistry
moduleRegistry:(RCTModuleRegistry *)moduleRegistry
bundleManager:(RCTBundleManager *)bundleManager
callableJSModules:(RCTCallableJSModules *)callableJSModules
dispatchToJSThread:(void (^)(dispatch_block_t))dispatchToJSThread
registerSegmentWithId:(void (^)(NSNumber *, NSString *))registerSegmentWithId
runtime:(void *)runtime
{
return [self initWithViewRegistry:viewRegistry
moduleRegistry:moduleRegistry
bundleManager:bundleManager
callableJSModules:callableJSModules
dispatchToJSThread:dispatchToJSThread
registerSegmentWithId:registerSegmentWithId
runtime:runtime
launchOptions:@{}];
}

- (instancetype)initWithViewRegistry:(RCTViewRegistry *)viewRegistry
moduleRegistry:(RCTModuleRegistry *)moduleRegistry
bundleManager:(RCTBundleManager *)bundleManager
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@ typedef std::shared_ptr<facebook::react::JSRuntimeFactory> (^RCTHostJSEngineProv
jsEngineProvider:(RCTHostJSEngineProvider)jsEngineProvider
launchOptions:(nullable NSDictionary *)launchOptions __deprecated;

- (instancetype)initWithBundleURL:(NSURL *)bundleURL
hostDelegate:(id<RCTHostDelegate>)hostDelegate
turboModuleManagerDelegate:(id<RCTTurboModuleManagerDelegate>)turboModuleManagerDelegate
jsEngineProvider:(RCTHostJSEngineProvider)jsEngineProvider __deprecated;

@property (nonatomic, weak, nullable) id<RCTHostRuntimeDelegate> runtimeDelegate;

@property (nonatomic, readonly) RCTSurfacePresenter *surfacePresenter;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,21 @@ + (void)initialize
_RCTInitializeJSThreadConstantInternal();
}

- (instancetype)initWithBundleURL:(NSURL *)bundleURL
hostDelegate:(id<RCTHostDelegate>)hostDelegate
turboModuleManagerDelegate:(id<RCTTurboModuleManagerDelegate>)turboModuleManagerDelegate
jsEngineProvider:(RCTHostJSEngineProvider)jsEngineProvider
{
return [self
initWithBundleURLProvider:^{
return bundleURL;
}
hostDelegate:hostDelegate
turboModuleManagerDelegate:turboModuleManagerDelegate
jsEngineProvider:jsEngineProvider
launchOptions:@{}];
}

- (instancetype)initWithBundleURL:(NSURL *)bundleURL
hostDelegate:(id<RCTHostDelegate>)hostDelegate
turboModuleManagerDelegate:(id<RCTTurboModuleManagerDelegate>)turboModuleManagerDelegate
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,22 @@ typedef void (^_Null_unspecified RCTInstanceInitialBundleLoadCompletionBlock)();
*/
@interface RCTInstance : NSObject

- (instancetype)initWithDelegate:(id<RCTInstanceDelegate>)delegate
jsRuntimeFactory:(std::shared_ptr<facebook::react::JSRuntimeFactory>)jsRuntimeFactory
bundleManager:(RCTBundleManager *)bundleManager
turboModuleManagerDelegate:(id<RCTTurboModuleManagerDelegate>)turboModuleManagerDelegate
onInitialBundleLoad:(RCTInstanceInitialBundleLoadCompletionBlock)onInitialBundleLoad
moduleRegistry:(RCTModuleRegistry *)moduleRegistry
parentInspectorTarget:(facebook::react::jsinspector_modern::PageTarget *)parentInspectorTarget __deprecated;

- (instancetype)initWithDelegate:(id<RCTInstanceDelegate>)delegate
jsRuntimeFactory:(std::shared_ptr<facebook::react::JSRuntimeFactory>)jsRuntimeFactory
bundleManager:(RCTBundleManager *)bundleManager
turboModuleManagerDelegate:(id<RCTTurboModuleManagerDelegate>)turboModuleManagerDelegate
onInitialBundleLoad:(RCTInstanceInitialBundleLoadCompletionBlock)onInitialBundleLoad
moduleRegistry:(RCTModuleRegistry *)moduleRegistry
parentInspectorTarget:(facebook::react::jsinspector_modern::PageTarget *)parentInspectorTarget
launchOptions:(nullable NSDictionary *)launchOptions;
launchOptions:(nullable NSDictionary *)launchOptions NS_DESIGNATED_INITIALIZER;

- (void)callFunctionOnJSModule:(NSString *)moduleName method:(NSString *)method args:(NSArray *)args;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,24 @@ @implementation RCTInstance {

#pragma mark - Public

- (instancetype)initWithDelegate:(id<RCTInstanceDelegate>)delegate
jsRuntimeFactory:(std::shared_ptr<facebook::react::JSRuntimeFactory>)jsRuntimeFactory
bundleManager:(RCTBundleManager *)bundleManager
turboModuleManagerDelegate:(id<RCTTurboModuleManagerDelegate>)turboModuleManagerDelegate
onInitialBundleLoad:(RCTInstanceInitialBundleLoadCompletionBlock)onInitialBundleLoad
moduleRegistry:(RCTModuleRegistry *)moduleRegistry
parentInspectorTarget:(facebook::react::jsinspector_modern::PageTarget *)parentInspectorTarget
{
return [self initWithDelegate:delegate
jsRuntimeFactory:jsRuntimeFactory
bundleManager:bundleManager
turboModuleManagerDelegate:turboModuleManagerDelegate
onInitialBundleLoad:onInitialBundleLoad
moduleRegistry:moduleRegistry
parentInspectorTarget:parentInspectorTarget
launchOptions:@{}];
}

- (instancetype)initWithDelegate:(id<RCTInstanceDelegate>)delegate
jsRuntimeFactory:(std::shared_ptr<facebook::react::JSRuntimeFactory>)jsRuntimeFactory
bundleManager:(RCTBundleManager *)bundleManager
Expand Down
Binary file not shown.
2 changes: 1 addition & 1 deletion packages/react-native/template/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
},
"dependencies": {
"react": "18.2.0",
"react-native": "0.74.0-rc.7"
"react-native": "file:///Users/cipolleschi/Official/react-native/packages/react-native/react-native-1000.0.0-cb2d93ea5.tgz"
},
"devDependencies": {
"@babel/core": "^7.20.0",
Expand Down
56 changes: 28 additions & 28 deletions packages/rn-tester/RNTesterPods.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -375,8 +375,8 @@
13B07F8E1A680F5B00A75B9A /* Resources */,
68CD48B71D2BCB2C007E06A9 /* Build JS Bundle */,
79E8BE2B119D4C5CCD2F04B3 /* [RN] Copy Hermes Framework */,
A41785EFA563389E1508FB58 /* [CP] Embed Pods Frameworks */,
5E028B80F3C32FE3D52DF9A7 /* [CP] Copy Pods Resources */,
3B576E60C9D1854D1423F203 /* [CP] Embed Pods Frameworks */,
);
buildRules = (
);
Expand All @@ -395,8 +395,8 @@
E7DB209B22B2BA84005AC45F /* Sources */,
E7DB209C22B2BA84005AC45F /* Frameworks */,
E7DB209D22B2BA84005AC45F /* Resources */,
3FA5A4AA0B18E37634BDB153 /* [CP] Embed Pods Frameworks */,
829D7C63C528493FD8CA45E9 /* [CP] Copy Pods Resources */,
943145340CE6DACC96B61E69 /* [CP] Embed Pods Frameworks */,
);
buildRules = (
);
Expand All @@ -416,8 +416,8 @@
E7DB214F22B2F332005AC45F /* Sources */,
E7DB215022B2F332005AC45F /* Frameworks */,
E7DB215122B2F332005AC45F /* Resources */,
659CD3193D6E6ED5B92470CE /* [CP] Embed Pods Frameworks */,
C5A1A0DE195B37E2DE72DBE8 /* [CP] Copy Pods Resources */,
A2B1F303B66EA7596F4151BC /* [CP] Embed Pods Frameworks */,
);
buildRules = (
);
Expand Down Expand Up @@ -521,21 +521,21 @@
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
3FA5A4AA0B18E37634BDB153 /* [CP] Embed Pods Frameworks */ = {
3B576E60C9D1854D1423F203 /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-RNTesterUnitTests/Pods-RNTesterUnitTests-frameworks-${CONFIGURATION}-input-files.xcfilelist",
"${PODS_ROOT}/Target Support Files/Pods-RNTester/Pods-RNTester-frameworks-${CONFIGURATION}-input-files.xcfilelist",
);
name = "[CP] Embed Pods Frameworks";
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-RNTesterUnitTests/Pods-RNTesterUnitTests-frameworks-${CONFIGURATION}-output-files.xcfilelist",
"${PODS_ROOT}/Target Support Files/Pods-RNTester/Pods-RNTester-frameworks-${CONFIGURATION}-output-files.xcfilelist",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-RNTesterUnitTests/Pods-RNTesterUnitTests-frameworks.sh\"\n";
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-RNTester/Pods-RNTester-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
5E028B80F3C32FE3D52DF9A7 /* [CP] Copy Pods Resources */ = {
Expand All @@ -555,23 +555,6 @@
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-RNTester/Pods-RNTester-resources.sh\"\n";
showEnvVarsInLog = 0;
};
659CD3193D6E6ED5B92470CE /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-RNTesterIntegrationTests/Pods-RNTesterIntegrationTests-frameworks-${CONFIGURATION}-input-files.xcfilelist",
);
name = "[CP] Embed Pods Frameworks";
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-RNTesterIntegrationTests/Pods-RNTesterIntegrationTests-frameworks-${CONFIGURATION}-output-files.xcfilelist",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-RNTesterIntegrationTests/Pods-RNTesterIntegrationTests-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
68CD48B71D2BCB2C007E06A9 /* Build JS Bundle */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
Expand Down Expand Up @@ -645,6 +628,23 @@
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
943145340CE6DACC96B61E69 /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-RNTesterUnitTests/Pods-RNTesterUnitTests-frameworks-${CONFIGURATION}-input-files.xcfilelist",
);
name = "[CP] Embed Pods Frameworks";
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-RNTesterUnitTests/Pods-RNTesterUnitTests-frameworks-${CONFIGURATION}-output-files.xcfilelist",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-RNTesterUnitTests/Pods-RNTesterUnitTests-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
9E05A96E88B51366B482536F /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
Expand All @@ -667,21 +667,21 @@
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
A41785EFA563389E1508FB58 /* [CP] Embed Pods Frameworks */ = {
A2B1F303B66EA7596F4151BC /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-RNTester/Pods-RNTester-frameworks-${CONFIGURATION}-input-files.xcfilelist",
"${PODS_ROOT}/Target Support Files/Pods-RNTesterIntegrationTests/Pods-RNTesterIntegrationTests-frameworks-${CONFIGURATION}-input-files.xcfilelist",
);
name = "[CP] Embed Pods Frameworks";
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-RNTester/Pods-RNTester-frameworks-${CONFIGURATION}-output-files.xcfilelist",
"${PODS_ROOT}/Target Support Files/Pods-RNTesterIntegrationTests/Pods-RNTesterIntegrationTests-frameworks-${CONFIGURATION}-output-files.xcfilelist",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-RNTester/Pods-RNTester-frameworks.sh\"\n";
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-RNTesterIntegrationTests/Pods-RNTesterIntegrationTests-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
C5A1A0DE195B37E2DE72DBE8 /* [CP] Copy Pods Resources */ = {
Expand Down

0 comments on commit 7b47ef5

Please sign in to comment.