feat(ios): jsi switch

This commit is contained in:
bennyzqliu
2022-01-10 17:39:40 +08:00
committed by luomy
parent 69a85e9cd1
commit a28dffe1cd
5 changed files with 99 additions and 3 deletions
@@ -610,6 +610,7 @@
F400C2E4274F6691008BD74B /* js_native_turbo_jsc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = js_native_turbo_jsc.h; sourceTree = "<group>"; };
F400C2E5274F66E3008BD74B /* js_native_turbo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = js_native_turbo.h; sourceTree = "<group>"; };
F400C2E6274F66ED008BD74B /* js_native_turbo.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = js_native_turbo.cc; sourceTree = "<group>"; };
B2C1237A278C0C140081B8AF /* DemoConfigs.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DemoConfigs.h; sourceTree = "<group>"; };
F40594982733C4A900157225 /* HippySRSIMDHelpers.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HippySRSIMDHelpers.m; sourceTree = "<group>"; };
F40594992733C4A900157225 /* HippySRSIMDHelpers.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HippySRSIMDHelpers.h; sourceTree = "<group>"; };
F40736CA275F5B79009890F2 /* HippyDomNodeUtils.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = HippyDomNodeUtils.h; sourceTree = "<group>"; };
@@ -756,6 +757,7 @@
0612F02823A8BE320079E622 /* ViewController.mm */,
0612F03223A8BE330079E622 /* Info.plist */,
0612F03323A8BE330079E622 /* main.m */,
B2C1237A278C0C140081B8AF /* DemoConfigs.h */,
);
path = HippyDemo;
sourceTree = "<group>";
@@ -0,0 +1,78 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1320"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "0612F01D23A8BE320079E622"
BuildableName = "HippyDemo.app"
BlueprintName = "HippyDemo"
ReferencedContainer = "container:HippyDemo.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "0612F01D23A8BE320079E622"
BuildableName = "HippyDemo.app"
BlueprintName = "HippyDemo"
ReferencedContainer = "container:HippyDemo.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "0612F01D23A8BE320079E622"
BuildableName = "HippyDemo.app"
BlueprintName = "HippyDemo"
ReferencedContainer = "container:HippyDemo.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
@@ -0,0 +1,14 @@
//
// DemoConfigs.h
// HippyDemo
//
// Created by bennyzqliu on 2022/1/10.
// Copyright © 2022 tencent. All rights reserved.
//
#ifndef DemoConfigs_h
#define DemoConfigs_h
#define DEMO_ENABLE_TURBO 1
#endif /* DemoConfigs_h */
@@ -29,6 +29,7 @@
#include "NativeRenderManager.h"
#include "dom/dom_node.h"
#include "dom/dom_value.h"
#import "DemoConfigs.h"
@interface ViewController ()<HippyBridgeDelegate> {
std::shared_ptr<hippy::DomManager> _domManager;
@@ -60,7 +61,7 @@
//#define HIPPYDEBUG
#ifdef HIPPYDEBUG
NSDictionary *launchOptions = @{@"EnableTurbo": @YES, @"DebugMode": @(YES)};
NSDictionary *launchOptions = @{@"EnableTurbo": @(DEMO_ENABLE_TURBO), @"DebugMode": @(YES)};
NSString *localhost = [HippyBundleURLProvider sharedInstance].localhost ?: @"localhost:38989";
NSString *bundleStr = [NSString stringWithFormat:@"http://%@%@", localhost, [HippyBundleURLProvider sharedInstance].debugPathUrl];
NSURL *bundleUrl = [NSURL URLWithString:bundleStr];
@@ -73,7 +74,7 @@
#else
NSString *commonBundlePath = [[NSBundle mainBundle] pathForResource:@"vendor.ios" ofType:@"js" inDirectory:@"res"];
NSString *businessBundlePath = [[NSBundle mainBundle] pathForResource:@"index.ios" ofType:@"js" inDirectory:@"res"];
NSDictionary *launchOptions = @{@"EnableTurbo": @YES};
NSDictionary *launchOptions = @{@"EnableTurbo": @(DEMO_ENABLE_TURBO)};
HippyBridge *bridge = [[HippyBridge alloc] initWithDelegate:self
bundleURL:[NSURL fileURLWithPath:commonBundlePath]
moduleProvider:nil
+2 -1
View File
@@ -40,7 +40,7 @@
#import "UIView+Hippy.h"
#import "HippyBridge+Mtt.h"
#import "HippyBundleURLProvider.h"
#import "core/scope.h"
#import "DemoConfigs.h"
NSString *const HippyContentDidAppearNotification = @"HippyContentDidAppearNotification";
@@ -141,6 +141,7 @@ NSString *const HippyContentDidAppearNotification = @"HippyContentDidAppearNotif
NSMutableDictionary *extendsLaunchOptions = [NSMutableDictionary new];
[extendsLaunchOptions addEntriesFromDictionary:launchOptions];
[extendsLaunchOptions setObject:@(mode) forKey:@"DebugMode"];
[extendsLaunchOptions setObject:@(DEMO_ENABLE_TURBO) forKey:@"EnableTurbo"];
HippyBridge *bridge = [[HippyBridge alloc] initWithBundleURL:bundleURL moduleProvider:nil launchOptions:extendsLaunchOptions
executorKey:moduleName];
return [self initWithBridge:bridge moduleName:moduleName initialProperties:initialProperties shareOptions:shareOptions delegate:delegate];