Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Add ability to Share Native Object Instances between Main and Worker Runtimes

Open
#37 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
android, cpp, java, javascript, typescript

Research direction

No files or tests are named. Start by tracing the Main and Worker runtime message paths around the shown createNativeHandle and resolveNativeHandle entry points, then determine how a Java-backed object can remain valid across runtimes. Done means the example can send a native String from Main to Worker and resolve it there safely.

Written by the indexing model from the issue text.

Description

Both Worker and Main JS runtime instances use the same Java environment hence the native objects can be shared between the two.
Main:

const nativeObject = new java.lang.String("string");
const worker = new Worker(...);
worker.postMessage({
  myNativeString: globalThis.createNativeHandle(nativeObject)
});

Worker:

globalThis.onmessage = (message) => {
  const nativeObject = globalThis.resolveNativeHandle(message.myNativeString);
}
Dominant language
C++
Stars
33
Forks
3
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from NativeScript/napi-android

All issues in NativeScript/napi-android

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.