René's URL Explorer Experiment


Title: feat(runtime): ns:interop builtin modules, interop globals as compat by edusperoni · Pull Request #2074 · NativeScript/android · GitHub

Open Graph Title: feat(runtime): ns:interop builtin modules, interop globals as compat by edusperoni · Pull Request #2074 · NativeScript/android

X Title: feat(runtime): ns:interop builtin modules, interop globals as compat by edusperoni · Pull Request #2074 · NativeScript/android

Description: Description Adoption step 0 of rfcs#58 ("interop and runtime helpers"). The interop helpers move into builtin modules, and today's globals become a compat layer built from them. Module Exports ns:interop nothing yet, frozen and empty. Android has none of the native-memory members iOS exports here; rfcs#56's initializer will land here. ns:interop/android long, byte, short, char, float, double, newArray (the function Array.create has always been) ns:runtime (new member) escapeException Compat. js/interop-globals.js is an internal builtin that requires ns:runtime and ns:interop/android and installs: globalThis.interop = { escapeException }; the six cast globals; Array.create. Each global holds the module's own function object, with the same writable, enumerable and configurable attributes as before. It runs eagerly, at the point where interop used to be installed, for both the main isolate and workers, because @nativescript/core reads these at module top level. The ns: files never refer to it. Native changes: The casts, Array.create and escapeException are now built by binding factories in NsBuiltinModules.cpp, rather than set on the global template or the global itself. ArrayHelper's JNI class/method lookup runs once per process (std::call_once). It used to be redone per isolate, with unsynchronized writes to static fields. Typings. This repo doesn't ship .d.ts for its ns: modules yet, so none are added here. The iOS runtime ships them in types/, and Android doing the same is a follow-up. Does your commit message include the wording below to reference a specific issue in this repo? No issue; this implements part of rfcs#58. Related Pull Requests iOS: NativeScript/ios#527 RFC: https://github.com/NativeScript/rfcs/discussions/58 Does your pull request have unit tests? Yes. tests/testNsInterop.js (16 specs) and tests/nsInteropWorker.js cover: export lists and frozen exports; that every global is the module's export, and that the globals' property attributes are unchanged; Java overload resolution through the module casts; newArray by type name and by class; bad arguments; static and dynamic ESM import; a worker getting its own instances. testNsRuntime.js now expects escapeException. Full suite, after rebasing on main (e15d21a): 1510 passed, 0 failed, 7 skipped, on an API 35 arm64 emulator. Summary by CodeRabbit New Features Added the ns:interop module and Android-specific ns:interop/android helpers for Java primitive casts and array creation. Exposed escapeException through ns:runtime and kept legacy interop globals available for existing apps. Added worker support for the Android interop APIs. Documentation Documented interop modules, their platform availability, exports, and legacy global aliases. Tests Added coverage for interop imports, helper behavior, legacy globals, and worker environments.

Open Graph Description: Description Adoption step 0 of rfcs#58 ("interop and runtime helpers"). The interop helpers move into builtin modules, and today's globals become a compat layer built from them. Mo...

X Description: Description Adoption step 0 of rfcs#58 ("interop and runtime helpers"). The interop helpers move into builtin modules, and today's globals become a compat layer built from...

Opengraph URL: https://github.com/NativeScript/android/pull/2074

X: @github

direct link

Domain: github.com

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:9fd3fcab-b146-eaba-74e6-70fbac274990
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idC570:2454CC:19D1A01:20BD657:6B014ACD
html-safe-nonce99ddcf7d803295a4ebb20daac764553f7daa6d32835a870e9febda3b8db5dc7d
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDNTcwOjI0NTRDQzoxOUQxQTAxOjIwQkQ2NTc6NkIwMTRBQ0QiLCJ2aXNpdG9yX2lkIjoiMjI3NjMzOTA1MDk5NjY0ODY1MyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmacfc4324f4b7b5dd7ed5ba5cab93516ec65ad3bdf2e9a4ada1fd9824a313d547a8
hovercard-subject-tagpull_request:4986886954
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/NativeScript/android/pull/2074/files
twitter:imagehttps://avatars.githubusercontent.com/u/4061767?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/4061767?s=400&v=4
og:image:altDescription Adoption step 0 of rfcs#58 ("interop and runtime helpers"). The interop helpers move into builtin modules, and today's globals become a compat layer built from them. Mo...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
Nonecc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/NativeScript/android git https://github.com/NativeScript/android.git
octolytics-dimension-user_id7392261
octolytics-dimension-user_loginNativeScript
octolytics-dimension-repository_id29137950
octolytics-dimension-repository_nwoNativeScript/android
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id29137950
octolytics-dimension-repository_network_root_nwoNativeScript/android
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release8c77c9e8439031ad54c75a250694842892f693e1
ui-targetcanary-2
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/NativeScript/android/pull/2074/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FNativeScript%2Fandroid%2Fpull%2F2074%2Ffiles
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FNativeScript%2Fandroid%2Fpull%2F2074%2Ffiles
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=NativeScript%2Fandroid
Reloadhttps://github.com/NativeScript/android/pull/2074/files
Reloadhttps://github.com/NativeScript/android/pull/2074/files
Reloadhttps://github.com/NativeScript/android/pull/2074/files
NativeScripthttps://github.com/NativeScript
androidhttps://github.com/NativeScript/android
Codehttps://github.com/NativeScript/android
Issues106 (106)https://github.com/NativeScript/android/issues
Pull requests24 (24)https://github.com/NativeScript/android/pulls
Actionshttps://github.com/NativeScript/android/actions
Projectshttps://github.com/NativeScript/android/projects
Wikihttps://github.com/NativeScript/android/wiki
Security and qualityhttps://github.com/NativeScript/android/security
Insightshttps://github.com/NativeScript/android/insights
Sign up for GitHub https://github.com/signup?return_to=%2FNativeScript%2Fandroid%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2FNativeScript%2Fandroid%2Fissues%2Fnew%2Fchoose
edusperonihttps://github.com/edusperoni
mainhttps://github.com/NativeScript/android/tree/main
feat/ns-interophttps://github.com/NativeScript/android/tree/feat/ns-interop
Conversation 1 https://github.com/NativeScript/android/pull/2074
Commits 1 https://github.com/NativeScript/android/pull/2074/commits
Checks 8 https://github.com/NativeScript/android/pull/2074/checks
Files changed https://github.com/NativeScript/android/pull/2074/files
Please reload this pagehttps://github.com/NativeScript/android/pull/2074/files
feat(runtime): ns:interop builtin modules, interop globals as compat https://github.com/NativeScript/android/pull/2074/files#top
Show all changes 1 commit https://github.com/NativeScript/android/pull/2074/files
da341c0 feat(runtime): ns:interop builtin modules, interop globals as compat edusperoni Oct 23, 2026 https://github.com/NativeScript/android/pull/2074/commits/da341c09c635a656880d014357bed237e499e212
Clear filters https://github.com/NativeScript/android/pull/2074/files
Please reload this pagehttps://github.com/NativeScript/android/pull/2074/files
Please reload this pagehttps://github.com/NativeScript/android/pull/2074/files
ns-builtin-modules.md https://github.com/NativeScript/android/pull/2074/files#diff-f49fa83084691682143a83515d6be04f599ea5d1cc41aa8e262d0daf53ebc63d
mainpage.js https://github.com/NativeScript/android/pull/2074/files#diff-b7fd6c22bfc29391e9e3ed935d6c6194b1ad595c7592690229952b5ddb99c0d5
testNsInteropImport.mjs https://github.com/NativeScript/android/pull/2074/files#diff-ae9fe2a80a96de8b2ef9acf19b8e9bbed1186a3e317298d28ef1feaa45204f9b
nsInteropWorker.js https://github.com/NativeScript/android/pull/2074/files#diff-1da898f0974d2e4bdda350ced0b570951d4dfbc3e8bbb38aba732e5296934009
testNsInterop.js https://github.com/NativeScript/android/pull/2074/files#diff-9547ef88f9a076720ac0ce0c29eeecc3e9a8d5eb216f0e4168b56b4c5d92a40f
testNsRuntime.js https://github.com/NativeScript/android/pull/2074/files#diff-4c13165b66bfc4406dceadbe2f1a51efe7fc82458b98300d63b3d51d914ddc3b
CMakeLists.txt https://github.com/NativeScript/android/pull/2074/files#diff-9aa48152a82c07a60ab6e09923a9b266e2985f78e579653848df730cd8ec5e4c
ArrayHelper.cpp https://github.com/NativeScript/android/pull/2074/files#diff-80d0684b73853a3a7490064fa105595f46c5be59777c2ef04d4c5002f22fbd84
ArrayHelper.h https://github.com/NativeScript/android/pull/2074/files#diff-e8768b4ddd7dc54eb88790d0e437a0e3fb3259d73538e028a759852f0ee1cde7
CallbackHandlers.cpp https://github.com/NativeScript/android/pull/2074/files#diff-a784229ab7689cd9ce3d502557091158b2943269fad47c1891a15a07c355500e
CallbackHandlers.h https://github.com/NativeScript/android/pull/2074/files#diff-1f7b413d95b12ea3b982950185ce4f7e56c5c02952d656a5dcc0ff8878e37722
Interop.cpp https://github.com/NativeScript/android/pull/2074/files#diff-162f24d9190f568f041ad3397e5ca1ff6b09ad67c486230582e7485b1f4316b5
Interop.h https://github.com/NativeScript/android/pull/2074/files#diff-e20987840676c79a616fe69fc0c49a68637a3c6a817b7df97a0e74ff47de87e6
NsBuiltinModules.cpp https://github.com/NativeScript/android/pull/2074/files#diff-d82c13136f989e9986f3b6974e589fe807eb1d97c6a75bb5f20a6b70a7d98c0f
NumericCasts.cpp https://github.com/NativeScript/android/pull/2074/files#diff-25c9bd49693c635de1cb8fb71c55fa3b985ee49f4eec70c13210c78862ca1a61
NumericCasts.h https://github.com/NativeScript/android/pull/2074/files#diff-c812a9c81a0a7e54d796f3e377eb8851335169df30074fd0d591fff76f16f8c1
Runtime.cpp https://github.com/NativeScript/android/pull/2074/files#diff-b9490640f5d26f7cd6b9a176a2142b8e985a6aac9e2d64287de37fc694e80cc3
README.md https://github.com/NativeScript/android/pull/2074/files#diff-751334ceaf7705bb581ba52ea1f45b471007312e7194253725e94c12eb8f22fe
interop-globals.js https://github.com/NativeScript/android/pull/2074/files#diff-cd0d7757ebfc18b451d54abc6d72ef135ad2617ab01f104b81b79f518d9ec2aa
ns-interop-android.js https://github.com/NativeScript/android/pull/2074/files#diff-86061d7db5f43f56bf215474cdf639a010aaa572e160011a9198f8e636b28499
ns-interop.js https://github.com/NativeScript/android/pull/2074/files#diff-af9926b272174b56be5cb3a6540bb1d73dd52f32b49d8976b3c25ffc5267f781
ns-runtime.js https://github.com/NativeScript/android/pull/2074/files#diff-1b221c3cf542c542ae834bc28a90740980bab35e31b89fb1cb4ca54ec3e47cf3
docs/ns-builtin-modules.mdhttps://github.com/NativeScript/android/pull/2074/files#diff-f49fa83084691682143a83515d6be04f599ea5d1cc41aa8e262d0daf53ebc63d
View file https://github.com/NativeScript/android/blob/da341c09c635a656880d014357bed237e499e212/docs/ns-builtin-modules.md
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/NativeScript/android/pull/2074/{{ revealButtonHref }}
https://github.com/NativeScript/android/pull/2074/files#diff-f49fa83084691682143a83515d6be04f599ea5d1cc41aa8e262d0daf53ebc63d
https://github.com/NativeScript/android/pull/2074/files#diff-f49fa83084691682143a83515d6be04f599ea5d1cc41aa8e262d0daf53ebc63d
https://github.com/NativeScript/android/pull/2074/files#diff-f49fa83084691682143a83515d6be04f599ea5d1cc41aa8e262d0daf53ebc63d
https://github.com/NativeScript/android/pull/2074/files#diff-f49fa83084691682143a83515d6be04f599ea5d1cc41aa8e262d0daf53ebc63d
https://github.com/NativeScript/android/pull/2074/files#diff-f49fa83084691682143a83515d6be04f599ea5d1cc41aa8e262d0daf53ebc63d
https://github.com/NativeScript/android/pull/2074/files#diff-f49fa83084691682143a83515d6be04f599ea5d1cc41aa8e262d0daf53ebc63d
https://github.com/NativeScript/android/pull/2074/files#diff-f49fa83084691682143a83515d6be04f599ea5d1cc41aa8e262d0daf53ebc63d
https://github.com/NativeScript/android/pull/2074/files#diff-f49fa83084691682143a83515d6be04f599ea5d1cc41aa8e262d0daf53ebc63d
test-app/app/src/main/assets/app/mainpage.jshttps://github.com/NativeScript/android/pull/2074/files#diff-b7fd6c22bfc29391e9e3ed935d6c6194b1ad595c7592690229952b5ddb99c0d5
View file https://github.com/NativeScript/android/blob/da341c09c635a656880d014357bed237e499e212/test-app/app/src/main/assets/app/mainpage.js
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/NativeScript/android/pull/2074/{{ revealButtonHref }}
https://github.com/NativeScript/android/pull/2074/files#diff-b7fd6c22bfc29391e9e3ed935d6c6194b1ad595c7592690229952b5ddb99c0d5
https://github.com/NativeScript/android/pull/2074/files#diff-b7fd6c22bfc29391e9e3ed935d6c6194b1ad595c7592690229952b5ddb99c0d5
test-app/app/src/main/assets/app/testNsInteropImport.mjshttps://github.com/NativeScript/android/pull/2074/files#diff-ae9fe2a80a96de8b2ef9acf19b8e9bbed1186a3e317298d28ef1feaa45204f9b
View file https://github.com/NativeScript/android/blob/da341c09c635a656880d014357bed237e499e212/test-app/app/src/main/assets/app/testNsInteropImport.mjs
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/NativeScript/android/pull/2074/{{ revealButtonHref }}
test-app/app/src/main/assets/app/tests/nsInteropWorker.jshttps://github.com/NativeScript/android/pull/2074/files#diff-1da898f0974d2e4bdda350ced0b570951d4dfbc3e8bbb38aba732e5296934009
View file https://github.com/NativeScript/android/blob/da341c09c635a656880d014357bed237e499e212/test-app/app/src/main/assets/app/tests/nsInteropWorker.js
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/NativeScript/android/pull/2074/{{ revealButtonHref }}
test-app/app/src/main/assets/app/tests/testNsInterop.jshttps://github.com/NativeScript/android/pull/2074/files#diff-9547ef88f9a076720ac0ce0c29eeecc3e9a8d5eb216f0e4168b56b4c5d92a40f
View file https://github.com/NativeScript/android/blob/da341c09c635a656880d014357bed237e499e212/test-app/app/src/main/assets/app/tests/testNsInterop.js
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/NativeScript/android/pull/2074/{{ revealButtonHref }}
test-app/app/src/main/assets/app/tests/testNsRuntime.jshttps://github.com/NativeScript/android/pull/2074/files#diff-4c13165b66bfc4406dceadbe2f1a51efe7fc82458b98300d63b3d51d914ddc3b
View file https://github.com/NativeScript/android/blob/da341c09c635a656880d014357bed237e499e212/test-app/app/src/main/assets/app/tests/testNsRuntime.js
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/NativeScript/android/pull/2074/{{ revealButtonHref }}
https://github.com/NativeScript/android/pull/2074/files#diff-4c13165b66bfc4406dceadbe2f1a51efe7fc82458b98300d63b3d51d914ddc3b
https://github.com/NativeScript/android/pull/2074/files#diff-4c13165b66bfc4406dceadbe2f1a51efe7fc82458b98300d63b3d51d914ddc3b
test-app/runtime/CMakeLists.txthttps://github.com/NativeScript/android/pull/2074/files#diff-9aa48152a82c07a60ab6e09923a9b266e2985f78e579653848df730cd8ec5e4c
View file https://github.com/NativeScript/android/blob/da341c09c635a656880d014357bed237e499e212/test-app/runtime/CMakeLists.txt
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/NativeScript/android/pull/2074/{{ revealButtonHref }}
https://github.com/NativeScript/android/pull/2074/files#diff-9aa48152a82c07a60ab6e09923a9b266e2985f78e579653848df730cd8ec5e4c
https://github.com/NativeScript/android/pull/2074/files#diff-9aa48152a82c07a60ab6e09923a9b266e2985f78e579653848df730cd8ec5e4c
test-app/runtime/src/main/cpp/ArrayHelper.cpphttps://github.com/NativeScript/android/pull/2074/files#diff-80d0684b73853a3a7490064fa105595f46c5be59777c2ef04d4c5002f22fbd84
View file https://github.com/NativeScript/android/blob/da341c09c635a656880d014357bed237e499e212/test-app/runtime/src/main/cpp/ArrayHelper.cpp
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/NativeScript/android/pull/2074/{{ revealButtonHref }}
https://github.com/NativeScript/android/pull/2074/files#diff-80d0684b73853a3a7490064fa105595f46c5be59777c2ef04d4c5002f22fbd84
https://github.com/NativeScript/android/pull/2074/files#diff-80d0684b73853a3a7490064fa105595f46c5be59777c2ef04d4c5002f22fbd84
https://github.com/NativeScript/android/pull/2074/files#diff-80d0684b73853a3a7490064fa105595f46c5be59777c2ef04d4c5002f22fbd84
Please reload this pagehttps://github.com/NativeScript/android/pull/2074/files
Please reload this pagehttps://github.com/NativeScript/android/pull/2074/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.