mirror of
				https://gitcode.com/gh_mirrors/re/react-native-pushy.git
				synced 2025-10-31 21:33:12 +08:00 
			
		
		
		
	support to harmony local debug mode (#493)
* support to Expo * update * update * update * support to harmony local debug * udpate * update --------- Co-authored-by: Steven <steven@Stevens-MacBook-Pro.local>
This commit is contained in:
		| @@ -0,0 +1,65 @@ | ||||
| /** | ||||
|  * This code was generated by "react-native codegen-harmony" | ||||
|  * | ||||
|  * Do not edit this file as changes may cause incorrect behavior and will be | ||||
|  * lost once the code is regenerated. | ||||
|  * | ||||
|  * @generatorVersion: 1 | ||||
|  */ | ||||
|  | ||||
| #pragma once | ||||
|  | ||||
| #include "RNOH/Package.h" | ||||
| #include "RNOH/ArkTSTurboModule.h" | ||||
|  | ||||
| namespace rnoh { | ||||
|  | ||||
| class RNOHGeneratedPackageTurboModuleFactoryDelegate : public TurboModuleFactoryDelegate { | ||||
|   public: | ||||
|     SharedTurboModule createTurboModule(Context ctx, const std::string &name) const override { | ||||
|         return nullptr; | ||||
|     }; | ||||
| }; | ||||
|  | ||||
| class GeneratedEventEmitRequestHandler : public EventEmitRequestHandler { | ||||
|   public: | ||||
|     void handleEvent(Context const &ctx) override { | ||||
|         auto eventEmitter = ctx.shadowViewRegistry->getEventEmitter<facebook::react::EventEmitter>(ctx.tag); | ||||
|         if (eventEmitter == nullptr) { | ||||
|             return; | ||||
|         } | ||||
|  | ||||
|         std::vector<std::string> supportedEventNames = { | ||||
|         }; | ||||
|         if (std::find(supportedEventNames.begin(), supportedEventNames.end(), ctx.eventName) != supportedEventNames.end()) { | ||||
|             eventEmitter->dispatchEvent(ctx.eventName, ArkJS(ctx.env).getDynamic(ctx.payload)); | ||||
|         }     | ||||
|     } | ||||
| }; | ||||
|  | ||||
| class RNOHGeneratedPackage : public Package { | ||||
|   public: | ||||
|     RNOHGeneratedPackage(Package::Context ctx) : Package(ctx){}; | ||||
|  | ||||
|     std::unique_ptr<TurboModuleFactoryDelegate> createTurboModuleFactoryDelegate() override { | ||||
|         return std::make_unique<RNOHGeneratedPackageTurboModuleFactoryDelegate>(); | ||||
|     } | ||||
|  | ||||
|     std::vector<facebook::react::ComponentDescriptorProvider> createComponentDescriptorProviders() override { | ||||
|         return { | ||||
|         }; | ||||
|     } | ||||
|  | ||||
|     ComponentJSIBinderByString createComponentJSIBinderByName() override { | ||||
|         return { | ||||
|         }; | ||||
|     }; | ||||
|  | ||||
|     EventEmitRequestHandlers createEventEmitRequestHandlers() override { | ||||
|         return { | ||||
|             std::make_shared<GeneratedEventEmitRequestHandler>(), | ||||
|         }; | ||||
|     } | ||||
| }; | ||||
|  | ||||
| } // namespace rnoh | ||||
| @@ -1,5 +1,6 @@ | ||||
| import { FileJSBundleProvider } from 'pushy/src/main/ets/FileJSBundleProvider'; | ||||
| import { ComponentBuilderContext, RNOHCoreContext,RNAbility } from '@rnoh/react-native-openharmony'; | ||||
| import { ComponentBuilderContext, RNOHCoreContext,RNAbility, | ||||
|   MetroJSBundleProvider } from '@rnoh/react-native-openharmony'; | ||||
| import { | ||||
|   RNApp, | ||||
|   AnyJSBundleProvider, | ||||
| @@ -61,8 +62,9 @@ struct Index { | ||||
|           }, | ||||
|           jsBundleProvider: new TraceJSBundleProviderDecorator( | ||||
|             new AnyJSBundleProvider([ | ||||
|               // MetroJSBundleProvider.fromServerIp('127.0.0.1'), | ||||
|               // new ResourceJSBundleProvider(rnohCoreContext.uiAbilityContext.resourceManager, 'hermes_bundle.hbc'), | ||||
|               // local debug mode | ||||
|               new MetroJSBundleProvider(), | ||||
|               // release mode | ||||
|               new FileJSBundleProvider(this.rnohCoreContext.uiAbilityContext), | ||||
|               new ResourceJSBundleProvider(this.rnohCoreContext.uiAbilityContext.resourceManager, 'bundle.harmony.js') | ||||
|             ]), | ||||
|   | ||||
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							| @@ -1,4 +1,4 @@ | ||||
| { | ||||
|     "pushy_build_time": "2025-03-09T01:57:42.464Z", | ||||
|     "pushy_build_time": "2025-04-12T11:12:43.423Z", | ||||
|     "versionName": "1.0.0" | ||||
| } | ||||
| @@ -0,0 +1,5 @@ | ||||
|  | ||||
| /** | ||||
|  */ | ||||
|  | ||||
| export {} | ||||
| @@ -0,0 +1,8 @@ | ||||
| /** | ||||
|  * This code was generated by "react-native codegen-harmony" | ||||
|  *  | ||||
|  * Do not edit this file as changes may cause incorrect behavior and will be | ||||
|  * lost once the code is regenerated. | ||||
|  */ | ||||
|  | ||||
| export * from "./ts" | ||||
| @@ -0,0 +1,9 @@ | ||||
| /** | ||||
|  * This code was generated by "react-native codegen-harmony" | ||||
|  *  | ||||
|  * Do not edit this file as changes may cause incorrect behavior and will be | ||||
|  * lost once the code is regenerated. | ||||
|  */ | ||||
|  | ||||
| export * as RNC from "./components/ts" | ||||
| export * as TM from "./turboModules/ts" | ||||
| @@ -0,0 +1,5 @@ | ||||
|  | ||||
| /** | ||||
|  */ | ||||
|  | ||||
| export {} | ||||
		Reference in New Issue
	
	Block a user
	 波仔糕
					波仔糕