From c88cc399ca802664d498fafc92c9622fcb515d49 Mon Sep 17 00:00:00 2001 From: Galen wei <1947612015@qq.com> Date: Thu, 20 Feb 2025 10:42:22 +0800 Subject: [PATCH 1/2] =?UTF-8?q?add=20react-native-harmony-v5.1.0.204?= =?UTF-8?q?=E7=89=88=E6=9C=AC=E8=AF=B4=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Galen wei <1947612015@qq.com> --- .../home_fluency/HomeFluency/entry/hvigorfile.ts | 4 ++-- docs/ohadss/home_fluency/HomeFluency/hvigorfile.ts | 4 ++-- docs/ohadss/home_fluency/README_zh.md | 2 +- docs/zh-cn/TurboModule.md | 4 ++-- ...1.0.203.md => react-native-harmony-v5.1.0.204.md} | 12 ++++++------ ...7\211\210\346\234\254\350\257\264\346\230\216.md" | 2 +- 6 files changed, 14 insertions(+), 14 deletions(-) rename docs/zh-cn/release-notes/{react-native-harmony-v5.1.0.203.md => react-native-harmony-v5.1.0.204.md} (52%) diff --git a/docs/ohadss/home_fluency/HomeFluency/entry/hvigorfile.ts b/docs/ohadss/home_fluency/HomeFluency/entry/hvigorfile.ts index c6edcd90..60e47e17 100644 --- a/docs/ohadss/home_fluency/HomeFluency/entry/hvigorfile.ts +++ b/docs/ohadss/home_fluency/HomeFluency/entry/hvigorfile.ts @@ -1,6 +1,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/ohadss/home_fluency/HomeFluency/hvigorfile.ts b/docs/ohadss/home_fluency/HomeFluency/hvigorfile.ts index f3cb9f1a..20a8c119 100644 --- a/docs/ohadss/home_fluency/HomeFluency/hvigorfile.ts +++ b/docs/ohadss/home_fluency/HomeFluency/hvigorfile.ts @@ -1,6 +1,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/ohadss/home_fluency/README_zh.md b/docs/ohadss/home_fluency/README_zh.md index e335250e..2ab7d82e 100644 --- a/docs/ohadss/home_fluency/README_zh.md +++ b/docs/ohadss/home_fluency/README_zh.md @@ -5,7 +5,7 @@ # 工程目录 ``` -home-fluency +home_fluency ├── RNHomeFluency 前端工程 └── HomeFluency 原生工程 ``` diff --git a/docs/zh-cn/TurboModule.md b/docs/zh-cn/TurboModule.md index d4d90619..fdfa06e2 100644 --- a/docs/zh-cn/TurboModule.md +++ b/docs/zh-cn/TurboModule.md @@ -142,7 +142,7 @@ Codegen 的详细使用方法,可以参考[Codegen](Codegen.md)文档。 1. 创建用于实现模块的 `CalculatorModule.ts`。 - 在 `entry/src/main/ets` 路径下新建文件夹 `turbomodule`,并在文件夹中新增 `CalculatorModule.ts` 。 + 在 `entry/src/main/ets` 路径下新建文件夹 `turbomodule`,并在文件夹中新增 `CalculatorModule.ts`。 如果是 ArkTSTurboModule,需要在此处实现: ```typescript @@ -452,7 +452,7 @@ Codegen 的详细使用方法,可以参考[Codegen](Codegen.md)文档。 ``` 在ets路径下右击,选择 `New` 选项,右侧展开菜单选择 `Woker` 选项: ![create_worker](./figures/create-worker.png) - 选择后在弹出的窗口中取名 `RNOHWorker.ets` : + 选择后在弹出的窗口中取名 `RNOHWorker.ets`: ![christen_RNOHWorker](./figures/christen-RNOHWorker.png) 此时目录结构为: ``` diff --git a/docs/zh-cn/release-notes/react-native-harmony-v5.1.0.203.md b/docs/zh-cn/release-notes/react-native-harmony-v5.1.0.204.md similarity index 52% rename from docs/zh-cn/release-notes/react-native-harmony-v5.1.0.203.md rename to docs/zh-cn/release-notes/react-native-harmony-v5.1.0.204.md index 0e2d3c13..886c239a 100644 --- a/docs/zh-cn/release-notes/react-native-harmony-v5.1.0.203.md +++ b/docs/zh-cn/release-notes/react-native-harmony-v5.1.0.204.md @@ -2,15 +2,15 @@ 当前React Native鸿蒙版本基于社区RN 0.72.5进行适配,发布版本信息如下: | 名称 | 版本号 | | ----------------------------- | -------------------------------| -| react-native-harmony.tgz | 0.72.57 | +| react-native-harmony.tgz | 0.72.58 | | react-native-harmony-cli.tgz | 0.0.28 | -| react_native_openharmony-5.1.0.203.har | 0.72.57 | -| react_native_openharmony_release-5.1.0.203.har | 5.1.0.203 | +| react_native_openharmony-5.1.0.204.har | 0.72.58 | +| react_native_openharmony_release-5.1.0.204.har | 5.1.0.204 | 配套IDE、SDK版本和手机ROM: | 名称 | 版本号 | | ----------------------------- | -------------------------------| -| DevEco Studio | DevEco Studio 5.0.7.121 | -| HarmonyOS SDK | HarmonyOS SDK 5.0.2.123(SP18) | -| 手机ROM | ALN-AL00 205.0.0.123(SP19C00E121R4P25)
ALN-AL80 205.0.0.123(SP19C00E121R4P25)
BRA-AL00 205.0.0.123(SP19C00E121R4P25) | +| DevEco Studio | DevEco Studio 5.1.0.248 | +| HarmonyOS SDK | HarmonyOS SDK 5.1.0.51(SP2) | +| 手机ROM | ALN-AL00 205.1.0.51(SP30DEVC00E51R4P1)
ALN-AL80 205.1.0.51(SP30DEVC00E51R4P1)
BRA-AL00 205.1.0.51(SP30DEVC00E51R4P1) | diff --git "a/docs/zh-cn/\347\211\210\346\234\254\350\257\264\346\230\216.md" "b/docs/zh-cn/\347\211\210\346\234\254\350\257\264\346\230\216.md" index 7bc6f8a0..55bb2b15 100644 --- "a/docs/zh-cn/\347\211\210\346\234\254\350\257\264\346\230\216.md" +++ "b/docs/zh-cn/\347\211\210\346\234\254\350\257\264\346\230\216.md" @@ -8,4 +8,4 @@ - [RNOH v5.0.0.812(2024-12-14)](./release-notes/react-native-harmony-v5.0.0.812.md) - [RNOH v5.0.0.813(2024-12-26)](./release-notes/react-native-harmony-v5.0.0.813.md) - [RNOH v5.1.0.111(2025-01-25)](./release-notes/react-native-harmony-v5.1.0.111.md) -- [RNOH v5.1.0.203(2025-02-13)](./release-notes/react-native-harmony-v5.1.0.203.md)(非正式发布) \ No newline at end of file +- [RNOH v5.1.0.204(2025-02-20)](./release-notes/react-native-harmony-v5.1.0.204.md)(非正式发布) \ No newline at end of file -- Gitee From 11a3bd6c45809905c2e498768004670e35a579d3 Mon Sep 17 00:00:00 2001 From: wuxujie Date: Thu, 20 Feb 2025 17:38:14 +0800 Subject: [PATCH 2/2] fix:m_ctx destroyed when using by asyncTask --- .../TurboModules/BlobTurboModule.cpp | 9 +++++---- tester/tests/BlobTest.tsx | 14 ++++++++++++++ 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/tester/harmony/react_native_openharmony/src/main/cpp/RNOHCorePackage/TurboModules/BlobTurboModule.cpp b/tester/harmony/react_native_openharmony/src/main/cpp/RNOHCorePackage/TurboModules/BlobTurboModule.cpp index 517e82b1..32711bb0 100644 --- a/tester/harmony/react_native_openharmony/src/main/cpp/RNOHCorePackage/TurboModules/BlobTurboModule.cpp +++ b/tester/harmony/react_native_openharmony/src/main/cpp/RNOHCorePackage/TurboModules/BlobTurboModule.cpp @@ -31,17 +31,18 @@ BlobTurboModule::BlobTurboModule( */ void BlobTurboModule::release(std::string blobId) { m_ctx.taskExecutor->runTask( - m_ctx.turboModuleThread, [ctx = m_ctx, name = name_, blobId]() { + m_ctx.turboModuleThread, [env = m_ctx.env, arkTSTurboModuleInstanceRef + = ctx.arkTSTurboModuleInstanceRef, name = name_, blobId]() { std::string methodName = "release"; try { - ArkJS arkJS(ctx.env); - if (!ctx.arkTSTurboModuleInstanceRef) { + ArkJS arkJS(env); + if (!arkTSTurboModuleInstanceRef) { return; } std::vector napiArgs; napiArgs.push_back(arkJS.createString(blobId)); auto napiTurboModuleObject = - arkJS.getObject(ctx.arkTSTurboModuleInstanceRef); + arkJS.getObject(arkTSTurboModuleInstanceRef); napiTurboModuleObject.call(methodName, napiArgs); } catch (const std::exception& e) { LOG(ERROR) << "Exception thrown while calling " << name diff --git a/tester/tests/BlobTest.tsx b/tester/tests/BlobTest.tsx index a5099d9a..04d756ff 100644 --- a/tester/tests/BlobTest.tsx +++ b/tester/tests/BlobTest.tsx @@ -23,6 +23,20 @@ export const BlobTest = () => { expect(blob.type).to.be.eq('text/plain'); }} /> + { + const blob = new Blob(['aaabbbccc'], { + type: 'text/plain', + lastModified: Date.now(), + }); + expect(blob.size).to.be.eq(9); //each character is 1 byte + expect(blob.type).to.be.eq('text/plain'); + setTimeout(()=>{ + blob.slice(0, 5); + },1000); + }} + /> ); }; -- Gitee