diff --git a/CHANGELOG.md b/CHANGELOG.md
index f92fe2e1edc80f161dfe2d5d68a8a6211b508841..631ca149a88bfcdb72decb32eacf2cfe8dc11b14 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,4 +1,13 @@
# Changelog
+
+## 5.1.0.203
+- chore: update to version 0.72.57,([e10c9b86e](https://gitee.com/openharmony-sig/ohos_react_native/commit/e10c9b86e27d638261e28d8f18048bafb5ef47a1))
+- fix:crash when Animated remove native event,([62fd10343](https://gitee.com/openharmony-sig/ohos_react_native/commit/62fd10343f8061dac00ad3c0f72ccc45855b15ec))
+- fix lineHeight inconsistency,([325a3319c](https://gitee.com/openharmony-sig/ohos_react_native/commit/325a3319c642880e007aa0cffcebe8b32cc351ef))
+- chore: update to version 5.1.0.202(0.72.56),([6d5003245](https://gitee.com/openharmony-sig/ohos_react_native/commit/6d5003245109243b330adeb32156a0fe9de28575))
+- fix(codecheck): unsafe memcpy,([9b42afd1a](https://gitee.com/openharmony-sig/ohos_react_native/commit/9b42afd1aa3aa6c4200e51577aa1260fdd75479d))
+- feat(mmap): speed up bundle loading with mmap,([1451c57a5](https://gitee.com/openharmony-sig/ohos_react_native/commit/1451c57a5c5a63607a0020c1b1ca4cb861372805))
+
## 5.1.0.202
- Supplement the pull third-party library dependency command,([18e052f9](https://gitee.com/openharmony-sig/ohos_react_native/commit/18e052f9e2073ab4860f1526e21ecd8c0daab360))
- doc(performance): update performance tuning instructions and add BiSheng compiler usage,([c3ad53c3](https://gitee.com/openharmony-sig/ohos_react_native/commit/c3ad53c3dac1f260af07016e49924d5d0563e777))
diff --git a/README_zh.md b/README_zh.md
index 087337ebc1bd0c0fa9e713787d8d05755b2ad0b4..9157b9a8fdb26bdb60cd53cd86bbe2c0ac18e579 100644
--- a/README_zh.md
+++ b/README_zh.md
@@ -7,16 +7,20 @@
### 前提条件
#### 安装了HarmonyOS NEXT的模拟器或真机
+
该项目需要HarmonyOS NEXT上进行测试。
#### 华为开发者账号
+
运行应用程序时,需要用到华为开发者账号进行签名。
#### DevEco Studio
+
从[官网](https://developer.huawei.com/consumer/cn/deveco-studio/)下载并安装最新版本 DevEco Studio。
### 启动项目
-> 如果是编译源码,在拉取工程后需要在工程的根目录执行`git submodule update --init`命令,拉取三方库依赖。
+
+> 如果是编译源码,在拉取工程后需要在工程的根目录执行`git submodule update --init --recursive`命令,拉取三方库依赖。
1. 打开终端(命令行工具)并导航到react-native-harmony-cli目录,然后执行 `npm i && npm pack`。
1. 在终端中导航到react-native-harmony-sample-package目录,然后执行 `npm i && npm pack`。
@@ -35,16 +39,20 @@
- RNOH的使用问题可查阅[中文文档](./docs/zh-cn/README.md)或[英文文档](./docs/en/README.md)。
## 版本说明
+
当前发布的最新正式版本:
+
- [RNOH v5.0.0.813(2024-12-26)](./docs/zh-cn/release-notes/react-native-harmony-v5.0.0.813.md)
历史发布的正式版本:
+
- [RNOH v5.0.0.812(2024-12-14)](./docs/zh-cn/release-notes/react-native-harmony-v5.0.0.812.md)
- [RNOH v5.0.0.715(2024-10-25)](./docs/zh-cn/release-notes/react-native-harmony-v5.0.0.715.md)
- [RNOH v5.0.0.601(2024-09-26)](./docs/zh-cn/release-notes/react-native-harmony-v5.0.0.601.md)
- [RNOH v5.0.0.500(2024-08-27)](./docs/zh-cn/release-notes/react-native-harmony-v5.0.0.500.md)
## 分支说明
+
- 0.72.5-ohos-5.0-release分支:release分支,如需下载源码,请从此分支下载上述正式版本对应的tag点源码。
- master分支:主分支,请勿从此分支拉取源码用于商用版本,不保证质量。
- dev分支/partner-dev分支:开发分支,请勿从此分支拉取源码,不保证质量。
diff --git a/docs/Samples/Capture_bundle/NativeProject/AppScope/app.json5 b/docs/Samples/Capture_bundle/NativeProject/AppScope/app.json5
index cfc56cdf27a2f1e0a320f40ea3c84bb0915b502c..3d2e31a3f9f5f9084aab0dce6c5271f5d3539316 100644
--- a/docs/Samples/Capture_bundle/NativeProject/AppScope/app.json5
+++ b/docs/Samples/Capture_bundle/NativeProject/AppScope/app.json5
@@ -1,6 +1,6 @@
{
"app": {
- "bundleName": "com.example.CaptureBundle",
+ "bundleName": "com.example.capturebundle",
"vendor": "example",
"versionCode": 1000000,
"versionName": "1.0.0",
diff --git a/docs/Samples/Capture_bundle/NativeProject/entry/hvigorfile.ts b/docs/Samples/Capture_bundle/NativeProject/entry/hvigorfile.ts
index d0f029bd2a2858b1701bf87bf3f67c00d5630c84..6650e7217be2e794b661d45f0d373a35d0026db4 100644
--- a/docs/Samples/Capture_bundle/NativeProject/entry/hvigorfile.ts
+++ b/docs/Samples/Capture_bundle/NativeProject/entry/hvigorfile.ts
@@ -8,6 +8,6 @@
import { hapTasks } from '@ohos/hvigor-ohos-plugin';
export default {
- system: hapTasks, /* Built-in plugin of Hvigor. It cannot be modified. */
- plugins:[] /* Custom plugin to extend the functionality of Hvigor. */
+ system: hapTasks, /* Built-in plugin of Hvigor. It cannot be modified. */
+ plugins: [] /* Custom plugin to extend the functionality of Hvigor. */
}
diff --git a/docs/Samples/Capture_bundle/NativeProject/entry/src/main/ets/RNPackagesFactory.ets b/docs/Samples/Capture_bundle/NativeProject/entry/src/main/ets/RNPackagesFactory.ets
index 193ab1590919086abfb7b631470f31e9d41b086b..32a1c1f885769452c41143514bf10459f08e7fc6 100644
--- a/docs/Samples/Capture_bundle/NativeProject/entry/src/main/ets/RNPackagesFactory.ets
+++ b/docs/Samples/Capture_bundle/NativeProject/entry/src/main/ets/RNPackagesFactory.ets
@@ -6,6 +6,7 @@
*/
import { RNPackageContext, RNPackage } from '@rnoh/react-native-openharmony/ts';
+
export function createRNPackages(ctx: RNPackageContext): RNPackage[] {
return [];
}
\ No newline at end of file
diff --git a/docs/Samples/Capture_bundle/NativeProject/entry/src/main/ets/pages/Index.ets b/docs/Samples/Capture_bundle/NativeProject/entry/src/main/ets/pages/Index.ets
index bc6ef0a3d4b624cf3dedc9d9f98b767f60d06590..9ce6839c316aaf2635a4d9536651acf0d8befb76 100644
--- a/docs/Samples/Capture_bundle/NativeProject/entry/src/main/ets/pages/Index.ets
+++ b/docs/Samples/Capture_bundle/NativeProject/entry/src/main/ets/pages/Index.ets
@@ -20,7 +20,8 @@ import {
import { createRNPackages } from '../RNPackagesFactory';
@Builder
-export function buildCustomRNComponent(ctx: ComponentBuilderContext) {};
+export function buildCustomRNComponent(ctx: ComponentBuilderContext) {
+};
const wrappedCustomRNComponentBuilder = wrapBuilder(buildCustomRNComponent);
diff --git a/docs/Samples/Capture_bundle/NativeProject/hvigorfile.ts b/docs/Samples/Capture_bundle/NativeProject/hvigorfile.ts
index 549b0badab9ef99722e947c60855c7dd266ae506..15864d709a604c7a9db90b9afec84fc9f1ee044e 100644
--- a/docs/Samples/Capture_bundle/NativeProject/hvigorfile.ts
+++ b/docs/Samples/Capture_bundle/NativeProject/hvigorfile.ts
@@ -8,6 +8,11 @@
import { appTasks } from '@ohos/hvigor-ohos-plugin';
export default {
+<<<<<<< HEAD
+ system: appTasks, /* Built-in plugin of Hvigor. It cannot be modified. */
+ plugins: [] /* Custom plugin to extend the functionality of Hvigor. */
+=======
system: appTasks, /* Built-in plugin of Hvigor. It cannot be modified. */
- plugins:[] /* Custom plugin to extend the functionality of Hvigor. */
+ plugins: [] /* Custom plugin to extend the functionality of Hvigor. */
+>>>>>>> 589ae80f (Format the code format of the Sample project)
}
diff --git a/docs/Samples/Capture_bundle/ReactProject/App.tsx b/docs/Samples/Capture_bundle/ReactProject/App.tsx
index 1c91d6b69ca07dcc8a14953dc6fc2e1d6951183e..3024526b3a082e2e433bdfc5097734a753bb6d6d 100644
--- a/docs/Samples/Capture_bundle/ReactProject/App.tsx
+++ b/docs/Samples/Capture_bundle/ReactProject/App.tsx
@@ -5,94 +5,94 @@
* LICENSE-MIT file in the root directory of this source tree.
*/
-import React ,{useState} from 'react';
-import {View,Text,Button,Alert,StyleSheet} from 'react-native'
+import React, { useState } from 'react';
+import { View, Text, Button, Alert, StyleSheet } from 'react-native'
-const App:React.FC = () => {
- const[errorMessage,setErrorMessage] = useState('');
+const App: React.FC = () => {
+ const [errorMessage, setErrorMessage] = useState('');
- const handleReferenceError = () =>{
- try{
+ const handleReferenceError = () => {
+ try {
const erro = new ReferenceError('Some error happened');
throw error;
- }catch(e){
- console.error('Caught an error:',e);
+ } catch (e) {
+ console.error('Caught an error:', e);
setErrorMessage(e.message);
}
};
- const handleStandardError = () =>{
- try{
+ const handleStandardError = () => {
+ try {
const error = new Error('Some error happened');
throw error;
- }catch(e){
- console.error('Caught an error:',e);
+ } catch (e) {
+ console.error('Caught an error:', e);
setErrorMessage(e.message);
}
};
- const handleFrozenError = () =>{
- try{
+ const handleFrozenError = () => {
+ try {
const error = Object.freeze(new Error('Some error happened'));
throw error;
- }catch(e){
- console.error('Caught an error:',e);
+ } catch (e) {
+ console.error('Caught an error:', e);
setErrorMessage(e.message);
}
};
- const handleWarningError = () =>{
- try{
- const warning = new Error('This is a warning message') as any;
+ const handleWarningError = () => {
+ try {
+ const warning = new Error('This is a warning message') as any;
warning.type = 'warn';
throw warning;
- }catch(e){
- Alert.alert('Warning',e.message);
- setErrorMessage('Warning displayed:'+e.message);
+ } catch (e) {
+ Alert.alert('Warning', e.message);
+ setErrorMessage('Warning displayed:' + e.message);
}
};
- return(
+ return (
- Press a Button to trigger an error or warning:
-
-
- {
- errorMessage && {errorMessage}
- }
+ Press a Button to trigger an error or warning:
+
+
+
+
+
+
+ {
+ errorMessage && {errorMessage}
+ }
);
};
-const styles =
-StyleSheet.create({
- container:{
- flex:1,
- justifyContent:'center',
- alignItems:'center',
- padding:20,
+const styles =
+ StyleSheet.create({
+ container: {
+ flex: 1,
+ justifyContent: 'center',
+ alignItems: 'center',
+ padding: 20,
},
- title:{
- fontSize:18,
- marginBottom:20,
+ title: {
+ fontSize: 18,
+ marginBottom: 20,
},
- buttonContainer:{
- width:'80%',
- justifyContent:'space-around',
- flexDirection:'row',
- flexWrap:'wrap',
+ buttonContainer: {
+ width: '80%',
+ justifyContent: 'space-around',
+ flexDirection: 'row',
+ flexWrap: 'wrap',
},
- errorMessage:{
- color:'red',
- marginTop:20,
+ errorMessage: {
+ color: 'red',
+ marginTop: 20,
},
});
diff --git a/docs/Samples/Capture_bundle/ReactProject/__tests__/App.test.tsx b/docs/Samples/Capture_bundle/ReactProject/__tests__/App.test.tsx
index 3413ac1c403683d540b3c5e46adbd7ad03460123..e8af277008cbcde75b0bc4b1652245643e519f0e 100644
--- a/docs/Samples/Capture_bundle/ReactProject/__tests__/App.test.tsx
+++ b/docs/Samples/Capture_bundle/ReactProject/__tests__/App.test.tsx
@@ -7,7 +7,7 @@ import React from 'react';
import App from '../App';
// Note: import explicitly to use the types shiped with jest.
-import {it} from '@jest/globals';
+import { it } from '@jest/globals';
// Note: test renderer must be required after react-native.
import renderer from 'react-test-renderer';
diff --git a/docs/Samples/Capture_bundle/ReactProject/index.js b/docs/Samples/Capture_bundle/ReactProject/index.js
index a850d031de79119ee024e9c2fe22809c31417ab3..9b73932914001a9ccd3b23145c0ef4d61e62c150 100644
--- a/docs/Samples/Capture_bundle/ReactProject/index.js
+++ b/docs/Samples/Capture_bundle/ReactProject/index.js
@@ -2,8 +2,8 @@
* @format
*/
-import {AppRegistry} from 'react-native';
+import { AppRegistry } from 'react-native';
import App from './App';
-import {name as appName} from './app.json';
+import { name as appName } from './app.json';
AppRegistry.registerComponent(appName, () => App);
diff --git a/docs/Samples/Capture_bundle/ReactProject/metro.config.js b/docs/Samples/Capture_bundle/ReactProject/metro.config.js
index 1165e3b5032a16a28cc8df18dbf6bbbe8f89355b..431c371dc4e1ba5bdcace49f7259c756b681e4ed 100644
--- a/docs/Samples/Capture_bundle/ReactProject/metro.config.js
+++ b/docs/Samples/Capture_bundle/ReactProject/metro.config.js
@@ -5,8 +5,8 @@
* LICENSE-MIT file in the root directory of this source tree.
*/
-const {mergeConfig, getDefaultConfig} = require('@react-native/metro-config');
-const {createHarmonyMetroConfig} = require('@react-native-oh/react-native-harmony/metro.config');
+const { mergeConfig, getDefaultConfig } = require('@react-native/metro-config');
+const { createHarmonyMetroConfig } = require('@react-native-oh/react-native-harmony/metro.config');
/**
* @type {import("metro-config").ConfigT}
diff --git a/docs/Samples/FabricComponentSample/NativeProject/AppScope/app.json5 b/docs/Samples/FabricComponentSample/NativeProject/AppScope/app.json5
index 6db09bf91df6b937ffc4d363d1fdc09600b90bee..4f3e2acaec5863adbba9ee8e20d4c3c6db9e3146 100644
--- a/docs/Samples/FabricComponentSample/NativeProject/AppScope/app.json5
+++ b/docs/Samples/FabricComponentSample/NativeProject/AppScope/app.json5
@@ -1,6 +1,6 @@
{
"app": {
- "bundleName": "com.reactnative.fabric",
+ "bundleName": "com.example.fabric",
"vendor": "example",
"versionCode": 1000000,
"versionName": "1.0.0",
diff --git a/docs/Samples/FabricComponentSample/NativeProject/entry/hvigorfile.ts b/docs/Samples/FabricComponentSample/NativeProject/entry/hvigorfile.ts
index d0f029bd2a2858b1701bf87bf3f67c00d5630c84..6650e7217be2e794b661d45f0d373a35d0026db4 100644
--- a/docs/Samples/FabricComponentSample/NativeProject/entry/hvigorfile.ts
+++ b/docs/Samples/FabricComponentSample/NativeProject/entry/hvigorfile.ts
@@ -8,6 +8,6 @@
import { hapTasks } from '@ohos/hvigor-ohos-plugin';
export default {
- system: hapTasks, /* Built-in plugin of Hvigor. It cannot be modified. */
- plugins:[] /* Custom plugin to extend the functionality of Hvigor. */
+ system: hapTasks, /* Built-in plugin of Hvigor. It cannot be modified. */
+ plugins: [] /* Custom plugin to extend the functionality of Hvigor. */
}
diff --git a/docs/Samples/FabricComponentSample/NativeProject/entry/oh-package.json5 b/docs/Samples/FabricComponentSample/NativeProject/entry/oh-package.json5
index 1a0486b43121ebce6ab98b3d4ac7ae1d572e4576..1a58601155503a2f692b644a2e778d3086184a2c 100644
--- a/docs/Samples/FabricComponentSample/NativeProject/entry/oh-package.json5
+++ b/docs/Samples/FabricComponentSample/NativeProject/entry/oh-package.json5
@@ -7,6 +7,5 @@
"main": "",
"version": "1.0.0",
"dependencies": {
- "@rnoh/react-native-openharmony": "file:../libs/react_native_openharmony-5.0.0.715.har",
}
}
diff --git a/docs/Samples/FabricComponentSample/NativeProject/entry/src/main/ets/RNComponent/SelectBox.ets b/docs/Samples/FabricComponentSample/NativeProject/entry/src/main/ets/RNComponent/SelectBox.ets
index caa553edf65bec11e9a6cbca8f1502d451b09997..e7d3f3caefdf7475d035d1c55320a1117da6f6cd 100644
--- a/docs/Samples/FabricComponentSample/NativeProject/entry/src/main/ets/RNComponent/SelectBox.ets
+++ b/docs/Samples/FabricComponentSample/NativeProject/entry/src/main/ets/RNComponent/SelectBox.ets
@@ -44,14 +44,15 @@ export struct SelectBox {
this.onDescriptorWrapperChange(new RNC.SelectBox.DescriptorWrapper(descriptor))
}
))
- this.cleanUpCallbacks.push(new RNC.SelectBox.CommandReceiver(this.ctx.componentCommandReceiver, this.tag).subscribe("emitNativeEvent", (argv) => {
+ this.cleanUpCallbacks.push(new RNC.SelectBox.CommandReceiver(this.ctx.componentCommandReceiver,
+ this.tag).subscribe("emitNativeEvent", (argv) => {
console.log(`收到 RN 传来的消息 ================ ${JSON.stringify(argv)}`);
this.mutil = argv[0] || false
}))
}
private onDescriptorWrapperChange(descriptorWrapper: RNC.SelectBox.DescriptorWrapper) {
- this.descriptorWrapper = descriptorWrapper
+ this.descriptorWrapper = descriptorWrapper
this.data = []
const data = this.descriptorWrapper.props.data;
const value = this.descriptorWrapper.props.value;
diff --git a/docs/Samples/FabricComponentSample/NativeProject/entry/src/main/ets/pages/Index.ets b/docs/Samples/FabricComponentSample/NativeProject/entry/src/main/ets/pages/Index.ets
index 571b61345a7be8b386f80c5e90c7431534974071..6689c0bd68adba812b7f741478e8d0e6b5f12536 100644
--- a/docs/Samples/FabricComponentSample/NativeProject/entry/src/main/ets/pages/Index.ets
+++ b/docs/Samples/FabricComponentSample/NativeProject/entry/src/main/ets/pages/Index.ets
@@ -18,12 +18,13 @@ import {
RNOHCoreContext
} from '@rnoh/react-native-openharmony';
import { createRNPackages } from '../RNPackagesFactory';
-import { SelectBox } from "../rnc/SelectBox"
+import { SelectBox } from "../RNComponent/SelectBox"
const arkTsComponentNames: Array = [SelectBox.NAME];
+
@Builder
export function buildCustomRNComponent(ctx: ComponentBuilderContext) {
- Stack(){
+ Stack() {
if (ctx.componentName === SelectBox.NAME) {
SelectBox({
ctx: ctx.rnComponentContext,
@@ -31,8 +32,7 @@ export function buildCustomRNComponent(ctx: ComponentBuilderContext) {
})
}
}
- .position({x:0, y: 0})
-
+ .position({ x: 0, y: 0 })
}
const wrappedCustomRNComponentBuilder = wrapBuilder(buildCustomRNComponent)
@@ -44,7 +44,6 @@ struct Index {
@State shouldShow: boolean = false
private logger!: RNOHLogger
-
aboutToAppear() {
this.logger = this.rnohCoreContext!.logger.clone("Index")
const stopTracing = this.logger.clone("aboutToAppear").startTracing()
diff --git a/docs/Samples/FabricComponentSample/NativeProject/hvigorfile.ts b/docs/Samples/FabricComponentSample/NativeProject/hvigorfile.ts
index 549b0badab9ef99722e947c60855c7dd266ae506..15864d709a604c7a9db90b9afec84fc9f1ee044e 100644
--- a/docs/Samples/FabricComponentSample/NativeProject/hvigorfile.ts
+++ b/docs/Samples/FabricComponentSample/NativeProject/hvigorfile.ts
@@ -8,6 +8,11 @@
import { appTasks } from '@ohos/hvigor-ohos-plugin';
export default {
+<<<<<<< HEAD
+ system: appTasks, /* Built-in plugin of Hvigor. It cannot be modified. */
+ plugins: [] /* Custom plugin to extend the functionality of Hvigor. */
+=======
system: appTasks, /* Built-in plugin of Hvigor. It cannot be modified. */
- plugins:[] /* Custom plugin to extend the functionality of Hvigor. */
+ plugins: [] /* Custom plugin to extend the functionality of Hvigor. */
+>>>>>>> 589ae80f (Format the code format of the Sample project)
}
diff --git a/docs/Samples/FabricComponentSample/NativeProject/oh-package.json5 b/docs/Samples/FabricComponentSample/NativeProject/oh-package.json5
index d8ef48eb3cdd3f7e30867a0fcb6f9205289e7631..18a7f2a5cc91248eb7dfd8dd286be59ad2bda0a1 100644
--- a/docs/Samples/FabricComponentSample/NativeProject/oh-package.json5
+++ b/docs/Samples/FabricComponentSample/NativeProject/oh-package.json5
@@ -13,6 +13,5 @@
"@ohos/hamock": "1.0.0"
},
"overrides": {
- "@rnoh/react-native-openharmony": "file:./libs/react_native_openharmony-5.0.0.715.har",
}
}
\ No newline at end of file
diff --git a/docs/Samples/FabricComponentSample/README_zh.md b/docs/Samples/FabricComponentSample/README_zh.md
index 0c6abf77ffb4ae269088438dd402af53d4925d6e..9fed862380a44365b7cf7a385a0c01918325a8c1 100644
--- a/docs/Samples/FabricComponentSample/README_zh.md
+++ b/docs/Samples/FabricComponentSample/README_zh.md
@@ -16,12 +16,10 @@ FabricComponentSample
# 环境搭建
-1. 将 `rnoh-react-native-harmony-xx.tgz` 放到 `react-native-harmony` 文件夹下,然后修改 `ReactProject/package.json` 的 `react-native-harmony` 依赖路径;
-2. 将 `rnoh-react-native-harmony-cli-xx.tgz` 放到 `react-native-harmony-cli` 文件夹下;
-3. 在 `fabric-component-sample-package` 中运行 **npm pack** 生成tgz文件;
-4. 将 `react_native_openharmony-xxx.har` 放到 `NativeProject/libs` 文件夹下,并修改 `NativeProject/oh-package.json5` 和 `NativeProject/entry/oh-package.json5` 的依赖路径;
-5. 用 DevEco Studio 打开 `NativeProject`,执行 **Sync and Refresh Project**;
-6. 在 `ReactProject` 中运行 **npm i** 安装依赖,运行 **npm run dev** 生成bundle文件,运行 **npm start** 启动metro服务;
-7. 回到 DevEco Studio,点击右上角的 **run** 启动项目;
-8. 如果启动的是metro服务,还需要运行 `hdc rport tcp:8081 tcp:8081` 来转发8081端口,然后再在手机上重新打开应用。
+1. 在 `fabric-component-sample-package` 中运行 **npm pack** 生成tgz文件;
+2. 在 `ReactProject` 目录下执行 **npm i @react-native-oh/react-native-harmony@x.x.x**或**yarn add @react-native-oh/react-native-harmony@x.x.x** 安装依赖,执行 **npm run dev** 生成 bundle;
+3. 在 `entry` 目录下执行 **ohpm i @rnoh/react-native-openharmony@x.x.x** 安装依赖;
+4. 检查 `NativeProject`、`entry` 目录下是否生成 `oh-modules` 文件夹;
+5. 用 DevEco Studio 打开 SampleApp,执行 **Sync and Refresh Project**;
+6. 如果启动的是metro服务,还需要运行 `hdc rport tcp:8081 tcp:8081` 来转发8081端口,然后再在手机上重新打开应用。
diff --git a/docs/Samples/FabricComponentSample/ReactProject/App.tsx b/docs/Samples/FabricComponentSample/ReactProject/App.tsx
index a7acd9174dccf2533d97bc18980526a40bb2c4c1..d131241c67ad699bebf28f9f0c36b5b13e9279b6 100644
--- a/docs/Samples/FabricComponentSample/ReactProject/App.tsx
+++ b/docs/Samples/FabricComponentSample/ReactProject/App.tsx
@@ -52,12 +52,12 @@ const styles = StyleSheet.create({
flex: 1,
},
title: {
- backgroundColor: 'green',
- color: 'white',
- fontSize: 20,
- padding: 8,
- textAlign: 'center'
+ backgroundColor: 'green',
+ color: 'white',
+ fontSize: 20,
+ padding: 8,
+ textAlign: 'center'
}
- });
+});
export default App;
diff --git a/docs/Samples/FabricComponentSample/ReactProject/index.js b/docs/Samples/FabricComponentSample/ReactProject/index.js
index 861cbec71fa35737cc4701c115811e08c3cde448..21b5e067081c80e903a6e73781601caaf7d5e8aa 100644
--- a/docs/Samples/FabricComponentSample/ReactProject/index.js
+++ b/docs/Samples/FabricComponentSample/ReactProject/index.js
@@ -7,8 +7,8 @@
* @format
*/
-import {AppRegistry} from 'react-native';
-import {name as appName} from './app.json';
+import { AppRegistry } from 'react-native';
+import { name as appName } from './app.json';
import App from './App';
AppRegistry.registerComponent(appName, () => App);
diff --git a/docs/Samples/FabricComponentSample/ReactProject/metro.config.js b/docs/Samples/FabricComponentSample/ReactProject/metro.config.js
index 168a07e7a2fe1f0c19dae172c78e5d3f2d738c01..390abb520a0db2471bf8c7c557135dcce89548ac 100644
--- a/docs/Samples/FabricComponentSample/ReactProject/metro.config.js
+++ b/docs/Samples/FabricComponentSample/ReactProject/metro.config.js
@@ -5,25 +5,25 @@
* LICENSE-MIT file in the root directory of this source tree.
*/
-const {mergeConfig, getDefaultConfig} = require('@react-native/metro-config');
-const {createHarmonyMetroConfig} = require('react-native-harmony/metro.config');
+const { mergeConfig, getDefaultConfig } = require('@react-native/metro-config');
+const { createHarmonyMetroConfig } = require('@react-native-oh/react-native-harmony/metro.config');
/**
* @type {import("metro-config").ConfigT}
*/
const config = {
- // 清理metro缓存
- // resetCache: true,
- transformer: {
- getTransformOptions: async () => ({
- transform: {
- experimentalImportSupport: false,
- inlineRequires: true,
- },
- }),
- },
+ // 清理metro缓存
+ // resetCache: true,
+ transformer: {
+ getTransformOptions: async () => ({
+ transform: {
+ experimentalImportSupport: false,
+ inlineRequires: true,
+ },
+ }),
+ },
};
module.exports = mergeConfig(getDefaultConfig(__dirname), createHarmonyMetroConfig({
- reactNativeHarmonyPackageName: 'react-native-harmony',
+ reactNativeHarmonyPackageName: '@react-native-oh/react-native-harmony',
}), config);
diff --git a/docs/Samples/FabricComponentSample/ReactProject/package.json b/docs/Samples/FabricComponentSample/ReactProject/package.json
index a372ff19ec77224a71bb617353dc3a31c4fbb866..3f727af9ae8aa5783c60d47dd6fd8a4dbee69300 100644
--- a/docs/Samples/FabricComponentSample/ReactProject/package.json
+++ b/docs/Samples/FabricComponentSample/ReactProject/package.json
@@ -11,7 +11,6 @@
"dependencies": {
"react": "18.2.0",
"react-native": "0.72.5",
- "react-native-harmony": "file:../react-native-harmony/rnoh-react-native-harmony-0.72.56.tgz",
"react-native-performance": "^5.1.2",
"fabric-component-sample-package": "file:../fabric-component-sample-package/fabric-component-sample-package-1.0.0.tgz"
},
diff --git a/docs/Samples/FabricComponentSample/ReactProject/src/SelectBoxApp.tsx b/docs/Samples/FabricComponentSample/ReactProject/src/SelectBoxApp.tsx
index cd4d830be6f26f0b2bd8c360359a03e99e240ea0..f3a7891055e5e415c4c4a19bd7779164c1c52815 100644
--- a/docs/Samples/FabricComponentSample/ReactProject/src/SelectBoxApp.tsx
+++ b/docs/Samples/FabricComponentSample/ReactProject/src/SelectBoxApp.tsx
@@ -5,7 +5,6 @@
* LICENSE-MIT file in the root directory of this source tree.
*/
-
import React, { useRef, useState } from 'react';
import {
Text,
@@ -50,7 +49,7 @@ const App = () => {
setMutil(!mutil)
}
}}>
- {`现在是${ mutil ? '多选' : '单选' }`}
+ {`现在是${mutil ? '多选' : '单选'}`}
{
console.log(event.nativeEvent)
}}
/>
-
+
);
};
const styles = StyleSheet.create({
- container: {
- backgroundColor: 'white',
- height: 250,
- justifyContent: 'center',
- },
- title: {
- backgroundColor: 'green',
- color: 'white',
- fontSize: 20,
- padding: 8,
- textAlign: 'center'
- }
+ container: {
+ backgroundColor: 'white',
+ height: 250,
+ justifyContent: 'center',
+ },
+ title: {
+ backgroundColor: 'green',
+ color: 'white',
+ fontSize: 20,
+ padding: 8,
+ textAlign: 'center'
+ }
});
export default App;
diff --git a/docs/Samples/FabricComponentSample/react-native-harmony-cli/.gitkeep b/docs/Samples/FabricComponentSample/react-native-harmony-cli/.gitkeep
deleted file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000
diff --git a/docs/Samples/FabricComponentSample/react-native-harmony/.gitkeep b/docs/Samples/FabricComponentSample/react-native-harmony/.gitkeep
deleted file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000
diff --git a/docs/Samples/FrameNodeSample/FrameNodeSampleApp/AppScope/app.json5 b/docs/Samples/FrameNodeSample/FrameNodeSampleApp/AppScope/app.json5
index d3f1ec1ad833a8a2deb82f91863e50f85c4df34c..73ebe75ada6bd6172cd63dbfee2492c7aae6fbd3 100644
--- a/docs/Samples/FrameNodeSample/FrameNodeSampleApp/AppScope/app.json5
+++ b/docs/Samples/FrameNodeSample/FrameNodeSampleApp/AppScope/app.json5
@@ -1,6 +1,6 @@
{
"app": {
- "bundleName": "com.example.myapp",
+ "bundleName": "com.example.framenode",
"vendor": "example",
"versionCode": 1000000,
"versionName": "1.0.0",
diff --git a/docs/Samples/FrameNodeSample/FrameNodeSampleApp/entry/hvigorfile.ts b/docs/Samples/FrameNodeSample/FrameNodeSampleApp/entry/hvigorfile.ts
index 4a1a975c3b7491258f5ff7278660b08d260ee8d3..e570e90e8decfddb61acdbaf0c9e6b983edddb23 100644
--- a/docs/Samples/FrameNodeSample/FrameNodeSampleApp/entry/hvigorfile.ts
+++ b/docs/Samples/FrameNodeSample/FrameNodeSampleApp/entry/hvigorfile.ts
@@ -8,6 +8,6 @@
import { hapTasks } from '@ohos/hvigor-ohos-plugin';
export default {
- system: hapTasks, /* Built-in plugin of Hvigor. It cannot be modified. */
- plugins:[] /* Custom plugin to extend the functionality of Hvigor. */
+ system: hapTasks, /* Built-in plugin of Hvigor. It cannot be modified. */
+ plugins: [] /* Custom plugin to extend the functionality of Hvigor. */
}
diff --git a/docs/Samples/FrameNodeSample/FrameNodeSampleApp/entry/src/main/ets/entryability/EntryAbility.ets b/docs/Samples/FrameNodeSample/FrameNodeSampleApp/entry/src/main/ets/entryability/EntryAbility.ets
index 8cace666602a8663341af112f7e2eebea2b6851b..48f7b51ebfbfa3d6fc2dd5fbebf69763c00e31c5 100644
--- a/docs/Samples/FrameNodeSample/FrameNodeSampleApp/entry/src/main/ets/entryability/EntryAbility.ets
+++ b/docs/Samples/FrameNodeSample/FrameNodeSampleApp/entry/src/main/ets/entryability/EntryAbility.ets
@@ -7,9 +7,7 @@
import dataPreferences from '@ohos.data.preferences';
import window from '@ohos.window';
-import {
- RNAbility,
-} from '@rnoh/react-native-openharmony';
+import { RNAbility, } from '@rnoh/react-native-openharmony';
export let preferences: dataPreferences.Preferences | null = null;
@@ -21,9 +19,11 @@ export default class EntryAbility extends RNAbility {
onWindowStageCreate(windowStage: window.WindowStage) {
super.onWindowStageCreate(windowStage);
try {
- let options: dataPreferences.Options = { name: 'test'};
+ let options: dataPreferences.Options = {
+ name: 'test'
+ };
preferences = dataPreferences.getPreferencesSync(this.context, options);
- } catch(err) {
+ } catch (err) {
console.error('Failed to get preferences');
}
}
diff --git a/docs/Samples/FrameNodeSample/FrameNodeSampleApp/entry/src/main/ets/pages/RNPage.ets b/docs/Samples/FrameNodeSample/FrameNodeSampleApp/entry/src/main/ets/pages/RNPage.ets
index 92f254402f0da61bd0fe89ee5f10a5c8dd9fb163..9d3d329934ce3c87303f3d06d8429bc8e4a16394 100644
--- a/docs/Samples/FrameNodeSample/FrameNodeSampleApp/entry/src/main/ets/pages/RNPage.ets
+++ b/docs/Samples/FrameNodeSample/FrameNodeSampleApp/entry/src/main/ets/pages/RNPage.ets
@@ -8,10 +8,8 @@
import { RNOHCoreContext, ComponentBuilderContext, } from '@rnoh/react-native-openharmony';
import { NodeController, FrameNode, BuilderNode, Size } from '@ohos.arkui.node';
import { LoadManager } from '../rn';
-
import { promptAction } from '@kit.ArkUI';
import FrameNodeRNPage from './FrameNodeRNPage';
-
import { Params, BuilderData } from './BuilderType';
import { getRNController } from './common';
diff --git a/docs/Samples/FrameNodeSample/FrameNodeSampleApp/entry/src/main/ets/pages/common.ets b/docs/Samples/FrameNodeSample/FrameNodeSampleApp/entry/src/main/ets/pages/common.ets
index 1a23db5781b8fff237bf646b22a3c990d4a3e576..2df69eb9f55f9bc0649709d790c62194b6ea307e 100644
--- a/docs/Samples/FrameNodeSample/FrameNodeSampleApp/entry/src/main/ets/pages/common.ets
+++ b/docs/Samples/FrameNodeSample/FrameNodeSampleApp/entry/src/main/ets/pages/common.ets
@@ -29,7 +29,6 @@ function myRNPageBuilder(params: Params) {
FrameNodeRNPage(params)
.width('100%')
.height('30%')
-
}
}
}
diff --git a/docs/Samples/FrameNodeSample/FrameNodeSampleApp/entry/src/main/ets/rn/BaseRN.ets b/docs/Samples/FrameNodeSample/FrameNodeSampleApp/entry/src/main/ets/rn/BaseRN.ets
index 239aaae7012ff5549fb898114e1a7bef05d8a420..6ac51e2972c1858ccb3e411af743cc5a4f17d965 100644
--- a/docs/Samples/FrameNodeSample/FrameNodeSampleApp/entry/src/main/ets/rn/BaseRN.ets
+++ b/docs/Samples/FrameNodeSample/FrameNodeSampleApp/entry/src/main/ets/rn/BaseRN.ets
@@ -42,7 +42,7 @@ export struct BaseRN {
RNSurface({
surfaceConfig: {
appKey: this.moduleName,
- initialProps: { "propA": "good" } as Record,
+ initialProps: { "propA": "good" } as Record,
} as SurfaceConfig2,
ctx: new RNComponentContext(
RNOHContext.fromCoreContext(this.rnohCoreContext!, this.rnInstance),
diff --git a/docs/Samples/FrameNodeSample/FrameNodeSampleApp/entry/src/main/ets/rn/LoadBundle.ets b/docs/Samples/FrameNodeSample/FrameNodeSampleApp/entry/src/main/ets/rn/LoadBundle.ets
index d8561a8cf8b20f705df3e929d67d0ddd510d5671..b24893469ea04e07c39f4939759b9ce26204caaf 100644
--- a/docs/Samples/FrameNodeSample/FrameNodeSampleApp/entry/src/main/ets/rn/LoadBundle.ets
+++ b/docs/Samples/FrameNodeSample/FrameNodeSampleApp/entry/src/main/ets/rn/LoadBundle.ets
@@ -16,34 +16,30 @@ import {
buildRNComponentForTag,
} from '@rnoh/react-native-openharmony';
import { createRNPackages } from './RNPackagesFactory'
-
import { ENABLE_CAPI_ARCHITECTURE } from './config';
export const arkTsComponentNames = [];
-@Builder export function buildCustomComponent(ctx: ComponentBuilderContext) {
- Stack(){
+@Builder
+export function buildCustomComponent(ctx: ComponentBuilderContext) {
+ Stack() {
}
- .position({x:0, y:0})
+ .position({ x: 0, y: 0 })
}
export class LoadManager {
-
private static loadedBundle: Set = new Set();
public static metroInstance: RNInstance;
public static cpInstance: RNInstance;
public static bpInstance: RNInstance;
-
private static shouldResetMetroInstance: Boolean = true;
static ctx: RNComponentContext;
public static loadBundle(instance: RNInstance, bundlePath: string, useBundleCache: boolean = true): Promise {
- if (LoadManager.loadedBundle.has(bundlePath) && useBundleCache)
- {
+ if (LoadManager.loadedBundle.has(bundlePath) && useBundleCache) {
return Promise.resolve();
- }
- if (useBundleCache)
- {
+ }
+ if (useBundleCache) {
LoadManager.loadedBundle.add(bundlePath);
}
return instance.runJSBundle(new ResourceJSBundleProvider(getContext().resourceManager, bundlePath));
@@ -70,7 +66,8 @@ export class LoadManager {
const provider = new MetroJSBundleProvider();
await LoadManager.metroInstance.runJSBundle(provider);
- const jsBundleExecutionStatus: string = LoadManager.metroInstance.getBundleExecutionStatus(provider.getURL()) as string;
+ const jsBundleExecutionStatus: string =
+ LoadManager.metroInstance.getBundleExecutionStatus(provider.getURL()) as string;
LoadManager.shouldResetMetroInstance = false;
if (jsBundleExecutionStatus === "DONE") {
return true
diff --git a/docs/Samples/FrameNodeSample/FrameNodeSampleApp/entry/src/main/ets/rn/index.ets b/docs/Samples/FrameNodeSample/FrameNodeSampleApp/entry/src/main/ets/rn/index.ets
index 0a6fd7e82baea47cb1031215ac2c9fc249b504ea..7c1d80bc55beb834f6dec339be7ade536aa59ad7 100644
--- a/docs/Samples/FrameNodeSample/FrameNodeSampleApp/entry/src/main/ets/rn/index.ets
+++ b/docs/Samples/FrameNodeSample/FrameNodeSampleApp/entry/src/main/ets/rn/index.ets
@@ -6,6 +6,9 @@
*/
export { BaseRN } from './BaseRN';
+
export { createRNPackages } from './RNPackagesFactory';
+
export { LoadManager, buildCustomComponent } from './LoadBundle';
+
export * from './config';
\ No newline at end of file
diff --git a/docs/Samples/FrameNodeSample/FrameNodeSampleApp/hvigorfile.ts b/docs/Samples/FrameNodeSample/FrameNodeSampleApp/hvigorfile.ts
index 035eea0cc548c925a1d81920e8e809fe57d6a4db..44bbe01097a3d4970037b397435c451f6d260669 100644
--- a/docs/Samples/FrameNodeSample/FrameNodeSampleApp/hvigorfile.ts
+++ b/docs/Samples/FrameNodeSample/FrameNodeSampleApp/hvigorfile.ts
@@ -8,6 +8,11 @@
import { appTasks } from '@ohos/hvigor-ohos-plugin';
export default {
+<<<<<<< HEAD
+ system: appTasks, /* Built-in plugin of Hvigor. It cannot be modified. */
+ plugins: [] /* Custom plugin to extend the functionality of Hvigor. */
+=======
system: appTasks, /* Built-in plugin of Hvigor. It cannot be modified. */
- plugins:[] /* Custom plugin to extend the functionality of Hvigor. */
+ plugins: [] /* Custom plugin to extend the functionality of Hvigor. */
+>>>>>>> 589ae80f (Format the code format of the Sample project)
}
diff --git a/docs/Samples/FrameNodeSample/GenerateBundle/__tests__/App.test.tsx b/docs/Samples/FrameNodeSample/GenerateBundle/__tests__/App.test.tsx
index 5375d53c1a290981e85ba01a4298a7f408327290..515a9d4b5b89a34738b83daf73eb36c89e9a6e89 100644
--- a/docs/Samples/FrameNodeSample/GenerateBundle/__tests__/App.test.tsx
+++ b/docs/Samples/FrameNodeSample/GenerateBundle/__tests__/App.test.tsx
@@ -12,7 +12,7 @@ import React from 'react';
import App from '../App';
// Note: import explicitly to use the types shiped with jest.
-import {it} from '@jest/globals';
+import { it } from '@jest/globals';
// Note: test renderer must be required after react-native.
import renderer from 'react-test-renderer';
diff --git a/docs/Samples/FrameNodeSample/GenerateBundle/generate.config.js b/docs/Samples/FrameNodeSample/GenerateBundle/generate.config.js
index 3865f8c320a5f92a8e08b3eb2166bc6f714eb524..b385481b99bfc56d2eaba88691385e6b46d2afb4 100644
--- a/docs/Samples/FrameNodeSample/GenerateBundle/generate.config.js
+++ b/docs/Samples/FrameNodeSample/GenerateBundle/generate.config.js
@@ -5,24 +5,24 @@
* LICENSE-MIT file in the root directory of this source tree.
*/
-const {mergeConfig, getDefaultConfig} = require('@react-native/metro-config');
-const {createHarmonyMetroConfig} = require('@react-native-oh/react-native-harmony/metro.config');
+const { mergeConfig, getDefaultConfig } = require('@react-native/metro-config');
+const { createHarmonyMetroConfig } = require('@react-native-oh/react-native-harmony/metro.config');
const config = {
- transformer: {
- getTransformOptions: async () => ({
- transform: {
- experimentalImportSupport: false,
- inlineRequires: true,
- },
- }),
- },
+ transformer: {
+ getTransformOptions: async () => ({
+ transform: {
+ experimentalImportSupport: false,
+ inlineRequires: true,
+ },
+ }),
+ },
};
module.exports = mergeConfig(
- getDefaultConfig(__dirname),
- createHarmonyMetroConfig({
- reactNativeHarmonyPackageName: '@react-native-oh/react-native-harmony',
- }),
- config,
+ getDefaultConfig(__dirname),
+ createHarmonyMetroConfig({
+ reactNativeHarmonyPackageName: '@react-native-oh/react-native-harmony',
+ }),
+ config,
);
diff --git a/docs/Samples/FrameNodeSample/GenerateBundle/index.js b/docs/Samples/FrameNodeSample/GenerateBundle/index.js
index f5c0aa7a265623069f6e717e61bb72f99b7d8d51..5251caf86e76bf49a8537cad1da0b0a77b84bb1e 100644
--- a/docs/Samples/FrameNodeSample/GenerateBundle/index.js
+++ b/docs/Samples/FrameNodeSample/GenerateBundle/index.js
@@ -7,8 +7,8 @@
* @format
*/
-import {AppRegistry} from 'react-native';
+import { AppRegistry } from 'react-native';
import App from './App';
-import {name as appName} from './app.json';
+import { name as appName } from './app.json';
AppRegistry.registerComponent(appName, () => App);
diff --git a/docs/Samples/FrameNodeSample/GenerateBundle/metro.config.js b/docs/Samples/FrameNodeSample/GenerateBundle/metro.config.js
index 4655411918e1984e3af1b0a47eab7b2e5cea3fa9..2616e02bece85bd298efe7eb207bf4fee222567f 100644
--- a/docs/Samples/FrameNodeSample/GenerateBundle/metro.config.js
+++ b/docs/Samples/FrameNodeSample/GenerateBundle/metro.config.js
@@ -5,20 +5,20 @@
* LICENSE-MIT file in the root directory of this source tree.
*/
-const {mergeConfig, getDefaultConfig} = require('@react-native/metro-config');
-const {createHarmonyMetroConfig} = require('@react-native-oh/react-native-harmony/metro.config');
+const { mergeConfig, getDefaultConfig } = require('@react-native/metro-config');
+const { createHarmonyMetroConfig } = require('@react-native-oh/react-native-harmony/metro.config');
/**
-* @type {import("metro-config").ConfigT}
-*/
+ * @type {import("metro-config").ConfigT}
+ */
const config = {
transformer: {
- getTransformOptions: async () => ({
- transform: {
- experimentalImportSupport: false,
- inlineRequires: true,
- },
- }),
+ getTransformOptions: async () => ({
+ transform: {
+ experimentalImportSupport: false,
+ inlineRequires: true,
+ },
+ }),
},
};
diff --git a/docs/Samples/MutilBundleSample/FlightRN/App.tsx b/docs/Samples/MutilBundleSample/FlightRN/App.tsx
index 421a894db00f5377b9da68886a903c2d43cf5a7e..60ba819e5b9d18f462b787f441d1a06db03b8fb8 100644
--- a/docs/Samples/MutilBundleSample/FlightRN/App.tsx
+++ b/docs/Samples/MutilBundleSample/FlightRN/App.tsx
@@ -11,8 +11,8 @@ import { Text, View } from 'react-native';
const App = () => {
return (
-
- Here is the flight ticket page.
+
+ Here is the flight ticket page.
);
};
diff --git a/docs/Samples/MutilBundleSample/FlightRN/build/moduleId.js b/docs/Samples/MutilBundleSample/FlightRN/build/moduleId.js
index 3e2965b1559265874c06ceac1bb07158d4c85e61..0ccf64cb7dcdc4dccf4c79e51f65d35267afe6df 100644
--- a/docs/Samples/MutilBundleSample/FlightRN/build/moduleId.js
+++ b/docs/Samples/MutilBundleSample/FlightRN/build/moduleId.js
@@ -12,37 +12,39 @@ const basicModuleIds = require('./map/basicModuleIds.json');
const businessModuleIds = require('./map/businessModuleIds.json');
function getModuleId(projectRootPath, modulePath, bundleName) {
- const pathRelative = modulePath.substr(projectRootPath.length + 1);
- const moduleIds = bundleName === 'basic' ? basicModuleIds : businessModuleIds;
- const moduleId = MD5(pathRelative).toString();
- moduleIds[pathRelative] = moduleId;
- fs.writeFileSync(path.resolve(__dirname, `./map/${bundleName === 'basic' ? 'basicModuleIds' : 'businessModuleIds'}.json`), JSON.stringify(moduleIds));
- return moduleId;
+ const pathRelative = modulePath.substr(projectRootPath.length + 1);
+ const moduleIds = bundleName === 'basic' ? basicModuleIds : businessModuleIds;
+ const moduleId = MD5(pathRelative).toString();
+ moduleIds[pathRelative] = moduleId;
+ fs.writeFileSync(path.resolve(__dirname,
+ `./map/${bundleName === 'basic' ? 'basicModuleIds' : 'businessModuleIds'}.json`), JSON.stringify(moduleIds));
+ return moduleId;
}
function createModuleIdFactoryWrap(projectRootPath, bundleName) {
- return () => {
- return (path) => {
- const pathRelative = path.substr(projectRootPath.length + 1);
- const moduleId = basicModuleIds[pathRelative] || businessModuleIds[pathRelative] || getModuleId(projectRootPath, path, bundleName);
- return moduleId;
+ return () => {
+ return (path) => {
+ const pathRelative = path.substr(projectRootPath.length + 1);
+ const moduleId = basicModuleIds[pathRelative] || businessModuleIds[pathRelative] ||
+ getModuleId(projectRootPath, path, bundleName);
+ return moduleId;
+ };
};
- };
}
function postProcessModulesFilterWrap(projectRootPath) {
- // 返回false则不打入bundle中
- return (module) => {
- const modulePath = module.path;
- const pathRelative = modulePath.substr(projectRootPath.length + 1);
- const moduleId = basicModuleIds[pathRelative];
- if (pathRelative.indexOf('__prelude__') >= 0 ||
- pathRelative.indexOf(`node_modules${path.sep}@react-native${path.sep}polyfills`) >= 0 ||
- pathRelative.indexOf(`node_modules${path.sep}metro-runtime${path.sep}src${path.sep}polyfills`) >= 0) {
- return false;
- }
- return !moduleId
- };
+ // 返回false则不打入bundle中
+ return (module) => {
+ const modulePath = module.path;
+ const pathRelative = modulePath.substr(projectRootPath.length + 1);
+ const moduleId = basicModuleIds[pathRelative];
+ if (pathRelative.indexOf('__prelude__') >= 0 ||
+ pathRelative.indexOf(`node_modules${path.sep}@react-native${path.sep}polyfills`) >= 0 ||
+ pathRelative.indexOf(`node_modules${path.sep}metro-runtime${path.sep}src${path.sep}polyfills`) >= 0) {
+ return false;
+ }
+ return !moduleId
+ };
}
module.exports = { createModuleIdFactoryWrap, postProcessModulesFilterWrap };
diff --git a/docs/Samples/MutilBundleSample/FlightRN/bundles/flight.js b/docs/Samples/MutilBundleSample/FlightRN/bundles/flight.js
index 4922b773d8a626703eeb487030442e196c973888..e6fbd6352fe85c083291a299c32c4aa4776b95ea 100644
--- a/docs/Samples/MutilBundleSample/FlightRN/bundles/flight.js
+++ b/docs/Samples/MutilBundleSample/FlightRN/bundles/flight.js
@@ -5,7 +5,7 @@
* LICENSE-MIT file in the root directory of this source tree.
*/
-import {AppRegistry} from 'react-native';
+import { AppRegistry } from 'react-native';
import App from '../App';
AppRegistry.registerComponent('flight', () => App);
diff --git a/docs/Samples/MutilBundleSample/FlightRN/index.js b/docs/Samples/MutilBundleSample/FlightRN/index.js
index da3dc36015d21c94fcc303fddfe29b51c8f865ca..3eacc087d81fec0ee05c23209ee314c519c320b8 100644
--- a/docs/Samples/MutilBundleSample/FlightRN/index.js
+++ b/docs/Samples/MutilBundleSample/FlightRN/index.js
@@ -6,8 +6,8 @@
*
* @format
*/
-import {AppRegistry} from 'react-native';
-import {name as appName} from './app.json';
+import { AppRegistry } from 'react-native';
+import { name as appName } from './app.json';
import App from './App';
AppRegistry.registerComponent(appName, () => App);
diff --git a/docs/Samples/MutilBundleSample/FlightRN/metro.config.js b/docs/Samples/MutilBundleSample/FlightRN/metro.config.js
index 90f1f0d3ab9d606b51fc49ea5259fd4a1e6e0654..390abb520a0db2471bf8c7c557135dcce89548ac 100644
--- a/docs/Samples/MutilBundleSample/FlightRN/metro.config.js
+++ b/docs/Samples/MutilBundleSample/FlightRN/metro.config.js
@@ -5,25 +5,25 @@
* LICENSE-MIT file in the root directory of this source tree.
*/
-const {mergeConfig, getDefaultConfig} = require('@react-native/metro-config');
-const {createHarmonyMetroConfig} = require('@react-native-oh/react-native-harmony/metro.config');
+const { mergeConfig, getDefaultConfig } = require('@react-native/metro-config');
+const { createHarmonyMetroConfig } = require('@react-native-oh/react-native-harmony/metro.config');
/**
* @type {import("metro-config").ConfigT}
*/
const config = {
- // 清理metro缓存
- // resetCache: true,
- transformer: {
- getTransformOptions: async () => ({
- transform: {
- experimentalImportSupport: false,
- inlineRequires: true,
- },
- }),
- },
+ // 清理metro缓存
+ // resetCache: true,
+ transformer: {
+ getTransformOptions: async () => ({
+ transform: {
+ experimentalImportSupport: false,
+ inlineRequires: true,
+ },
+ }),
+ },
};
module.exports = mergeConfig(getDefaultConfig(__dirname), createHarmonyMetroConfig({
- reactNativeHarmonyPackageName: '@react-native-oh/react-native-harmony',
+ reactNativeHarmonyPackageName: '@react-native-oh/react-native-harmony',
}), config);
diff --git a/docs/Samples/MutilBundleSample/HotelRN/App.tsx b/docs/Samples/MutilBundleSample/HotelRN/App.tsx
index eb7693f6741565de8432e653d4c2dde295c6666e..7f281c9534e428ae0acc0f46c346bf35b69d4ae5 100644
--- a/docs/Samples/MutilBundleSample/HotelRN/App.tsx
+++ b/docs/Samples/MutilBundleSample/HotelRN/App.tsx
@@ -11,8 +11,8 @@ import { Text, View } from 'react-native';
const App = () => {
return (
-
- Here is the hotel page.
+
+ Here is the hotel page.
);
};
diff --git a/docs/Samples/MutilBundleSample/HotelRN/build/moduleId.js b/docs/Samples/MutilBundleSample/HotelRN/build/moduleId.js
index 3e2965b1559265874c06ceac1bb07158d4c85e61..0ccf64cb7dcdc4dccf4c79e51f65d35267afe6df 100644
--- a/docs/Samples/MutilBundleSample/HotelRN/build/moduleId.js
+++ b/docs/Samples/MutilBundleSample/HotelRN/build/moduleId.js
@@ -12,37 +12,39 @@ const basicModuleIds = require('./map/basicModuleIds.json');
const businessModuleIds = require('./map/businessModuleIds.json');
function getModuleId(projectRootPath, modulePath, bundleName) {
- const pathRelative = modulePath.substr(projectRootPath.length + 1);
- const moduleIds = bundleName === 'basic' ? basicModuleIds : businessModuleIds;
- const moduleId = MD5(pathRelative).toString();
- moduleIds[pathRelative] = moduleId;
- fs.writeFileSync(path.resolve(__dirname, `./map/${bundleName === 'basic' ? 'basicModuleIds' : 'businessModuleIds'}.json`), JSON.stringify(moduleIds));
- return moduleId;
+ const pathRelative = modulePath.substr(projectRootPath.length + 1);
+ const moduleIds = bundleName === 'basic' ? basicModuleIds : businessModuleIds;
+ const moduleId = MD5(pathRelative).toString();
+ moduleIds[pathRelative] = moduleId;
+ fs.writeFileSync(path.resolve(__dirname,
+ `./map/${bundleName === 'basic' ? 'basicModuleIds' : 'businessModuleIds'}.json`), JSON.stringify(moduleIds));
+ return moduleId;
}
function createModuleIdFactoryWrap(projectRootPath, bundleName) {
- return () => {
- return (path) => {
- const pathRelative = path.substr(projectRootPath.length + 1);
- const moduleId = basicModuleIds[pathRelative] || businessModuleIds[pathRelative] || getModuleId(projectRootPath, path, bundleName);
- return moduleId;
+ return () => {
+ return (path) => {
+ const pathRelative = path.substr(projectRootPath.length + 1);
+ const moduleId = basicModuleIds[pathRelative] || businessModuleIds[pathRelative] ||
+ getModuleId(projectRootPath, path, bundleName);
+ return moduleId;
+ };
};
- };
}
function postProcessModulesFilterWrap(projectRootPath) {
- // 返回false则不打入bundle中
- return (module) => {
- const modulePath = module.path;
- const pathRelative = modulePath.substr(projectRootPath.length + 1);
- const moduleId = basicModuleIds[pathRelative];
- if (pathRelative.indexOf('__prelude__') >= 0 ||
- pathRelative.indexOf(`node_modules${path.sep}@react-native${path.sep}polyfills`) >= 0 ||
- pathRelative.indexOf(`node_modules${path.sep}metro-runtime${path.sep}src${path.sep}polyfills`) >= 0) {
- return false;
- }
- return !moduleId
- };
+ // 返回false则不打入bundle中
+ return (module) => {
+ const modulePath = module.path;
+ const pathRelative = modulePath.substr(projectRootPath.length + 1);
+ const moduleId = basicModuleIds[pathRelative];
+ if (pathRelative.indexOf('__prelude__') >= 0 ||
+ pathRelative.indexOf(`node_modules${path.sep}@react-native${path.sep}polyfills`) >= 0 ||
+ pathRelative.indexOf(`node_modules${path.sep}metro-runtime${path.sep}src${path.sep}polyfills`) >= 0) {
+ return false;
+ }
+ return !moduleId
+ };
}
module.exports = { createModuleIdFactoryWrap, postProcessModulesFilterWrap };
diff --git a/docs/Samples/MutilBundleSample/HotelRN/bundles/hotel.js b/docs/Samples/MutilBundleSample/HotelRN/bundles/hotel.js
index 9fe290b2dea683543563c7c0b46923801ec3c71f..5863744f9c29f5e8a381e246455d5639f68741cb 100644
--- a/docs/Samples/MutilBundleSample/HotelRN/bundles/hotel.js
+++ b/docs/Samples/MutilBundleSample/HotelRN/bundles/hotel.js
@@ -5,7 +5,7 @@
* LICENSE-MIT file in the root directory of this source tree.
*/
-import {AppRegistry} from 'react-native';
+import { AppRegistry } from 'react-native';
import App from '../App';
AppRegistry.registerComponent('hotel', () => App);
diff --git a/docs/Samples/MutilBundleSample/HotelRN/index.js b/docs/Samples/MutilBundleSample/HotelRN/index.js
index da3dc36015d21c94fcc303fddfe29b51c8f865ca..3eacc087d81fec0ee05c23209ee314c519c320b8 100644
--- a/docs/Samples/MutilBundleSample/HotelRN/index.js
+++ b/docs/Samples/MutilBundleSample/HotelRN/index.js
@@ -6,8 +6,8 @@
*
* @format
*/
-import {AppRegistry} from 'react-native';
-import {name as appName} from './app.json';
+import { AppRegistry } from 'react-native';
+import { name as appName } from './app.json';
import App from './App';
AppRegistry.registerComponent(appName, () => App);
diff --git a/docs/Samples/MutilBundleSample/HotelRN/metro.config.js b/docs/Samples/MutilBundleSample/HotelRN/metro.config.js
index 90f1f0d3ab9d606b51fc49ea5259fd4a1e6e0654..390abb520a0db2471bf8c7c557135dcce89548ac 100644
--- a/docs/Samples/MutilBundleSample/HotelRN/metro.config.js
+++ b/docs/Samples/MutilBundleSample/HotelRN/metro.config.js
@@ -5,25 +5,25 @@
* LICENSE-MIT file in the root directory of this source tree.
*/
-const {mergeConfig, getDefaultConfig} = require('@react-native/metro-config');
-const {createHarmonyMetroConfig} = require('@react-native-oh/react-native-harmony/metro.config');
+const { mergeConfig, getDefaultConfig } = require('@react-native/metro-config');
+const { createHarmonyMetroConfig } = require('@react-native-oh/react-native-harmony/metro.config');
/**
* @type {import("metro-config").ConfigT}
*/
const config = {
- // 清理metro缓存
- // resetCache: true,
- transformer: {
- getTransformOptions: async () => ({
- transform: {
- experimentalImportSupport: false,
- inlineRequires: true,
- },
- }),
- },
+ // 清理metro缓存
+ // resetCache: true,
+ transformer: {
+ getTransformOptions: async () => ({
+ transform: {
+ experimentalImportSupport: false,
+ inlineRequires: true,
+ },
+ }),
+ },
};
module.exports = mergeConfig(getDefaultConfig(__dirname), createHarmonyMetroConfig({
- reactNativeHarmonyPackageName: '@react-native-oh/react-native-harmony',
+ reactNativeHarmonyPackageName: '@react-native-oh/react-native-harmony',
}), config);
diff --git a/docs/Samples/MutilBundleSample/NativeProject/AppScope/app.json5 b/docs/Samples/MutilBundleSample/NativeProject/AppScope/app.json5
index ef104cf6c22d09c462c01bea658dd1f399b4907d..ea39f7fd63d2a963960a6ebcdcf1a583ca206337 100644
--- a/docs/Samples/MutilBundleSample/NativeProject/AppScope/app.json5
+++ b/docs/Samples/MutilBundleSample/NativeProject/AppScope/app.json5
@@ -1,6 +1,6 @@
{
"app": {
- "bundleName": "com.reactnative.mutilbundle",
+ "bundleName": "com.example.mutilbundle",
"vendor": "example",
"versionCode": 1000000,
"versionName": "1.0.0",
diff --git a/docs/Samples/MutilBundleSample/NativeProject/entry/hvigorfile.ts b/docs/Samples/MutilBundleSample/NativeProject/entry/hvigorfile.ts
index d0f029bd2a2858b1701bf87bf3f67c00d5630c84..6650e7217be2e794b661d45f0d373a35d0026db4 100644
--- a/docs/Samples/MutilBundleSample/NativeProject/entry/hvigorfile.ts
+++ b/docs/Samples/MutilBundleSample/NativeProject/entry/hvigorfile.ts
@@ -8,6 +8,6 @@
import { hapTasks } from '@ohos/hvigor-ohos-plugin';
export default {
- system: hapTasks, /* Built-in plugin of Hvigor. It cannot be modified. */
- plugins:[] /* Custom plugin to extend the functionality of Hvigor. */
+ system: hapTasks, /* Built-in plugin of Hvigor. It cannot be modified. */
+ plugins: [] /* Custom plugin to extend the functionality of Hvigor. */
}
diff --git a/docs/Samples/MutilBundleSample/NativeProject/entry/src/main/ets/pages/Index.ets b/docs/Samples/MutilBundleSample/NativeProject/entry/src/main/ets/pages/Index.ets
index ae0f8441b23592afa874919d310d7be897ea22f1..d28ad7575aedf76f4ca14793f3821da5c4de6cf4 100644
--- a/docs/Samples/MutilBundleSample/NativeProject/entry/src/main/ets/pages/Index.ets
+++ b/docs/Samples/MutilBundleSample/NativeProject/entry/src/main/ets/pages/Index.ets
@@ -6,9 +6,7 @@
*/
import router from '@ohos.router';
-import {
- ResourceJSBundleProvider,
-} from '@rnoh/react-native-openharmony';
+import { ResourceJSBundleProvider, } from '@rnoh/react-native-openharmony';
import { RNInstanceManager } from "../rn/RNInstanceManager";
@Entry
diff --git a/docs/Samples/MutilBundleSample/NativeProject/entry/src/main/ets/rn/CustomRNComponent.ets b/docs/Samples/MutilBundleSample/NativeProject/entry/src/main/ets/rn/CustomRNComponent.ets
index bca58e804aea44ec0140897470b6dc897799c2ab..5aa2c592dabe799901e7adcd13c2b63338018f42 100644
--- a/docs/Samples/MutilBundleSample/NativeProject/entry/src/main/ets/rn/CustomRNComponent.ets
+++ b/docs/Samples/MutilBundleSample/NativeProject/entry/src/main/ets/rn/CustomRNComponent.ets
@@ -5,14 +5,13 @@
* LICENSE-MIT file in the root directory of this source tree.
*/
-import {
- ComponentBuilderContext,
-} from '@rnoh/react-native-openharmony';
+import { ComponentBuilderContext, } from '@rnoh/react-native-openharmony';
@Builder
export function buildCustomRNComponent(ctx: ComponentBuilderContext) {
- Stack() {}
- .position({x:0, y: 0})
+ Stack() {
+ }
+ .position({ x: 0, y: 0 })
}
export const arkTsComponentNames: Array = [];
diff --git a/docs/Samples/MutilBundleSample/NativeProject/hvigorfile.ts b/docs/Samples/MutilBundleSample/NativeProject/hvigorfile.ts
index 549b0badab9ef99722e947c60855c7dd266ae506..15864d709a604c7a9db90b9afec84fc9f1ee044e 100644
--- a/docs/Samples/MutilBundleSample/NativeProject/hvigorfile.ts
+++ b/docs/Samples/MutilBundleSample/NativeProject/hvigorfile.ts
@@ -8,6 +8,11 @@
import { appTasks } from '@ohos/hvigor-ohos-plugin';
export default {
+<<<<<<< HEAD
+ system: appTasks, /* Built-in plugin of Hvigor. It cannot be modified. */
+ plugins: [] /* Custom plugin to extend the functionality of Hvigor. */
+=======
system: appTasks, /* Built-in plugin of Hvigor. It cannot be modified. */
- plugins:[] /* Custom plugin to extend the functionality of Hvigor. */
+ plugins: [] /* Custom plugin to extend the functionality of Hvigor. */
+>>>>>>> 589ae80f (Format the code format of the Sample project)
}
diff --git a/docs/Samples/RegisterFont/README.md b/docs/Samples/RegisterFont/README.md
index 5f95d7c0d3e9841f158af7dddbbffec6142d0141..3fb963acfa0d92c8f2328d325c2428024824885b 100644
--- a/docs/Samples/RegisterFont/README.md
+++ b/docs/Samples/RegisterFont/README.md
@@ -7,7 +7,7 @@
```
├── RegisterFontNativeProject
| └── Index.ets
-| ├── fontResourceByFontFamily # OpenHarmony 侧注册字体的方法1
+| ├── fontResourceByFontFamily #OpenHarmony 侧注册字体的方法1
| └── rnInstance.registerFont #OpenHarmony 侧自定义注册字体的方法2,随时可以注册字体文件
└── RegisterFontRnProject
└── example.tsx # React Native 侧展示使用字体的效果
diff --git a/docs/Samples/RegisterFont/RegisterFontNativeProject/AppScope/app.json5 b/docs/Samples/RegisterFont/RegisterFontNativeProject/AppScope/app.json5
index 4b98ef7cab7b5bd7838d9ab630b9b66148a40da2..42caa4225a42aa6a3b2c4ef9c42b6e8a687f801a 100644
--- a/docs/Samples/RegisterFont/RegisterFontNativeProject/AppScope/app.json5
+++ b/docs/Samples/RegisterFont/RegisterFontNativeProject/AppScope/app.json5
@@ -1,6 +1,6 @@
{
"app": {
- "bundleName": "com.example.myapplication",
+ "bundleName": "com.example.registerfont",
"vendor": "example",
"versionCode": 1000000,
"versionName": "1.0.0",
diff --git a/docs/Samples/RegisterFont/RegisterFontNativeProject/entry/hvigorfile.ts b/docs/Samples/RegisterFont/RegisterFontNativeProject/entry/hvigorfile.ts
index 4a1a975c3b7491258f5ff7278660b08d260ee8d3..e570e90e8decfddb61acdbaf0c9e6b983edddb23 100644
--- a/docs/Samples/RegisterFont/RegisterFontNativeProject/entry/hvigorfile.ts
+++ b/docs/Samples/RegisterFont/RegisterFontNativeProject/entry/hvigorfile.ts
@@ -8,6 +8,6 @@
import { hapTasks } from '@ohos/hvigor-ohos-plugin';
export default {
- system: hapTasks, /* Built-in plugin of Hvigor. It cannot be modified. */
- plugins:[] /* Custom plugin to extend the functionality of Hvigor. */
+ system: hapTasks, /* Built-in plugin of Hvigor. It cannot be modified. */
+ plugins: [] /* Custom plugin to extend the functionality of Hvigor. */
}
diff --git a/docs/Samples/RegisterFont/RegisterFontNativeProject/entry/src/main/ets/pages/Index.ets b/docs/Samples/RegisterFont/RegisterFontNativeProject/entry/src/main/ets/pages/Index.ets
index 6d4ebc22ef777d6dc4e9ae12c033305f6b8ebdbc..3f9b51794a1c62719edc920901a0aace7b38800f 100644
--- a/docs/Samples/RegisterFont/RegisterFontNativeProject/entry/src/main/ets/pages/Index.ets
+++ b/docs/Samples/RegisterFont/RegisterFontNativeProject/entry/src/main/ets/pages/Index.ets
@@ -21,7 +21,8 @@ import { createRNPackages } from '../RNPackagesFactory';
import fs from '@ohos.file.fs';
@Builder
-export function buildCustomRNComponent(ctx: ComponentBuilderContext) {};
+export function buildCustomRNComponent(ctx: ComponentBuilderContext) {
+};
const wrappedCustomRNComponentBuilder = wrapBuilder(buildCustomRNComponent);
@Entry
@@ -45,7 +46,6 @@ struct Index {
// when handled by RN
this.rnohCoreContext!.dispatchBackPress();
return true;
-
}
build() {
@@ -56,8 +56,8 @@ struct Index {
}
if (this.rnAbility) {
RNApp({
- rnInstanceConfig: {
- createRNPackages,
+ rnInstanceConfig: {
+ createRNPackages,
enableCAPIArchitecture: true,
arkTsComponentNames: [],
fontResourceByFontFamily: {
diff --git a/docs/Samples/RegisterFont/RegisterFontNativeProject/hvigorfile.ts b/docs/Samples/RegisterFont/RegisterFontNativeProject/hvigorfile.ts
index 035eea0cc548c925a1d81920e8e809fe57d6a4db..44bbe01097a3d4970037b397435c451f6d260669 100644
--- a/docs/Samples/RegisterFont/RegisterFontNativeProject/hvigorfile.ts
+++ b/docs/Samples/RegisterFont/RegisterFontNativeProject/hvigorfile.ts
@@ -8,6 +8,11 @@
import { appTasks } from '@ohos/hvigor-ohos-plugin';
export default {
+<<<<<<< HEAD
+ system: appTasks, /* Built-in plugin of Hvigor. It cannot be modified. */
+ plugins: [] /* Custom plugin to extend the functionality of Hvigor. */
+=======
system: appTasks, /* Built-in plugin of Hvigor. It cannot be modified. */
- plugins:[] /* Custom plugin to extend the functionality of Hvigor. */
+ plugins: [] /* Custom plugin to extend the functionality of Hvigor. */
+>>>>>>> 589ae80f (Format the code format of the Sample project)
}
diff --git a/docs/Samples/RegisterFont/RegisterFontRnProject/__tests__/App.test.tsx b/docs/Samples/RegisterFont/RegisterFontRnProject/__tests__/App.test.tsx
index 5375d53c1a290981e85ba01a4298a7f408327290..515a9d4b5b89a34738b83daf73eb36c89e9a6e89 100644
--- a/docs/Samples/RegisterFont/RegisterFontRnProject/__tests__/App.test.tsx
+++ b/docs/Samples/RegisterFont/RegisterFontRnProject/__tests__/App.test.tsx
@@ -12,7 +12,7 @@ import React from 'react';
import App from '../App';
// Note: import explicitly to use the types shiped with jest.
-import {it} from '@jest/globals';
+import { it } from '@jest/globals';
// Note: test renderer must be required after react-native.
import renderer from 'react-test-renderer';
diff --git a/docs/Samples/RegisterFont/RegisterFontRnProject/index.js b/docs/Samples/RegisterFont/RegisterFontRnProject/index.js
index bf1a9890052fe5417029ca1416b1e42d2b781324..e811804d1026eb4f63e537d16cdc57e8125efe6a 100644
--- a/docs/Samples/RegisterFont/RegisterFontRnProject/index.js
+++ b/docs/Samples/RegisterFont/RegisterFontRnProject/index.js
@@ -5,7 +5,7 @@
* LICENSE-MIT file in the root directory of this source tree.
*/
-import {AppRegistry} from 'react-native';
+import { AppRegistry } from 'react-native';
import App from './src/bundles/RegisterFont/examples';
AppRegistry.registerComponent('RegisterFont', () => App);
\ No newline at end of file
diff --git a/docs/Samples/RegisterFont/RegisterFontRnProject/metro.config.js b/docs/Samples/RegisterFont/RegisterFontRnProject/metro.config.js
index 872aa76384801ee14e66fff061ce09a8195e437b..357ba23d4f35eb4774f8855b485f5d7ee371f6a9 100644
--- a/docs/Samples/RegisterFont/RegisterFontRnProject/metro.config.js
+++ b/docs/Samples/RegisterFont/RegisterFontRnProject/metro.config.js
@@ -5,23 +5,23 @@
* LICENSE-MIT file in the root directory of this source tree.
*/
-const {mergeConfig, getDefaultConfig} = require('@react-native/metro-config');
-const {createHarmonyMetroConfig} = require('@react-native-oh/react-native-harmony/metro.config');
+const { mergeConfig, getDefaultConfig } = require('@react-native/metro-config');
+const { createHarmonyMetroConfig } = require('@react-native-oh/react-native-harmony/metro.config');
/**
* @type {import("metro-config").ConfigT}
*/
const config = {
- transformer: {
- getTransformOptions: async () => ({
- transform: {
- experimentalImportSupport: false,
- inlineRequires: true,
- },
- }),
- },
+ transformer: {
+ getTransformOptions: async () => ({
+ transform: {
+ experimentalImportSupport: false,
+ inlineRequires: true,
+ },
+ }),
+ },
};
module.exports = mergeConfig(getDefaultConfig(__dirname), createHarmonyMetroConfig({
- reactNativeHarmonyPackageName: '@react-native-oh/react-native-harmony',
+ reactNativeHarmonyPackageName: '@react-native-oh/react-native-harmony',
}), config);
diff --git a/docs/Samples/RegisterFont/RegisterFontRnProject/registerFont.config.js b/docs/Samples/RegisterFont/RegisterFontRnProject/registerFont.config.js
index 63b5449e8489af1d40ce81f3fba313b333abbfde..39de0cae149ef80174c1daa404396d286a095e7c 100644
--- a/docs/Samples/RegisterFont/RegisterFontRnProject/registerFont.config.js
+++ b/docs/Samples/RegisterFont/RegisterFontRnProject/registerFont.config.js
@@ -5,24 +5,24 @@
* LICENSE-MIT file in the root directory of this source tree.
*/
-const {mergeConfig, getDefaultConfig} = require('@react-native/metro-config');
-const {createHarmonyMetroConfig} = require('@react-native-oh/react-native-harmony/metro.config');
+const { mergeConfig, getDefaultConfig } = require('@react-native/metro-config');
+const { createHarmonyMetroConfig } = require('@react-native-oh/react-native-harmony/metro.config');
const config = {
- transformer: {
- getTransformOptions: async () => ({
- transform: {
- experimentalImportSupport: false,
- inlineRequires: true,
- },
- }),
- },
+ transformer: {
+ getTransformOptions: async () => ({
+ transform: {
+ experimentalImportSupport: false,
+ inlineRequires: true,
+ },
+ }),
+ },
};
module.exports = mergeConfig(
- getDefaultConfig(__dirname),
- createHarmonyMetroConfig({
- reactNativeHarmonyPackageName: '@react-native-oh/react-native-harmony',
- }),
- config,
+ getDefaultConfig(__dirname),
+ createHarmonyMetroConfig({
+ reactNativeHarmonyPackageName: '@react-native-oh/react-native-harmony',
+ }),
+ config,
);
diff --git a/docs/Samples/RegisterFont/RegisterFontRnProject/src/bundles/RegisterFont/examples.tsx b/docs/Samples/RegisterFont/RegisterFontRnProject/src/bundles/RegisterFont/examples.tsx
index 802a73972cbc40f45e462dfad21ec8bd19ad3efc..31dff25cc3aa5a5d98019f8e33abcf7a8888676b 100644
--- a/docs/Samples/RegisterFont/RegisterFontRnProject/src/bundles/RegisterFont/examples.tsx
+++ b/docs/Samples/RegisterFont/RegisterFontRnProject/src/bundles/RegisterFont/examples.tsx
@@ -6,7 +6,7 @@
*/
import React from 'react';
-import {Text, View, StyleSheet} from 'react-native';
+import { Text, View, StyleSheet } from 'react-native';
const styles = StyleSheet.create({
//创建样式
@@ -29,11 +29,11 @@ const RegisterFont = () => {
文字测试---默认字体
-
- 文字测试---Pacifico-Regular
+
+ 文字测试---Pacifico-Regular
-
- 文字测试---StintUltraCondensed-Regular
+
+ 文字测试---StintUltraCondensed-Regular
);
diff --git a/docs/Samples/RootTagSample/NativeProject/AppScope/app.json5 b/docs/Samples/RootTagSample/NativeProject/AppScope/app.json5
index b1f2a5955e5edea12691059baa1cbe276a78c59e..281dd10aa4899abfd30594bda0f248603b712757 100644
--- a/docs/Samples/RootTagSample/NativeProject/AppScope/app.json5
+++ b/docs/Samples/RootTagSample/NativeProject/AppScope/app.json5
@@ -1,6 +1,6 @@
{
"app": {
- "bundleName": "com.example.sampleApp",
+ "bundleName": "com.example.roottag",
"vendor": "example",
"versionCode": 1000000,
"versionName": "1.0.0",
diff --git a/docs/Samples/RootTagSample/NativeProject/entry/hvigorfile.ts b/docs/Samples/RootTagSample/NativeProject/entry/hvigorfile.ts
index d0f029bd2a2858b1701bf87bf3f67c00d5630c84..6650e7217be2e794b661d45f0d373a35d0026db4 100644
--- a/docs/Samples/RootTagSample/NativeProject/entry/hvigorfile.ts
+++ b/docs/Samples/RootTagSample/NativeProject/entry/hvigorfile.ts
@@ -8,6 +8,6 @@
import { hapTasks } from '@ohos/hvigor-ohos-plugin';
export default {
- system: hapTasks, /* Built-in plugin of Hvigor. It cannot be modified. */
- plugins:[] /* Custom plugin to extend the functionality of Hvigor. */
+ system: hapTasks, /* Built-in plugin of Hvigor. It cannot be modified. */
+ plugins: [] /* Custom plugin to extend the functionality of Hvigor. */
}
diff --git a/docs/Samples/RootTagSample/NativeProject/entry/src/main/ets/entryability/EntryAbility.ets b/docs/Samples/RootTagSample/NativeProject/entry/src/main/ets/entryability/EntryAbility.ets
index 59ae400a8dcebdc8f612754b072ebbd809411061..32cb381b9261746b743783dcad12817d97e004bc 100644
--- a/docs/Samples/RootTagSample/NativeProject/entry/src/main/ets/entryability/EntryAbility.ets
+++ b/docs/Samples/RootTagSample/NativeProject/entry/src/main/ets/entryability/EntryAbility.ets
@@ -6,7 +6,6 @@
*/
import { RNAbility, } from '@rnoh/react-native-openharmony';
-
import dataPreferences from '@ohos.data.preferences';
import window from '@ohos.window';
@@ -27,7 +26,6 @@ export default class EntryAbility extends RNAbility {
} catch (err) {
console.error('Failed to get preferences');
}
-
AppStorage.setOrCreate('RNAbility', this);
}
}
diff --git a/docs/Samples/RootTagSample/NativeProject/entry/src/main/ets/pages/Index.ets b/docs/Samples/RootTagSample/NativeProject/entry/src/main/ets/pages/Index.ets
index 6fafb1ef90835b8536814ebce97a694cf79e48a5..c46722b3b0628eff384835cc50282f7ffc58ef95 100644
--- a/docs/Samples/RootTagSample/NativeProject/entry/src/main/ets/pages/Index.ets
+++ b/docs/Samples/RootTagSample/NativeProject/entry/src/main/ets/pages/Index.ets
@@ -21,7 +21,8 @@ import {
@Builder
function buildCustomComponent(ctx: ComponentBuilderContext) {
- Stack() {}
+ Stack() {
+ }
.position({ x: 0, y: 0 })
}
@@ -57,62 +58,66 @@ export struct Index {
enableCAPIArchitecture: true,
arkTsComponentNames: []
});
- await this.instance.runJSBundle(new ResourceJSBundleProvider(getContext().resourceManager, this.bundlePath)).then(() => {
- this.isBundleReady = true;
- })
-
+ await this.instance.runJSBundle(new ResourceJSBundleProvider(getContext().resourceManager, this.bundlePath))
+ .then(() => {
+ this.isBundleReady = true;
+ })
}
build() {
NavDestination() {
if (this.isBundleReady) {
- Column() {
- Row() {
- RNSurface({
- surfaceConfig: {
- appKey: 'Hotel_Page',
- },
- ctx: new RNComponentContext(
- RNOHContext.fromCoreContext(this.rnohCoreContext!, this.instance),
- wrappedCustomRNComponentBuilder,
- wrapBuilder(buildRNComponentForTag),
- new Map()
- ),
- updateViewRootTag: (rnInstance: RNInstance, rootViewTag: Tag) => {
- // 将当前RNSurface的RNInstance和rootTag保存起来
- this.receivedRootTag = rootViewTag;
- this.receivedInstance = rnInstance;
- }
- })
- }
- .height("45%")
- Row() {
- Button("CLICK ME")
- .onClick(() => {
- // 向RN发送消息
- this.instance?.emitDeviceEvent("clickEvent", { params: ({
- rootTag: this.receivedRootTag
- } as Params) })
+ Column() {
+ Row() {
+ RNSurface({
+ surfaceConfig: {
+ appKey: 'Hotel_Page',
+ },
+ ctx: new RNComponentContext(
+ RNOHContext.fromCoreContext(this.rnohCoreContext!, this.instance),
+ wrappedCustomRNComponentBuilder,
+ wrapBuilder(buildRNComponentForTag),
+ new Map()
+ ),
+ updateViewRootTag: (rnInstance: RNInstance, rootViewTag: Tag) => {
+ // 将当前RNSurface的RNInstance和rootTag保存起来
+ this.receivedRootTag = rootViewTag;
+ this.receivedInstance = rnInstance;
+ }
})
+ }
+ .height("45%")
+
+ Row() {
+ Button("CLICK ME")
+ .onClick(() => {
+ // 向RN发送消息
+ this.instance?.emitDeviceEvent("clickEvent", {
+ params: ({
+ rootTag: this.receivedRootTag
+ } as Params)
+ })
+ })
+ }
+ .height("10%")
+
+ Row() {
+ RNSurface({
+ surfaceConfig: {
+ appKey: 'Ticket_Page',
+ },
+ ctx: new RNComponentContext(
+ RNOHContext.fromCoreContext(this.rnohCoreContext!, this.instance),
+ wrappedCustomRNComponentBuilder,
+ wrapBuilder(buildRNComponentForTag),
+ new Map()
+ ),
+ })
+ }
+ .height("45%")
}
- .height("10%")
- Row() {
- RNSurface({
- surfaceConfig: {
- appKey: 'Ticket_Page',
- },
- ctx: new RNComponentContext(
- RNOHContext.fromCoreContext(this.rnohCoreContext!, this.instance),
- wrappedCustomRNComponentBuilder,
- wrapBuilder(buildRNComponentForTag),
- new Map()
- ),
- })
- }
- .height("45%")
- }
- .width('100%')
- .height('100%')
+ .width('100%')
+ .height('100%')
}
}
}
diff --git a/docs/Samples/RootTagSample/NativeProject/hvigorfile.ts b/docs/Samples/RootTagSample/NativeProject/hvigorfile.ts
index 549b0badab9ef99722e947c60855c7dd266ae506..3ba030761c1b3d33a633b8c22b41961b782bf7b2 100644
--- a/docs/Samples/RootTagSample/NativeProject/hvigorfile.ts
+++ b/docs/Samples/RootTagSample/NativeProject/hvigorfile.ts
@@ -8,6 +8,6 @@
import { appTasks } from '@ohos/hvigor-ohos-plugin';
export default {
- system: appTasks, /* Built-in plugin of Hvigor. It cannot be modified. */
- plugins:[] /* Custom plugin to extend the functionality of Hvigor. */
+ system: appTasks, /* Built-in plugin of Hvigor. It cannot be modified. */
+ plugins: [] /* Custom plugin to extend the functionality of Hvigor. */
}
diff --git a/docs/Samples/RootTagSample/ReactProject/bundle.config.js b/docs/Samples/RootTagSample/ReactProject/bundle.config.js
index 025518477d890f14d83a5b2571318ebff4cdf662..5fb379d24099143b1387cffdf493fc2412c4d745 100644
--- a/docs/Samples/RootTagSample/ReactProject/bundle.config.js
+++ b/docs/Samples/RootTagSample/ReactProject/bundle.config.js
@@ -5,8 +5,8 @@
* LICENSE-MIT file in the root directory of this source tree.
*/
-const {mergeConfig, getDefaultConfig} = require('@react-native/metro-config');
-const {createHarmonyMetroConfig} = require('@react-native-oh/react-native-harmony/metro.config');
+const { mergeConfig, getDefaultConfig } = require('@react-native/metro-config');
+const { createHarmonyMetroConfig } = require('@react-native-oh/react-native-harmony/metro.config');
module.exports = mergeConfig(getDefaultConfig(__dirname), createHarmonyMetroConfig({
reactNativeHarmonyPackageName: '@react-native-oh/react-native-harmony',
diff --git a/docs/Samples/RootTagSample/ReactProject/index.js b/docs/Samples/RootTagSample/ReactProject/index.js
index 8a46591daf522173aa02ae379cb8c76cbf53b6db..af3b1746db4bd270a4a3f804c861eac94f576c13 100644
--- a/docs/Samples/RootTagSample/ReactProject/index.js
+++ b/docs/Samples/RootTagSample/ReactProject/index.js
@@ -5,7 +5,7 @@
* LICENSE-MIT file in the root directory of this source tree.
*/
-import {AppRegistry} from 'react-native';
+import { AppRegistry } from 'react-native';
import Hotel_Page from './src/Hotel_Page';
import Ticket_Page from './src/Ticket_Page';
diff --git a/docs/Samples/RootTagSample/ReactProject/metro.config.js b/docs/Samples/RootTagSample/ReactProject/metro.config.js
index c8d6579789792beb12445eca5d5c879bdce967b3..45508b0a05e8757e14baf97cec5c94047c9cd8be 100644
--- a/docs/Samples/RootTagSample/ReactProject/metro.config.js
+++ b/docs/Samples/RootTagSample/ReactProject/metro.config.js
@@ -5,23 +5,23 @@
* LICENSE-MIT file in the root directory of this source tree.
*/
-const {mergeConfig, getDefaultConfig} = require('@react-native/metro-config');
-const {createHarmonyMetroConfig} = require('@react-native-oh/react-native-harmony/metro.config');
+const { mergeConfig, getDefaultConfig } = require('@react-native/metro-config');
+const { createHarmonyMetroConfig } = require('@react-native-oh/react-native-harmony/metro.config');
/**
* @type {import("metro-config").ConfigT}
*/
const config = {
- transformer: {
- getTransformOptions: async () => ({
- transform: {
- experimentalImportSupport: false,
- inlineRequires: true,
- },
- }),
- },
+ transformer: {
+ getTransformOptions: async () => ({
+ transform: {
+ experimentalImportSupport: false,
+ inlineRequires: true,
+ },
+ }),
+ },
};
module.exports = mergeConfig(getDefaultConfig(__dirname), createHarmonyMetroConfig({
- reactNativeHarmonyPackageName: '@react-native-oh/react-native-harmony',
+ reactNativeHarmonyPackageName: '@react-native-oh/react-native-harmony',
}), config);
diff --git a/docs/Samples/RootTagSample/ReactProject/src/Hotel_Page.tsx b/docs/Samples/RootTagSample/ReactProject/src/Hotel_Page.tsx
index af412b271daf2fbdfa62c99d637ff0168ac5a08b..ebe79d9ba88c47711678dc2621ab72ba03b1b802 100644
--- a/docs/Samples/RootTagSample/ReactProject/src/Hotel_Page.tsx
+++ b/docs/Samples/RootTagSample/ReactProject/src/Hotel_Page.tsx
@@ -19,9 +19,9 @@ const Hotel_Page = () => {
}, 1000)
})
return (
-
- Here is the hotel page.
- {msg}
+
+ Here is the hotel page.
+ {msg}
);
};
diff --git a/docs/Samples/RootTagSample/ReactProject/src/Ticket_Page.tsx b/docs/Samples/RootTagSample/ReactProject/src/Ticket_Page.tsx
index b70be1f31b401161f0438183914dc077f7ee2984..ad42ec8b8113680c57a1a13e01cd30fed7f7196c 100644
--- a/docs/Samples/RootTagSample/ReactProject/src/Ticket_Page.tsx
+++ b/docs/Samples/RootTagSample/ReactProject/src/Ticket_Page.tsx
@@ -19,9 +19,9 @@ const Ticket_Page = () => {
}, 1000)
})
return (
-
- Here is the flight ticket page.
- {msg}
+
+ Here is the flight ticket page.
+ {msg}
);
};
diff --git a/docs/Samples/Sample/SampleApp/entry/hvigorfile.ts b/docs/Samples/Sample/SampleApp/entry/hvigorfile.ts
index 4a1a975c3b7491258f5ff7278660b08d260ee8d3..e570e90e8decfddb61acdbaf0c9e6b983edddb23 100644
--- a/docs/Samples/Sample/SampleApp/entry/hvigorfile.ts
+++ b/docs/Samples/Sample/SampleApp/entry/hvigorfile.ts
@@ -8,6 +8,6 @@
import { hapTasks } from '@ohos/hvigor-ohos-plugin';
export default {
- system: hapTasks, /* Built-in plugin of Hvigor. It cannot be modified. */
- plugins:[] /* Custom plugin to extend the functionality of Hvigor. */
+ system: hapTasks, /* Built-in plugin of Hvigor. It cannot be modified. */
+ plugins: [] /* Custom plugin to extend the functionality of Hvigor. */
}
diff --git a/docs/Samples/Sample/SampleApp/entry/src/main/cpp/ButtonView/ButtonNode.cpp b/docs/Samples/Sample/SampleApp/entry/src/main/cpp/ButtonView/ButtonNode.cpp
index 014334a2485a70f957b89c80c1494323a6bd085d..c12cc7f037c39042e2600a35799214a46d2adb9f 100644
--- a/docs/Samples/Sample/SampleApp/entry/src/main/cpp/ButtonView/ButtonNode.cpp
+++ b/docs/Samples/Sample/SampleApp/entry/src/main/cpp/ButtonView/ButtonNode.cpp
@@ -26,7 +26,6 @@ ButtonNode::~ButtonNode() {
}
}
-
ButtonNode& ButtonNode::setButtonNodeDelegate(
ButtonNodeDelegate* buttonNodeDelegate) {
m_buttonNodeDelegate = buttonNodeDelegate;
diff --git a/docs/Samples/Sample/SampleApp/entry/src/main/cpp/ButtonView/ButtonViewComponentDescriptor.h b/docs/Samples/Sample/SampleApp/entry/src/main/cpp/ButtonView/ButtonViewComponentDescriptor.h
index f49df24217be866c3fa3d1f9612410f8e294501b..d4ddc91da7c95a4cde9e38881d087e90c25acdee 100644
--- a/docs/Samples/Sample/SampleApp/entry/src/main/cpp/ButtonView/ButtonViewComponentDescriptor.h
+++ b/docs/Samples/Sample/SampleApp/entry/src/main/cpp/ButtonView/ButtonViewComponentDescriptor.h
@@ -5,7 +5,6 @@
* LICENSE-MIT file in the root directory of this source tree.
*/
-
#pragma once
#include
diff --git a/docs/Samples/Sample/SampleApp/entry/src/main/cpp/ButtonView/ButtonViewEventEmitter.cpp b/docs/Samples/Sample/SampleApp/entry/src/main/cpp/ButtonView/ButtonViewEventEmitter.cpp
index a352f200c119ae5fa5366fba695bffdc0e8e09b1..5cbfd33e69ae2f0b9b8e40da424bc60c3b81e2c2 100644
--- a/docs/Samples/Sample/SampleApp/entry/src/main/cpp/ButtonView/ButtonViewEventEmitter.cpp
+++ b/docs/Samples/Sample/SampleApp/entry/src/main/cpp/ButtonView/ButtonViewEventEmitter.cpp
@@ -5,8 +5,6 @@
* LICENSE-MIT file in the root directory of this source tree.
*/
-
-
#include "ButtonViewEventEmitter.h"
namespace facebook {
diff --git a/docs/Samples/Sample/SampleApp/entry/src/main/cpp/ButtonView/ButtonViewEventEmitter.h b/docs/Samples/Sample/SampleApp/entry/src/main/cpp/ButtonView/ButtonViewEventEmitter.h
index 39f30c81768b9d34f6428ba0d2b84376d366c04d..ec8d0b3dc18cdb9e5ad2e8723c5865a41471d2e7 100644
--- a/docs/Samples/Sample/SampleApp/entry/src/main/cpp/ButtonView/ButtonViewEventEmitter.h
+++ b/docs/Samples/Sample/SampleApp/entry/src/main/cpp/ButtonView/ButtonViewEventEmitter.h
@@ -5,7 +5,6 @@
* LICENSE-MIT file in the root directory of this source tree.
*/
-
#pragma once
#include
diff --git a/docs/Samples/Sample/SampleApp/entry/src/main/cpp/ButtonView/ButtonViewJSIBinder.h b/docs/Samples/Sample/SampleApp/entry/src/main/cpp/ButtonView/ButtonViewJSIBinder.h
index dbbff00eb54dfef1ccc0419bfd5567a56691b9d8..131a4eacb5350634e34339e87fd070ec55898577 100644
--- a/docs/Samples/Sample/SampleApp/entry/src/main/cpp/ButtonView/ButtonViewJSIBinder.h
+++ b/docs/Samples/Sample/SampleApp/entry/src/main/cpp/ButtonView/ButtonViewJSIBinder.h
@@ -5,7 +5,6 @@
* LICENSE-MIT file in the root directory of this source tree.
*/
-
#pragma once
#include "RNOHCorePackage/ComponentBinders/ViewComponentJSIBinder.h"
@@ -19,7 +18,6 @@ namespace rnoh {
facebook::jsi::Object createDirectEventTypes(facebook::jsi::Runtime &rt) override {
facebook::jsi::Object events(rt);
-
events.setProperty(rt, "topButtonClick", createDirectEvent(rt, "onButtonClick"));
return events;
}
diff --git a/docs/Samples/Sample/SampleApp/entry/src/main/cpp/Fabric/MarqueeViewComponentDescriptor.h b/docs/Samples/Sample/SampleApp/entry/src/main/cpp/Fabric/MarqueeViewComponentDescriptor.h
index af5e3330f39e03bb57a5ef42a119b50c68c9b263..a96fa215ba7dc75c1743a9a2434263dc332ea1ab 100644
--- a/docs/Samples/Sample/SampleApp/entry/src/main/cpp/Fabric/MarqueeViewComponentDescriptor.h
+++ b/docs/Samples/Sample/SampleApp/entry/src/main/cpp/Fabric/MarqueeViewComponentDescriptor.h
@@ -5,7 +5,6 @@
* LICENSE-MIT file in the root directory of this source tree.
*/
-
#pragma once
#include
diff --git a/docs/Samples/Sample/SampleApp/entry/src/main/cpp/Fabric/MarqueeViewEventEmitRequestHandler.h b/docs/Samples/Sample/SampleApp/entry/src/main/cpp/Fabric/MarqueeViewEventEmitRequestHandler.h
index e6ecc89270de1634d43961223363a37d41cc62de..e28abf079fb2fb60b0cec7de27d3782ff4508111 100644
--- a/docs/Samples/Sample/SampleApp/entry/src/main/cpp/Fabric/MarqueeViewEventEmitRequestHandler.h
+++ b/docs/Samples/Sample/SampleApp/entry/src/main/cpp/Fabric/MarqueeViewEventEmitRequestHandler.h
@@ -5,8 +5,6 @@
* LICENSE-MIT file in the root directory of this source tree.
*/
-
-
#pragma once
#include
#include "MarqueeViewEventEmitter.h"
diff --git a/docs/Samples/Sample/SampleApp/entry/src/main/cpp/Fabric/MarqueeViewEventEmitter.cpp b/docs/Samples/Sample/SampleApp/entry/src/main/cpp/Fabric/MarqueeViewEventEmitter.cpp
index 976a8505460a404fba55d95b753b33d91e2baf36..42e68030b2118c0449e24718d8cc747250933f17 100644
--- a/docs/Samples/Sample/SampleApp/entry/src/main/cpp/Fabric/MarqueeViewEventEmitter.cpp
+++ b/docs/Samples/Sample/SampleApp/entry/src/main/cpp/Fabric/MarqueeViewEventEmitter.cpp
@@ -5,8 +5,6 @@
* LICENSE-MIT file in the root directory of this source tree.
*/
-
-
#include "MarqueeViewEventEmitter.h"
namespace facebook {
diff --git a/docs/Samples/Sample/SampleApp/entry/src/main/cpp/Fabric/MarqueeViewEventEmitter.h b/docs/Samples/Sample/SampleApp/entry/src/main/cpp/Fabric/MarqueeViewEventEmitter.h
index 019e84f37fa2b235bda49cce8b55e4bae249df93..122dae423064a0eee02b70cd75101af958ab01a2 100644
--- a/docs/Samples/Sample/SampleApp/entry/src/main/cpp/Fabric/MarqueeViewEventEmitter.h
+++ b/docs/Samples/Sample/SampleApp/entry/src/main/cpp/Fabric/MarqueeViewEventEmitter.h
@@ -5,7 +5,6 @@
* LICENSE-MIT file in the root directory of this source tree.
*/
-
#pragma once
#include
diff --git a/docs/Samples/Sample/SampleApp/entry/src/main/cpp/Fabric/MarqueeViewJSIBinder.h b/docs/Samples/Sample/SampleApp/entry/src/main/cpp/Fabric/MarqueeViewJSIBinder.h
index 98a4f9ebf86f33c25d61d4a183846e3dde5c21d0..6f098b873345c25ed399cfec9802543a6a7da0eb 100644
--- a/docs/Samples/Sample/SampleApp/entry/src/main/cpp/Fabric/MarqueeViewJSIBinder.h
+++ b/docs/Samples/Sample/SampleApp/entry/src/main/cpp/Fabric/MarqueeViewJSIBinder.h
@@ -5,7 +5,6 @@
* LICENSE-MIT file in the root directory of this source tree.
*/
-
#pragma once
#include "RNOHCorePackage/ComponentBinders/ViewComponentJSIBinder.h"
diff --git a/docs/Samples/Sample/SampleApp/entry/src/main/cpp/Fabric/MarqueeViewNapiBinder.h b/docs/Samples/Sample/SampleApp/entry/src/main/cpp/Fabric/MarqueeViewNapiBinder.h
index 88dc63b13c942ce3dd9af132b976b2e3b3d090b0..f5196e3badf185f41f8be15b3f326661bb5b04e0 100644
--- a/docs/Samples/Sample/SampleApp/entry/src/main/cpp/Fabric/MarqueeViewNapiBinder.h
+++ b/docs/Samples/Sample/SampleApp/entry/src/main/cpp/Fabric/MarqueeViewNapiBinder.h
@@ -5,7 +5,6 @@
* LICENSE-MIT file in the root directory of this source tree.
*/
-
#pragma once
//#include "MarqueeViewComponentDescriptor.h"
#include "RNOHCorePackage/ComponentBinders/ViewComponentNapiBinder.h"
diff --git a/docs/Samples/Sample/SampleApp/entry/src/main/cpp/Fabric/Props.cpp b/docs/Samples/Sample/SampleApp/entry/src/main/cpp/Fabric/Props.cpp
index 45a36e8a7238b9a30a3d74691f2b63e80de29aa4..83619f144a8f445c36f7f99b596cc1ae54a9e4d8 100644
--- a/docs/Samples/Sample/SampleApp/entry/src/main/cpp/Fabric/Props.cpp
+++ b/docs/Samples/Sample/SampleApp/entry/src/main/cpp/Fabric/Props.cpp
@@ -5,8 +5,6 @@
* LICENSE-MIT file in the root directory of this source tree.
*/
-
-
#include
#include
#include
diff --git a/docs/Samples/Sample/SampleApp/entry/src/main/ets/TurboModule/SampleTurboModule.ets b/docs/Samples/Sample/SampleApp/entry/src/main/ets/TurboModule/SampleTurboModule.ets
index 767b695c3294ec32473a665afde23064bc9dc226..dcc48fa006267a1f305cb4fbae7cfd4542ca7301 100644
--- a/docs/Samples/Sample/SampleApp/entry/src/main/ets/TurboModule/SampleTurboModule.ets
+++ b/docs/Samples/Sample/SampleApp/entry/src/main/ets/TurboModule/SampleTurboModule.ets
@@ -47,7 +47,9 @@ export class SampleTurboModule extends TurboModule {
}
getPreferencesData(key: string): string {
- if (!preferences) return 'null';
+ if (!preferences) {
+ return 'null';
+ }
try {
let val = preferences.getSync(key, '默认值') as string
return val
@@ -57,7 +59,9 @@ export class SampleTurboModule extends TurboModule {
}
putPreferencesData(key: string, value: string) {
- if (!preferences) return;
+ if (!preferences) {
+ return;
+ }
preferences.putSync(key, value)
try {
preferences.flush((err: BusinessError) => {
diff --git a/docs/Samples/Sample/SampleApp/entry/src/main/ets/TurboModule/SampleTurboModule.ts b/docs/Samples/Sample/SampleApp/entry/src/main/ets/TurboModule/SampleTurboModule.ts
index 561cf7501857aa018daf47f05712357c7a4e8e7f..ae1f4104d71637f0d6f0fc8bf835a4cda5565d47 100644
--- a/docs/Samples/Sample/SampleApp/entry/src/main/ets/TurboModule/SampleTurboModule.ts
+++ b/docs/Samples/Sample/SampleApp/entry/src/main/ets/TurboModule/SampleTurboModule.ts
@@ -68,7 +68,9 @@ export class SampleTurboModule extends TurboModule {
}
getPreferencesData(key: string): string {
- if (!SampleTurboModule.preferences) return 'null';
+ if (!SampleTurboModule.preferences) {
+ return 'null';
+ }
try {
let val = SampleTurboModule.preferences.getSync(key, '默认值') as string
return val
@@ -78,7 +80,9 @@ export class SampleTurboModule extends TurboModule {
}
putPreferencesData(key: string, value: string) {
- if (!SampleTurboModule.preferences) return;
+ if (!SampleTurboModule.preferences) {
+ return;
+ }
SampleTurboModule.preferences.putSync(key, value)
try {
SampleTurboModule.preferences.flush((err: BusinessError) => {
diff --git a/docs/Samples/Sample/SampleApp/entry/src/main/ets/customView/MarqueeView.ets b/docs/Samples/Sample/SampleApp/entry/src/main/ets/customView/MarqueeView.ets
index b4f2016d99170a051a13a26f87055b03666197b1..cb6465c52a0834b757ee6176f20a764f4da53895 100644
--- a/docs/Samples/Sample/SampleApp/entry/src/main/ets/customView/MarqueeView.ets
+++ b/docs/Samples/Sample/SampleApp/entry/src/main/ets/customView/MarqueeView.ets
@@ -31,9 +31,10 @@ export struct MarqueeView {
this.start = true
this.descriptor = this.ctx.descriptorRegistry.getDescriptor(this.tag)
- this.unregisterDescriptorChangesListener = this.ctx.descriptorRegistry.subscribeToDescriptorChanges(this.tag, (newDescriptor) => {
- this.descriptor = (newDescriptor as MarqueeViewDescriptor)
- })
+ this.unregisterDescriptorChangesListener =
+ this.ctx.descriptorRegistry.subscribeToDescriptorChanges(this.tag, (newDescriptor) => {
+ this.descriptor = (newDescriptor as MarqueeViewDescriptor)
+ })
console.log('MarqueeView rawProps = ', JSON.stringify(this.descriptor.rawProps), this.tag)
console.log('MarqueeView props = ', JSON.stringify(this.descriptor.props), this.tag)
diff --git a/docs/Samples/Sample/SampleApp/entry/src/main/ets/entryability/EntryAbility.ets b/docs/Samples/Sample/SampleApp/entry/src/main/ets/entryability/EntryAbility.ets
index 6ae5159f0a2c2b15c9f80df87a5a2e96801edc8a..ef9873e1506c94bdab1a2ee489e2207dea1ae214 100644
--- a/docs/Samples/Sample/SampleApp/entry/src/main/ets/entryability/EntryAbility.ets
+++ b/docs/Samples/Sample/SampleApp/entry/src/main/ets/entryability/EntryAbility.ets
@@ -6,13 +6,11 @@
*/
import { RNAbility, } from '@rnoh/react-native-openharmony';
-
import dataPreferences from '@ohos.data.preferences'
import window from '@ohos.window';
export let preferences: dataPreferences.Preferences | null = null
-
export default class EntryAbility extends RNAbility {
getPagePath() {
return 'pages/Index';
diff --git a/docs/Samples/Sample/SampleApp/entry/src/main/ets/pages/Details.ets b/docs/Samples/Sample/SampleApp/entry/src/main/ets/pages/Details.ets
index 5cd9beaeec6d3fdb841123d9db77f6c7f559544c..f9bebe123eae5c638c5ba23f76cae74014091c7d 100644
--- a/docs/Samples/Sample/SampleApp/entry/src/main/ets/pages/Details.ets
+++ b/docs/Samples/Sample/SampleApp/entry/src/main/ets/pages/Details.ets
@@ -9,7 +9,6 @@ import { RNInstance } from '@rnoh/react-native-openharmony';
import { BaseRN, LoadManager } from '../rn';
import { MetroBaseRN } from '../rn/MetroBaseRN'
-
@Component
export default struct Details {
private instance: RNInstance = LoadManager.bpInstance
diff --git a/docs/Samples/Sample/SampleApp/entry/src/main/ets/pages/Index.ets b/docs/Samples/Sample/SampleApp/entry/src/main/ets/pages/Index.ets
index ad534c4a39e6ba1311aa4e62db0c8702371c9753..7ba62ef318cdb02ae2fd96187c3ebc9b8650caad 100644
--- a/docs/Samples/Sample/SampleApp/entry/src/main/ets/pages/Index.ets
+++ b/docs/Samples/Sample/SampleApp/entry/src/main/ets/pages/Index.ets
@@ -22,7 +22,6 @@ import { createRNPackages, LoadManager, buildCustomComponent } from '../rn';
import { ENABLE_CAPI_ARCHITECTURE } from '../rn'
import { arkTsComponentNames } from '../rn/LoadBundle';
-
@Entry()
@Component
struct Index {
@@ -37,7 +36,9 @@ struct Index {
}
aboutToAppear() {
- if (!this.rnohCoreContext) return;
+ if (!this.rnohCoreContext) {
+ return;
+ }
this.loadMetroBundle()
}
@@ -47,7 +48,9 @@ struct Index {
}
subscribeReload() {
- if (!this.rnohCoreContext) return;
+ if (!this.rnohCoreContext) {
+ return;
+ }
this.cleanUpCallbacks.forEach(cleanUp => cleanUp())
this.cleanUpCallbacks.push(this.rnohCoreContext!.devToolsController.eventEmitter.subscribe("RELOAD", async () => {
this.isBundleReady = false
@@ -76,12 +79,14 @@ struct Index {
})
})
- this.cleanUpCallbacks.push(LoadManager.metroInstance.getTurboModule(LogBoxTurboModule.NAME).eventEmitter.subscribe("SHOW", () => {
- this.logBoxDialogController.open()
- }))
- this.cleanUpCallbacks.push(LoadManager.metroInstance.getTurboModule(LogBoxTurboModule.NAME).eventEmitter.subscribe("HIDE", () => {
- this.logBoxDialogController.close()
- }))
+ this.cleanUpCallbacks.push(LoadManager.metroInstance.getTurboModule(LogBoxTurboModule.NAME).eventEmitter.subscribe("SHOW",
+ () => {
+ this.logBoxDialogController.open()
+ }))
+ this.cleanUpCallbacks.push(LoadManager.metroInstance.getTurboModule(LogBoxTurboModule.NAME).eventEmitter.subscribe("HIDE",
+ () => {
+ this.logBoxDialogController.close()
+ }))
}
loadMetroBundle() {
@@ -98,8 +103,9 @@ struct Index {
}
async register(): Promise