fix(napi): js call callback in ThreadsafeFunction should not be Send#2510
Merged
Conversation
Brooooooklyn
approved these changes
Mar 16, 2025
richerfu
added a commit
to ohos-rs/ohos-rs
that referenced
this pull request
Apr 25, 2025
* chore(napi): SharedReference can be sync (napi-rs#2503) * fix(napi): reference cannot impl send (napi-rs#2499) * chore(napi): upgrade wasm tools * chore(release): publish - @napi-rs/cli@3.0.0-alpha.74 - @napi-rs/triples@2.0.0-alpha.36 * chore(deps): bump @babel/runtime from 7.26.9 to 7.26.10 (napi-rs#2508) Bumps [@babel/runtime](https://github.com/babel/babel/tree/HEAD/packages/babel-runtime) from 7.26.9 to 7.26.10. - [Release notes](https://github.com/babel/babel/releases) - [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md) - [Commits](https://github.com/babel/babel/commits/v7.26.10/packages/babel-runtime) --- updated-dependencies: - dependency-name: "@babel/runtime" dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore(deps): bump axios from 1.8.1 to 1.8.3 (napi-rs#2507) Bumps [axios](https://github.com/axios/axios) from 1.8.1 to 1.8.3. - [Release notes](https://github.com/axios/axios/releases) - [Changelog](https://github.com/axios/axios/blob/v1.x/CHANGELOG.md) - [Commits](axios/axios@v1.8.1...v1.8.3) --- updated-dependencies: - dependency-name: axios dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * feat(napi): tokio multi-thread mode on wasi (napi-rs#2501) * feat(napi): tokio multi-thread mode on wasi * tokio_unstable flag * snapshot * ensure runtime * oncelock combine lazylock * noop feature * fix(cli): CXX path for s390x (napi-rs#2509) * chore(release): publish - @napi-rs/cli@3.0.0-alpha.75 - @napi-rs/triples@2.0.0-alpha.37 * chore(deps): update dependency oxlint to ^0.16.0 (napi-rs#2512) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * fix(napi): js callback in threadsafefunction should not be Send (napi-rs#2510) * chore(deps): update dependency @oxc-node/core to ^0.0.21 (napi-rs#2515) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore: upgrade npm dependencies (napi-rs#2516) * Release independent packages - napi@3.0.0-alpha.32 - napi-derive@3.0.0-alpha.29 * chore(deps): update dependency shx to ^0.4.0 (napi-rs#2518) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * fix(napi): re-create async runtime (napi-rs#2519) * Release independent packages - napi@3.0.0-alpha.33 * feat(cli): add `wasm.browser.asyncInit` for large wasm file (napi-rs#2514) * perf(build): remove --export-dynamic flag in wasi compilation (napi-rs#2523) * chore(release): publish - @napi-rs/cli@3.0.0-alpha.76 - @napi-rs/triples@2.0.0-alpha.38 * Release independent packages - napi-build@2.1.6 * chore(deps): update dependency vite to v6.2.3 [security] (napi-rs#2528) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore(deps): update dependency sinon to v20 (napi-rs#2526) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore(deps): update yarn to v4.8.0 (napi-rs#2530) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore(cli): excludeNetwork on getting report (napi-rs#2531) * chore(cli): excludeNetwork on getting report * Update cli/src/api/templates/js-binding.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * format --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * chore(deps): update yarn to v4.8.1 (napi-rs#2536) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore(deps): update dependency vite to v6.2.4 [security] (napi-rs#2538) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * fix(cli): trim is not a function (napi-rs#2541) * chore(cli): update deps (napi-rs#2542) * chore(release): publish - @napi-rs/cli@3.0.0-alpha.77 - @napi-rs/triples@2.0.0-alpha.39 - @napi-rs/wasm-runtime@0.2.8 * chore(deps): update dependency @oxc-node/core to ^0.0.22 (napi-rs#2543) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore: clippy fix (napi-rs#2545) * chore(deps): update dependency vite to v6.2.5 [security] (napi-rs#2549) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore(deps): update yarn to v4.9.0 (napi-rs#2551) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore(deps): update dependency @oxc-node/core to ^0.0.23 (napi-rs#2552) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * feat(napi): serde value ref to napi_value (napi-rs#2550) * perf: convert serde value ref to napi_value * chore: add test case * fix: snapshot * chore(deps): update dependency vite to v6.2.6 [security] (napi-rs#2554) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * fix(wasm-runtime): remove `_isBuffer` patch (napi-rs#2560) closes napi-rs#2559 * chore(deps): update yarn to v4.9.1 (napi-rs#2562) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * fix(wasm-runtime): wasm fs proxy serialization (napi-rs#2564) * fix: wasm fs proxy serialization * type * test(wasm-runtime): testing fs proxy on CI (napi-rs#2565) * fix(cli): replace .wasm extension of wasm artifact (napi-rs#2556) Co-authored-by: LongYinan <lynweklm@gmail.com> * chore(release): publish - @napi-rs/cli@3.0.0-alpha.78 - @napi-rs/triples@2.0.0-alpha.40 - @napi-rs/wasm-runtime@0.2.9 * ci: test Windows on ARM (napi-rs#2566) * fix(wasm-runtime): upgrade emnapi (napi-rs#2568) * fix: fix window warning --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Cong-Cong Pan <dacongsama@live.com> Co-authored-by: LongYinan <lynweklm@gmail.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Hiroshi Ogawa <hi.ogawa.zz@gmail.com> Co-authored-by: CPunisher <1343316114@qq.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Kevin Deng 三咲智子 <sxzz@sxzz.moe> Co-authored-by: Toyo Li <lifenglin314@outlook.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The ThreadsafeFunction can only be constructed on the JavaScript thread. The JS callback must execute on the JS thread.
So we can remove the Send bound for ThreadsafeFunction js call callback.