diff --git a/en/react-native-SmartRefreshLayout.md b/en/react-native-SmartRefreshLayout.md index a45cc9d6845729057fc613d021978692fcbda783..b6df0ec5d1cd9115608c2b5bc1ad7ccdc06d221c 100644 --- a/en/react-native-SmartRefreshLayout.md +++ b/en/react-native-SmartRefreshLayout.md @@ -340,6 +340,58 @@ Verified in the following versions. 2. RNOH: 0.72.33; SDK: HarmonyOS NEXT B1; IDE: DevEco Studio: 5.0.3.900; ROM: Next.0.0.71; 3. RNOH: 0.77.18; SDK: HarmonyOS 6.0.0 Release SDK; IDE: DevEco Studio 6.0.0.858; ROM: 6.0.0.112; +### Method for enabling the parallelization whitelist + +To use this repository, you need to use the correct React-Native and RNOH versions. In addition, you need to use DevEco Studio and the ROM on your phone. + +Verified in the following versions. + +1. RNOH: 0.72.101; SDK: HarmonyOS 6.0.2 Release SDK; IDE: DevEco Studio 6.0.2 Release; ROM: 6.0.0.129; +2. RNOH: 0.77.34; SDK: HarmonyOS 6.0.2 Release SDK; IDE: DevEco Studio 6.0.2 Release; ROM: 6.0.0.129; + + +Open the `entry/src/main/cpp/CMakeLists.txt` file and add the following code: + +```diff +project(rnapp) +cmake_minimum_required(VERSION 3.4.1) ++ set(PARALLELIZATION_ENABLE 1) +set(CMAKE_SKIP_BUILD_RPATH TRUE) +set(RNOH_APP_DIR "${CMAKE_CURRENT_SOURCE_DIR}") +set(NODE_MODULES "${CMAKE_CURRENT_SOURCE_DIR}/../../../../../node_modules") +set(RNOH_CPP_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../../../../../react-native-harmony/harmony/cpp") +set(LOG_VERBOSITY_LEVEL 1) +set(CMAKE_ASM_FLAGS "-Wno-error=unused-command-line-argument -Qunused-arguments") +set(CMAKE_CXX_FLAGS "-fstack-protector-strong -Wl,-z,relro,-z,now,-z,noexecstack -s -fPIE -pie") +set(WITH_HITRACE_SYSTRACE 1) # for other CMakeLists.txt files to use +add_compile_definitions(WITH_HITRACE_SYSTRACE) + +add_subdirectory("${RNOH_CPP_DIR}" ./rn) +``` + +Open the `entry/src/main/ets/pages/Index.ets` file and add the following code: + +```diff +@Entry +@Component +struct Index { + @StorageLink('RNOHCoreContext') private rnohCoreContext: RNOHCoreContext | undefined = undefined + @State shouldShow: boolean = false + private logger!: RNOHLogger + private context = this.getUIContext().getHostContext() as common.UIAbilityContext; + aboutToAppear() { + this.logger = this.rnohCoreContext!.logger.clone("Index") + const stopTracing = this.logger.clone("aboutToAppear").startTracing() + for (const customFont of fonts) { + font.registerFont(customFont) + } + + this.shouldShow = true ++ this.rnohCoreContext?.setParallelizationEnabled(true); + stopTracing() + } +``` + ## Properties > [!Tip] The **Platform** column indicates the platform where the properties are supported in the original third-party library. diff --git a/en/react-native-fast-image.md b/en/react-native-fast-image.md index 7fc22365a776503931f1e6d8905276cb3a711fef..a2e9a223f5b064b04ed1055fb47f2f841cb2209b 100644 --- a/en/react-native-fast-image.md +++ b/en/react-native-fast-image.md @@ -269,6 +269,59 @@ Verified in the following versions. 2. RNOH: 0.72.33; SDK: HarmonyOS NEXT B1; IDE: DevEco Studio: 5.0.3.900; ROM: Next.0.0.71; 3. RNOH: 0.77.18; SDK: HarmonyOS 6.0.0 Release SDK; IDE: DevEco Studio 6.0.0.858; ROM: 6.0.0.112; +### Method for enabling the parallelization whitelist + +To use this repository, you need to use the correct React-Native and RNOH versions. In addition, you need to use DevEco Studio and the ROM on your phone. + +Verified in the following versions. + +1. RNOH: 0.72.101; SDK: HarmonyOS 6.0.2 Release SDK; IDE: DevEco Studio 6.0.2 Release; ROM: 6.0.0.129; +2. RNOH: 0.77.34; SDK: HarmonyOS 6.0.2 Release SDK; IDE: DevEco Studio 6.0.2 Release; ROM: 6.0.0.129; + + +Open the `entry/src/main/cpp/CMakeLists.txt` file and add the following code: + +```diff +project(rnapp) +cmake_minimum_required(VERSION 3.4.1) ++ set(PARALLELIZATION_ENABLE 1) +set(CMAKE_SKIP_BUILD_RPATH TRUE) +set(RNOH_APP_DIR "${CMAKE_CURRENT_SOURCE_DIR}") +set(NODE_MODULES "${CMAKE_CURRENT_SOURCE_DIR}/../../../../../node_modules") +set(RNOH_CPP_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../../../../../react-native-harmony/harmony/cpp") +set(LOG_VERBOSITY_LEVEL 1) +set(CMAKE_ASM_FLAGS "-Wno-error=unused-command-line-argument -Qunused-arguments") +set(CMAKE_CXX_FLAGS "-fstack-protector-strong -Wl,-z,relro,-z,now,-z,noexecstack -s -fPIE -pie") +set(WITH_HITRACE_SYSTRACE 1) # for other CMakeLists.txt files to use +add_compile_definitions(WITH_HITRACE_SYSTRACE) + +add_subdirectory("${RNOH_CPP_DIR}" ./rn) +``` + +Open the `entry/src/main/ets/pages/Index.ets` file and add the following code: + +```diff +@Entry +@Component +struct Index { + @StorageLink('RNOHCoreContext') private rnohCoreContext: RNOHCoreContext | undefined = undefined + @State shouldShow: boolean = false + private logger!: RNOHLogger + private context = this.getUIContext().getHostContext() as common.UIAbilityContext; + aboutToAppear() { + this.logger = this.rnohCoreContext!.logger.clone("Index") + const stopTracing = this.logger.clone("aboutToAppear").startTracing() + for (const customFont of fonts) { + font.registerFont(customFont) + } + + this.shouldShow = true ++ this.rnohCoreContext?.setParallelizationEnabled(true); + stopTracing() + } +``` + + ## Properties > [!TIP] The **Platform** column indicates the platform where the properties are supported in the original third-party library. diff --git a/en/react-native-linear-gradient.md b/en/react-native-linear-gradient.md index 9cb6c9f5976635a12b0a041515bd689f4b8b7b31..bd7ec46c020d7eeded7500f3c244aa1cc70bc490 100644 --- a/en/react-native-linear-gradient.md +++ b/en/react-native-linear-gradient.md @@ -200,6 +200,58 @@ Then build and run the code. Check the release version information in the release address of the third-party library: [@react-native-ohos/react-native-linear-gradient Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-linear-gradient/releases) +### 3.2 Method for enabling the parallelization whitelist + +To use this repository, you need to use the correct React-Native and RNOH versions. In addition, you need to use DevEco Studio and the ROM on your phone. + +Verified in the following versions. + +1. RNOH: 0.72.101; SDK: HarmonyOS 6.0.2 Release SDK; IDE: DevEco Studio 6.0.2 Release; ROM: 6.0.0.129; +2. RNOH: 0.77.34; SDK: HarmonyOS 6.0.2 Release SDK; IDE: DevEco Studio 6.0.2 Release; ROM: 6.0.0.129; + + +Open the `entry/src/main/cpp/CMakeLists.txt` file and add the following code: + +```diff +project(rnapp) +cmake_minimum_required(VERSION 3.4.1) ++ set(PARALLELIZATION_ENABLE 1) +set(CMAKE_SKIP_BUILD_RPATH TRUE) +set(RNOH_APP_DIR "${CMAKE_CURRENT_SOURCE_DIR}") +set(NODE_MODULES "${CMAKE_CURRENT_SOURCE_DIR}/../../../../../node_modules") +set(RNOH_CPP_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../../../../../react-native-harmony/harmony/cpp") +set(LOG_VERBOSITY_LEVEL 1) +set(CMAKE_ASM_FLAGS "-Wno-error=unused-command-line-argument -Qunused-arguments") +set(CMAKE_CXX_FLAGS "-fstack-protector-strong -Wl,-z,relro,-z,now,-z,noexecstack -s -fPIE -pie") +set(WITH_HITRACE_SYSTRACE 1) # for other CMakeLists.txt files to use +add_compile_definitions(WITH_HITRACE_SYSTRACE) + +add_subdirectory("${RNOH_CPP_DIR}" ./rn) +``` + +Open the `entry/src/main/ets/pages/Index.ets` file and add the following code: + +```diff +@Entry +@Component +struct Index { + @StorageLink('RNOHCoreContext') private rnohCoreContext: RNOHCoreContext | undefined = undefined + @State shouldShow: boolean = false + private logger!: RNOHLogger + private context = this.getUIContext().getHostContext() as common.UIAbilityContext; + aboutToAppear() { + this.logger = this.rnohCoreContext!.logger.clone("Index") + const stopTracing = this.logger.clone("aboutToAppear").startTracing() + for (const customFont of fonts) { + font.registerFont(customFont) + } + + this.shouldShow = true ++ this.rnohCoreContext?.setParallelizationEnabled(true); + stopTracing() + } +``` + ## Properties > [!TIP] The Platform column indicates the platform where the properties are supported in the original third-party library. diff --git a/en/react-native-masked-view-masked-view.md b/en/react-native-masked-view-masked-view.md index d220ffbfd8b16d19fd434cf12d2f1d71ba6bc27e..09668e5d7711db6b75b45284d1d215a6d5176a80 100644 --- a/en/react-native-masked-view-masked-view.md +++ b/en/react-native-masked-view-masked-view.md @@ -271,6 +271,58 @@ Verified in the following versions. 2. RNOH: 0.72.33; SDK: HarmonyOS NEXT B1; IDE: DevEco Studio: 5.0.3.900; ROM: Next.0.0.71; 3. RNOH: 0.77.18; SDK: HarmonyOS 6.0.0 Release SDK; IDE: DevEco Studio 6.0.0.858; ROM: 6.0.0.112; +### Method for enabling the parallelization whitelist + +To use this repository, you need to use the correct React-Native and RNOH versions. In addition, you need to use DevEco Studio and the ROM on your phone. + +Verified in the following versions. + +1. RNOH: 0.72.101; SDK: HarmonyOS 6.0.2 Release SDK; IDE: DevEco Studio 6.0.2 Release; ROM: 6.0.0.129; +2. RNOH: 0.77.34; SDK: HarmonyOS 6.0.2 Release SDK; IDE: DevEco Studio 6.0.2 Release; ROM: 6.0.0.129; + + +Open the `entry/src/main/cpp/CMakeLists.txt` file and add the following code: + +```diff +project(rnapp) +cmake_minimum_required(VERSION 3.4.1) ++ set(PARALLELIZATION_ENABLE 1) +set(CMAKE_SKIP_BUILD_RPATH TRUE) +set(RNOH_APP_DIR "${CMAKE_CURRENT_SOURCE_DIR}") +set(NODE_MODULES "${CMAKE_CURRENT_SOURCE_DIR}/../../../../../node_modules") +set(RNOH_CPP_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../../../../../react-native-harmony/harmony/cpp") +set(LOG_VERBOSITY_LEVEL 1) +set(CMAKE_ASM_FLAGS "-Wno-error=unused-command-line-argument -Qunused-arguments") +set(CMAKE_CXX_FLAGS "-fstack-protector-strong -Wl,-z,relro,-z,now,-z,noexecstack -s -fPIE -pie") +set(WITH_HITRACE_SYSTRACE 1) # for other CMakeLists.txt files to use +add_compile_definitions(WITH_HITRACE_SYSTRACE) + +add_subdirectory("${RNOH_CPP_DIR}" ./rn) +``` + +Open the `entry/src/main/ets/pages/Index.ets` file and add the following code: + +```diff +@Entry +@Component +struct Index { + @StorageLink('RNOHCoreContext') private rnohCoreContext: RNOHCoreContext | undefined = undefined + @State shouldShow: boolean = false + private logger!: RNOHLogger + private context = this.getUIContext().getHostContext() as common.UIAbilityContext; + aboutToAppear() { + this.logger = this.rnohCoreContext!.logger.clone("Index") + const stopTracing = this.logger.clone("aboutToAppear").startTracing() + for (const customFont of fonts) { + font.registerFont(customFont) + } + + this.shouldShow = true ++ this.rnohCoreContext?.setParallelizationEnabled(true); + stopTracing() + } +``` + ## Properties > [!TIP] The **Platform** column indicates the platform where the properties are supported in the original third-party library. diff --git a/en/react-native-svg-capi.md b/en/react-native-svg-capi.md index 047dcd7c5cde195deb597d44c728f48bcb61f307..26f89f44d58ac551c793f7243f24057f6a30bab8 100644 --- a/en/react-native-svg-capi.md +++ b/en/react-native-svg-capi.md @@ -282,6 +282,58 @@ Verified in the following versions. 2. RNOH: 0.72.33; SDK: HarmonyOS NEXT B1; IDE: DevEco Studio: 5.0.3.900; ROM: Next.0.0.71; 3. RNOH: 0.77.18; SDK: HarmonyOS 6.0.0 Release SDK; IDE: DevEco Studio 6.0.0.858; ROM: 6.0.0.112; +### Method for enabling the parallelization whitelist + +To use this repository, you need to use the correct React-Native and RNOH versions. In addition, you need to use DevEco Studio and the ROM on your phone. + +Verified in the following versions. + +1. RNOH: 0.72.101; SDK: HarmonyOS 6.0.2 Release SDK; IDE: DevEco Studio 6.0.2 Release; ROM: 6.0.0.129; +2. RNOH: 0.77.34; SDK: HarmonyOS 6.0.2 Release SDK; IDE: DevEco Studio 6.0.2 Release; ROM: 6.0.0.129; + + +Open the `entry/src/main/cpp/CMakeLists.txt` file and add the following code: + +```diff +project(rnapp) +cmake_minimum_required(VERSION 3.4.1) ++ set(PARALLELIZATION_ENABLE 1) +set(CMAKE_SKIP_BUILD_RPATH TRUE) +set(RNOH_APP_DIR "${CMAKE_CURRENT_SOURCE_DIR}") +set(NODE_MODULES "${CMAKE_CURRENT_SOURCE_DIR}/../../../../../node_modules") +set(RNOH_CPP_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../../../../../react-native-harmony/harmony/cpp") +set(LOG_VERBOSITY_LEVEL 1) +set(CMAKE_ASM_FLAGS "-Wno-error=unused-command-line-argument -Qunused-arguments") +set(CMAKE_CXX_FLAGS "-fstack-protector-strong -Wl,-z,relro,-z,now,-z,noexecstack -s -fPIE -pie") +set(WITH_HITRACE_SYSTRACE 1) # for other CMakeLists.txt files to use +add_compile_definitions(WITH_HITRACE_SYSTRACE) + +add_subdirectory("${RNOH_CPP_DIR}" ./rn) +``` + +Open the `entry/src/main/ets/pages/Index.ets` file and add the following code: + +```diff +@Entry +@Component +struct Index { + @StorageLink('RNOHCoreContext') private rnohCoreContext: RNOHCoreContext | undefined = undefined + @State shouldShow: boolean = false + private logger!: RNOHLogger + private context = this.getUIContext().getHostContext() as common.UIAbilityContext; + aboutToAppear() { + this.logger = this.rnohCoreContext!.logger.clone("Index") + const stopTracing = this.logger.clone("aboutToAppear").startTracing() + for (const customFont of fonts) { + font.registerFont(customFont) + } + + this.shouldShow = true ++ this.rnohCoreContext?.setParallelizationEnabled(true); + stopTracing() + } +``` + ## Properties diff --git a/en/shopify-flash-list.md b/en/shopify-flash-list.md index 5721184d37eb268ba27a31532d4f90ae7c147f82..56050231ae3508a442f883c54b54c89a96b5ffc7 100644 --- a/en/shopify-flash-list.md +++ b/en/shopify-flash-list.md @@ -215,6 +215,58 @@ Verified in the following versions. 2. RNOH: 0.72.33; SDK: HarmonyOS NEXT B1; IDE: DevEco Studio: 5.0.3.900; ROM: Next.0.0.71; 3. RNOH: 0.77.18; SDK: HarmonyOS 6.0.0 Release SDK; IDE: DevEco Studio 6.0.0.858; ROM: 6.0.0.112; +### Method for enabling the parallelization whitelist + +To use this repository, you need to use the correct React-Native and RNOH versions. In addition, you need to use DevEco Studio and the ROM on your phone. + +Verified in the following versions. + +1. RNOH: 0.72.101; SDK: HarmonyOS 6.0.2 Release SDK; IDE: DevEco Studio 6.0.2 Release; ROM: 6.0.0.129; +2. RNOH: 0.77.34; SDK: HarmonyOS 6.0.2 Release SDK; IDE: DevEco Studio 6.0.2 Release; ROM: 6.0.0.129; + + +Open the `entry/src/main/cpp/CMakeLists.txt` file and add the following code: + +```diff +project(rnapp) +cmake_minimum_required(VERSION 3.4.1) ++ set(PARALLELIZATION_ENABLE 1) +set(CMAKE_SKIP_BUILD_RPATH TRUE) +set(RNOH_APP_DIR "${CMAKE_CURRENT_SOURCE_DIR}") +set(NODE_MODULES "${CMAKE_CURRENT_SOURCE_DIR}/../../../../../node_modules") +set(RNOH_CPP_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../../../../../react-native-harmony/harmony/cpp") +set(LOG_VERBOSITY_LEVEL 1) +set(CMAKE_ASM_FLAGS "-Wno-error=unused-command-line-argument -Qunused-arguments") +set(CMAKE_CXX_FLAGS "-fstack-protector-strong -Wl,-z,relro,-z,now,-z,noexecstack -s -fPIE -pie") +set(WITH_HITRACE_SYSTRACE 1) # for other CMakeLists.txt files to use +add_compile_definitions(WITH_HITRACE_SYSTRACE) + +add_subdirectory("${RNOH_CPP_DIR}" ./rn) +``` + +Open the `entry/src/main/ets/pages/Index.ets` file and add the following code: + +```diff +@Entry +@Component +struct Index { + @StorageLink('RNOHCoreContext') private rnohCoreContext: RNOHCoreContext | undefined = undefined + @State shouldShow: boolean = false + private logger!: RNOHLogger + private context = this.getUIContext().getHostContext() as common.UIAbilityContext; + aboutToAppear() { + this.logger = this.rnohCoreContext!.logger.clone("Index") + const stopTracing = this.logger.clone("aboutToAppear").startTracing() + for (const customFont of fonts) { + font.registerFont(customFont) + } + + this.shouldShow = true ++ this.rnohCoreContext?.setParallelizationEnabled(true); + stopTracing() + } +``` + ## Properties > [!TIP] The **Platform** column indicates the platform where the properties are supported in the original third-party library. diff --git a/zh-cn/react-native-SmartRefreshLayout.md b/zh-cn/react-native-SmartRefreshLayout.md index e7bd36cdd4729fbe349d1ffd5dfef033c53d8864..d1c8532b5afe9d62896bbfacd9b0b536ff594e29 100644 --- a/zh-cn/react-native-SmartRefreshLayout.md +++ b/zh-cn/react-native-SmartRefreshLayout.md @@ -341,6 +341,59 @@ ohpm install 2. RNOH: 0.72.33; SDK: HarmonyOS NEXT B1; IDE: DevEco Studio: 5.0.3.900; ROM: Next.0.0.71; 3. RNOH: 0.77.18; SDK: HarmonyOS 6.0.0 Release SDK; IDE: DevEco Studio 6.0.0.858; ROM: 6.0.0.112; +### 并行化白名单启用方法 + +要使用此功能,需要使用正确的 React-Native 和 RNOH 版本。另外,还需要使用配套的 DevEco Studio 和 手机 ROM。 + +在以下版本验证通过: + +1. RNOH: 0.72.101; SDK: HarmonyOS 6.0.2 Release SDK; IDE: DevEco Studio 6.0.2 Release; ROM: 6.0.0.129; +2. RNOH: 0.77.34; SDK: HarmonyOS 6.0.2 Release SDK; IDE: DevEco Studio 6.0.2 Release; ROM: 6.0.0.129; + + +打开 `entry/src/main/cpp/CMakeLists.txt`,添加: + +```diff +project(rnapp) +cmake_minimum_required(VERSION 3.4.1) ++ set(PARALLELIZATION_ENABLE 1) +set(CMAKE_SKIP_BUILD_RPATH TRUE) +set(RNOH_APP_DIR "${CMAKE_CURRENT_SOURCE_DIR}") +set(NODE_MODULES "${CMAKE_CURRENT_SOURCE_DIR}/../../../../../node_modules") +set(RNOH_CPP_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../../../../../react-native-harmony/harmony/cpp") +set(LOG_VERBOSITY_LEVEL 1) +set(CMAKE_ASM_FLAGS "-Wno-error=unused-command-line-argument -Qunused-arguments") +set(CMAKE_CXX_FLAGS "-fstack-protector-strong -Wl,-z,relro,-z,now,-z,noexecstack -s -fPIE -pie") +set(WITH_HITRACE_SYSTRACE 1) # for other CMakeLists.txt files to use +add_compile_definitions(WITH_HITRACE_SYSTRACE) + +add_subdirectory("${RNOH_CPP_DIR}" ./rn) +``` + +打开 `entry/src/main/ets/pages/Index.ets`,添加: + +```diff +@Entry +@Component +struct Index { + @StorageLink('RNOHCoreContext') private rnohCoreContext: RNOHCoreContext | undefined = undefined + @State shouldShow: boolean = false + private logger!: RNOHLogger + private context = this.getUIContext().getHostContext() as common.UIAbilityContext; + aboutToAppear() { + this.logger = this.rnohCoreContext!.logger.clone("Index") + const stopTracing = this.logger.clone("aboutToAppear").startTracing() + for (const customFont of fonts) { + font.registerFont(customFont) + } + + this.shouldShow = true ++ this.rnohCoreContext?.setParallelizationEnabled(true); + stopTracing() + } +``` + + ## 属性 > [!Tip] "Platform"列表示该属性在原三方库上支持的平台。 diff --git a/zh-cn/react-native-fast-image.md b/zh-cn/react-native-fast-image.md index f5d1e773fcc62f6023f546b9fa0459618f16be6e..c92dfbb63bb5f9fc59c66c6850dcf9dae67af046 100644 --- a/zh-cn/react-native-fast-image.md +++ b/zh-cn/react-native-fast-image.md @@ -270,6 +270,58 @@ ohpm install 2. RNOH: 0.72.33; SDK: HarmonyOS NEXT B1; IDE: DevEco Studio: 5.0.3.900; ROM: Next.0.0.71; 3. RNOH: 0.77.18; SDK: HarmonyOS 6.0.0 Release SDK; IDE: DevEco Studio 6.0.0.858; ROM: 6.0.0.112; +### 并行化白名单启用方法 + +要使用此功能,需要使用正确的 React-Native 和 RNOH 版本。另外,还需要使用配套的 DevEco Studio 和 手机 ROM。 + +在以下版本验证通过: + +1. RNOH: 0.72.101; SDK: HarmonyOS 6.0.2 Release SDK; IDE: DevEco Studio 6.0.2 Release; ROM: 6.0.0.129; +2. RNOH: 0.77.34; SDK: HarmonyOS 6.0.2 Release SDK; IDE: DevEco Studio 6.0.2 Release; ROM: 6.0.0.129; + + +打开 `entry/src/main/cpp/CMakeLists.txt`,添加: + +```diff +project(rnapp) +cmake_minimum_required(VERSION 3.4.1) ++ set(PARALLELIZATION_ENABLE 1) +set(CMAKE_SKIP_BUILD_RPATH TRUE) +set(RNOH_APP_DIR "${CMAKE_CURRENT_SOURCE_DIR}") +set(NODE_MODULES "${CMAKE_CURRENT_SOURCE_DIR}/../../../../../node_modules") +set(RNOH_CPP_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../../../../../react-native-harmony/harmony/cpp") +set(LOG_VERBOSITY_LEVEL 1) +set(CMAKE_ASM_FLAGS "-Wno-error=unused-command-line-argument -Qunused-arguments") +set(CMAKE_CXX_FLAGS "-fstack-protector-strong -Wl,-z,relro,-z,now,-z,noexecstack -s -fPIE -pie") +set(WITH_HITRACE_SYSTRACE 1) # for other CMakeLists.txt files to use +add_compile_definitions(WITH_HITRACE_SYSTRACE) + +add_subdirectory("${RNOH_CPP_DIR}" ./rn) +``` + +打开 `entry/src/main/ets/pages/Index.ets`,添加: + +```diff +@Entry +@Component +struct Index { + @StorageLink('RNOHCoreContext') private rnohCoreContext: RNOHCoreContext | undefined = undefined + @State shouldShow: boolean = false + private logger!: RNOHLogger + private context = this.getUIContext().getHostContext() as common.UIAbilityContext; + aboutToAppear() { + this.logger = this.rnohCoreContext!.logger.clone("Index") + const stopTracing = this.logger.clone("aboutToAppear").startTracing() + for (const customFont of fonts) { + font.registerFont(customFont) + } + + this.shouldShow = true ++ this.rnohCoreContext?.setParallelizationEnabled(true); + stopTracing() + } +``` + ## 属性 diff --git a/zh-cn/react-native-linear-gradient.md b/zh-cn/react-native-linear-gradient.md index 1714be427acec3cc003df40471e834ccd853e5b2..93f24da044241bd5f2b8f4825a7980f4944c5cbb 100644 --- a/zh-cn/react-native-linear-gradient.md +++ b/zh-cn/react-native-linear-gradient.md @@ -200,6 +200,59 @@ ohpm install 请到三方库相应的 Releases 发布地址查看 Release 配套的版本信息:[@react-native-ohos/react-native-linear-gradient Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-linear-gradient/releases) +### 3.2 并行化白名单启用方法 + +要使用此功能,需要使用正确的 React-Native 和 RNOH 版本。另外,还需要使用配套的 DevEco Studio 和 手机 ROM。 + +在以下版本验证通过: + +1. RNOH: 0.72.101; SDK: HarmonyOS 6.0.2 Release SDK; IDE: DevEco Studio 6.0.2 Release; ROM: 6.0.0.129; +2. RNOH: 0.77.34; SDK: HarmonyOS 6.0.2 Release SDK; IDE: DevEco Studio 6.0.2 Release; ROM: 6.0.0.129; + + +打开 `entry/src/main/cpp/CMakeLists.txt`,添加: + +```diff +project(rnapp) +cmake_minimum_required(VERSION 3.4.1) ++ set(PARALLELIZATION_ENABLE 1) +set(CMAKE_SKIP_BUILD_RPATH TRUE) +set(RNOH_APP_DIR "${CMAKE_CURRENT_SOURCE_DIR}") +set(NODE_MODULES "${CMAKE_CURRENT_SOURCE_DIR}/../../../../../node_modules") +set(RNOH_CPP_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../../../../../react-native-harmony/harmony/cpp") +set(LOG_VERBOSITY_LEVEL 1) +set(CMAKE_ASM_FLAGS "-Wno-error=unused-command-line-argument -Qunused-arguments") +set(CMAKE_CXX_FLAGS "-fstack-protector-strong -Wl,-z,relro,-z,now,-z,noexecstack -s -fPIE -pie") +set(WITH_HITRACE_SYSTRACE 1) # for other CMakeLists.txt files to use +add_compile_definitions(WITH_HITRACE_SYSTRACE) + +add_subdirectory("${RNOH_CPP_DIR}" ./rn) +``` + +打开 `entry/src/main/ets/pages/Index.ets`,添加: + +```diff +@Entry +@Component +struct Index { + @StorageLink('RNOHCoreContext') private rnohCoreContext: RNOHCoreContext | undefined = undefined + @State shouldShow: boolean = false + private logger!: RNOHLogger + private context = this.getUIContext().getHostContext() as common.UIAbilityContext; + aboutToAppear() { + this.logger = this.rnohCoreContext!.logger.clone("Index") + const stopTracing = this.logger.clone("aboutToAppear").startTracing() + for (const customFont of fonts) { + font.registerFont(customFont) + } + + this.shouldShow = true ++ this.rnohCoreContext?.setParallelizationEnabled(true); + stopTracing() + } +``` + + ## 4. 属性 > [!TIP] "Platform" 列表示这些属性在原始第三方库中支持的平台。 diff --git a/zh-cn/react-native-masked-view-masked-view.md b/zh-cn/react-native-masked-view-masked-view.md index 85a6ac546b590dd42c2dfea18af7840ffbe6bb2a..90c997f70a7a2ddf01eef426c41334c3b6d8b42c 100644 --- a/zh-cn/react-native-masked-view-masked-view.md +++ b/zh-cn/react-native-masked-view-masked-view.md @@ -275,6 +275,59 @@ ohpm install 2. RNOH: 0.72.33; SDK: HarmonyOS NEXT B1; IDE: DevEco Studio: 5.0.3.900; ROM: Next.0.0.71; 3. RNOH: 0.77.18; SDK: HarmonyOS 6.0.0 Release SDK; IDE: DevEco Studio 6.0.0.858; ROM: 6.0.0.112; +### 并行化白名单启用方法 + +要使用此功能,需要使用正确的 React-Native 和 RNOH 版本。另外,还需要使用配套的 DevEco Studio 和 手机 ROM。 + +在以下版本验证通过: + +1. RNOH: 0.72.101; SDK: HarmonyOS 6.0.2 Release SDK; IDE: DevEco Studio 6.0.2 Release; ROM: 6.0.0.129; +2. RNOH: 0.77.34; SDK: HarmonyOS 6.0.2 Release SDK; IDE: DevEco Studio 6.0.2 Release; ROM: 6.0.0.129; + + +打开 `entry/src/main/cpp/CMakeLists.txt`,添加: + +```diff +project(rnapp) +cmake_minimum_required(VERSION 3.4.1) ++ set(PARALLELIZATION_ENABLE 1) +set(CMAKE_SKIP_BUILD_RPATH TRUE) +set(RNOH_APP_DIR "${CMAKE_CURRENT_SOURCE_DIR}") +set(NODE_MODULES "${CMAKE_CURRENT_SOURCE_DIR}/../../../../../node_modules") +set(RNOH_CPP_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../../../../../react-native-harmony/harmony/cpp") +set(LOG_VERBOSITY_LEVEL 1) +set(CMAKE_ASM_FLAGS "-Wno-error=unused-command-line-argument -Qunused-arguments") +set(CMAKE_CXX_FLAGS "-fstack-protector-strong -Wl,-z,relro,-z,now,-z,noexecstack -s -fPIE -pie") +set(WITH_HITRACE_SYSTRACE 1) # for other CMakeLists.txt files to use +add_compile_definitions(WITH_HITRACE_SYSTRACE) + +add_subdirectory("${RNOH_CPP_DIR}" ./rn) +``` + +打开 `entry/src/main/ets/pages/Index.ets`,添加: + +```diff +@Entry +@Component +struct Index { + @StorageLink('RNOHCoreContext') private rnohCoreContext: RNOHCoreContext | undefined = undefined + @State shouldShow: boolean = false + private logger!: RNOHLogger + private context = this.getUIContext().getHostContext() as common.UIAbilityContext; + aboutToAppear() { + this.logger = this.rnohCoreContext!.logger.clone("Index") + const stopTracing = this.logger.clone("aboutToAppear").startTracing() + for (const customFont of fonts) { + font.registerFont(customFont) + } + + this.shouldShow = true ++ this.rnohCoreContext?.setParallelizationEnabled(true); + stopTracing() + } +``` + + ## 属性 > [!TIP] "Platform"列表示该属性在原三方库上支持的平台。 diff --git a/zh-cn/react-native-svg-capi.md b/zh-cn/react-native-svg-capi.md index 95d090c25d077269e7c9bc38a4c6ae60ca412eb7..eb7b5bad7f2227b231a7d147ec85426cd66067b0 100644 --- a/zh-cn/react-native-svg-capi.md +++ b/zh-cn/react-native-svg-capi.md @@ -286,6 +286,58 @@ ohpm install 2. RNOH: 0.72.33; SDK: HarmonyOS NEXT B1; IDE: DevEco Studio: 5.0.3.900; ROM: Next.0.0.71; 3. RNOH: 0.77.18; SDK: HarmonyOS 6.0.0 Release SDK; IDE: DevEco Studio 6.0.0.858; ROM: 6.0.0.112; +### 并行化白名单启用方法 + +要使用此功能,需要使用正确的 React-Native 和 RNOH 版本。另外,还需要使用配套的 DevEco Studio 和 手机 ROM。 + +在以下版本验证通过: + +1. RNOH: 0.72.101; SDK: HarmonyOS 6.0.2 Release SDK; IDE: DevEco Studio 6.0.2 Release; ROM: 6.0.0.129; +2. RNOH: 0.77.34; SDK: HarmonyOS 6.0.2 Release SDK; IDE: DevEco Studio 6.0.2 Release; ROM: 6.0.0.129; + + +打开 `entry/src/main/cpp/CMakeLists.txt`,添加: + +```diff +project(rnapp) +cmake_minimum_required(VERSION 3.4.1) ++ set(PARALLELIZATION_ENABLE 1) +set(CMAKE_SKIP_BUILD_RPATH TRUE) +set(RNOH_APP_DIR "${CMAKE_CURRENT_SOURCE_DIR}") +set(NODE_MODULES "${CMAKE_CURRENT_SOURCE_DIR}/../../../../../node_modules") +set(RNOH_CPP_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../../../../../react-native-harmony/harmony/cpp") +set(LOG_VERBOSITY_LEVEL 1) +set(CMAKE_ASM_FLAGS "-Wno-error=unused-command-line-argument -Qunused-arguments") +set(CMAKE_CXX_FLAGS "-fstack-protector-strong -Wl,-z,relro,-z,now,-z,noexecstack -s -fPIE -pie") +set(WITH_HITRACE_SYSTRACE 1) # for other CMakeLists.txt files to use +add_compile_definitions(WITH_HITRACE_SYSTRACE) + +add_subdirectory("${RNOH_CPP_DIR}" ./rn) +``` + +打开 `entry/src/main/ets/pages/Index.ets`,添加: + +```diff +@Entry +@Component +struct Index { + @StorageLink('RNOHCoreContext') private rnohCoreContext: RNOHCoreContext | undefined = undefined + @State shouldShow: boolean = false + private logger!: RNOHLogger + private context = this.getUIContext().getHostContext() as common.UIAbilityContext; + aboutToAppear() { + this.logger = this.rnohCoreContext!.logger.clone("Index") + const stopTracing = this.logger.clone("aboutToAppear").startTracing() + for (const customFont of fonts) { + font.registerFont(customFont) + } + + this.shouldShow = true ++ this.rnohCoreContext?.setParallelizationEnabled(true); + stopTracing() + } +``` + ## 属性 diff --git a/zh-cn/shopify-flash-list.md b/zh-cn/shopify-flash-list.md index e04bd9b40df95c9ecd88b857ea97e446da933c93..1ee3810f218dd50e1a49ce987c72440bf53e2abd 100644 --- a/zh-cn/shopify-flash-list.md +++ b/zh-cn/shopify-flash-list.md @@ -218,6 +218,59 @@ ohpm install 2. RNOH: 0.72.33; SDK: HarmonyOS NEXT B1; IDE: DevEco Studio: 5.0.3.900; ROM: Next.0.0.71; 3. RNOH: 0.77.18; SDK: HarmonyOS 6.0.0 Release SDK; IDE: DevEco Studio 6.0.0.858; ROM: 6.0.0.112; +### 并行化白名单启用方法 + +要使用此功能,需要使用正确的 React-Native 和 RNOH 版本。另外,还需要使用配套的 DevEco Studio 和 手机 ROM。 + +在以下版本验证通过: + +1. RNOH: 0.72.101; SDK: HarmonyOS 6.0.2 Release SDK; IDE: DevEco Studio 6.0.2 Release; ROM: 6.0.0.129; +2. RNOH: 0.77.34; SDK: HarmonyOS 6.0.2 Release SDK; IDE: DevEco Studio 6.0.2 Release; ROM: 6.0.0.129; + + +打开 `entry/src/main/cpp/CMakeLists.txt`,添加: + +```diff +project(rnapp) +cmake_minimum_required(VERSION 3.4.1) ++ set(PARALLELIZATION_ENABLE 1) +set(CMAKE_SKIP_BUILD_RPATH TRUE) +set(RNOH_APP_DIR "${CMAKE_CURRENT_SOURCE_DIR}") +set(NODE_MODULES "${CMAKE_CURRENT_SOURCE_DIR}/../../../../../node_modules") +set(RNOH_CPP_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../../../../../react-native-harmony/harmony/cpp") +set(LOG_VERBOSITY_LEVEL 1) +set(CMAKE_ASM_FLAGS "-Wno-error=unused-command-line-argument -Qunused-arguments") +set(CMAKE_CXX_FLAGS "-fstack-protector-strong -Wl,-z,relro,-z,now,-z,noexecstack -s -fPIE -pie") +set(WITH_HITRACE_SYSTRACE 1) # for other CMakeLists.txt files to use +add_compile_definitions(WITH_HITRACE_SYSTRACE) + +add_subdirectory("${RNOH_CPP_DIR}" ./rn) +``` + +打开 `entry/src/main/ets/pages/Index.ets`,添加: + +```diff +@Entry +@Component +struct Index { + @StorageLink('RNOHCoreContext') private rnohCoreContext: RNOHCoreContext | undefined = undefined + @State shouldShow: boolean = false + private logger!: RNOHLogger + private context = this.getUIContext().getHostContext() as common.UIAbilityContext; + aboutToAppear() { + this.logger = this.rnohCoreContext!.logger.clone("Index") + const stopTracing = this.logger.clone("aboutToAppear").startTracing() + for (const customFont of fonts) { + font.registerFont(customFont) + } + + this.shouldShow = true ++ this.rnohCoreContext?.setParallelizationEnabled(true); + stopTracing() + } +``` + + ## 属性 > [!TIP] "Platform"列表示该属性在原三方库上支持的平台。