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
13 changes: 7 additions & 6 deletions Example/harmony_use_pushy/README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
## 运行harmony_use_pushy项目步骤

### 1. 先在react-native-update根目录执行下面命令同步C++模块
### 1. 在项目根目录执行下面命令安装第三方依赖
```
yarn submodule
bun install
```

### 2. 在项目根目录执行下面命令安装第三方依赖。
### 2. 本地debug 模式
```
yarn install
bun run start
```
![image](./debug.png)

### 3. 在项目根目录执行下面命令生成bundle包文件。
### 3. release 模式: 在项目根目录执行下面命令生成bundle包文件。
```
yarn build
bun run build
```
说明:这个命令会在harmony/entry/src/main/resources/rawfile目录生成Hbundle.harmony.js和assets文件,同时会基于该内容在.pushy/output目录生成ppk包。

Expand Down
2,130 changes: 2,130 additions & 0 deletions Example/harmony_use_pushy/bun.lock

Large diffs are not rendered by default.

Binary file added Example/harmony_use_pushy/debug.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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,
Expand Down Expand Up @@ -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')
]),
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -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"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@

/**
*/

export {}
Original file line number Diff line number Diff line change
@@ -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"
Original file line number Diff line number Diff line change
@@ -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"
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@

/**
*/

export {}
Loading
Loading