René's URL Explorer Experiment


Title: docs: drop `return global.__native(this)` from Android subclass examples by edusperoni · Pull Request #206 · NativeScript/docs · GitHub

Open Graph Title: docs: drop `return global.__native(this)` from Android subclass examples by edusperoni · Pull Request #206 · NativeScript/docs

X Title: docs: drop `return global.__native(this)` from Android subclass examples by edusperoni · Pull Request #206 · NativeScript/docs

Description: The Android subclassing examples end their TypeScript constructors with return global.__native(this), and the agent guidance (assets/agentic/NATIVESCRIPT.md) tells coding agents to do the same. With TypeScript 2.0 and newer this call does nothing. Why it's a no-op When a TypeScript-compiled constructor calls a native base class's call/apply, the Android runtime marks the JS this with __container__ and returns the real native instance. __native(x) only unwraps objects that carry __container__. TypeScript < 2.0 emitted _super.call(this); return __native(this);, so this was the container and the call was needed. TypeScript 2.0+ emits var _this = _super.call(this) || this; ... return global.__native(_this);. _this is already the native instance, which never has __container__, so __native(_this) returns it unchanged. Every current NativeScript project compiles with TypeScript 2.0+, so a constructor only needs super(...), and can be left out if it does nothing else. The runtime still defines global.__native for backward compatibility (internal/ts_helpers.js in the Android runtime), so existing code that calls it keeps working. This only simplifies the docs; nothing breaks. Changes content/guide/extending-classes-and-implementing-interfaces-android.md: removed the call and its "necessary when extending TypeScript constructors" comments from the four TypeScript examples. Removed constructors that only called super(). Added a short tip saying the call isn't needed with TypeScript 2.0+ and that existing calls are harmless. content/guide/android-marshalling.md: removed the super() + __native constructors from the two MyVersatileCopyWriter examples. content/public/assets/agentic/NATIVESCRIPT.md: removed the constructor from the MyButton example and added an explicit instruction not to add return global.__native(this), since agents have likely seen the old pattern elsewhere. Verification npm run build (vitepress) succeeds, and the new tip renders. prettier --check and textlint find nothing new in the changed files. npm run lint:format already fails on main because of two unrelated files (content/configuration/vite.md, vite-framework-flavors.md), and NATIVESCRIPT.md was already unformatted before this change. A second commit runs prettier on content/configuration/vite.md and vite-framework-flavors.md. They were unformatted on main, which made the lint:format step (and so the build check) fail on every PR. It changes formatting only.

Open Graph Description: The Android subclassing examples end their TypeScript constructors with return global.__native(this), and the agent guidance (assets/agentic/NATIVESCRIPT.md) tells coding agents to do the same. Wit...

X Description: The Android subclassing examples end their TypeScript constructors with return global.__native(this), and the agent guidance (assets/agentic/NATIVESCRIPT.md) tells coding agents to do the same. Wit...

Opengraph URL: https://github.com/NativeScript/docs/pull/206

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:cc362742-308a-b63d-8dcc-1ca7cc33e6dd
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-id85EC:2E3FEE:15CC71B:1BA3723:6B0130F9
html-safe-nonce88c2ebb70e0a6f4d396b25a313aea13a679a8c9c1ed1654a8d25e98aeb5e5d51
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4NUVDOjJFM0ZFRToxNUNDNzFCOjFCQTM3MjM6NkIwMTMwRjkiLCJ2aXNpdG9yX2lkIjoiNjk4ODM1MDg1ODMwMzk3NTY3MyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac726c69dc2051ab666e2a832f0b02349236805c7c3015cf152b88cb468d2ae64b
hovercard-subject-tagpull_request:5253698794
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/docs/pull/206/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:altThe Android subclassing examples end their TypeScript constructors with return global.__native(this), and the agent guidance (assets/agentic/NATIVESCRIPT.md) tells coding agents to do the same. Wit...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
Nonecc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/NativeScript/docs git https://github.com/NativeScript/docs.git
octolytics-dimension-user_id7392261
octolytics-dimension-user_loginNativeScript
octolytics-dimension-repository_id567462026
octolytics-dimension-repository_nwoNativeScript/docs
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id567462026
octolytics-dimension-repository_network_root_nwoNativeScript/docs
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-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/NativeScript/docs/pull/206/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FNativeScript%2Fdocs%2Fpull%2F206%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%2Fdocs%2Fpull%2F206%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%2Fdocs
Reloadhttps://github.com/NativeScript/docs/pull/206/files
Reloadhttps://github.com/NativeScript/docs/pull/206/files
Reloadhttps://github.com/NativeScript/docs/pull/206/files
NativeScripthttps://github.com/NativeScript
docshttps://github.com/NativeScript/docs
Codehttps://github.com/NativeScript/docs
Issues26 (26)https://github.com/NativeScript/docs/issues
Pull requests8 (8)https://github.com/NativeScript/docs/pulls
Actionshttps://github.com/NativeScript/docs/actions
Projectshttps://github.com/NativeScript/docs/projects
Security and qualityhttps://github.com/NativeScript/docs/security
Insightshttps://github.com/NativeScript/docs/insights
Sign up for GitHub https://github.com/signup?return_to=%2FNativeScript%2Fdocs%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2FNativeScript%2Fdocs%2Fissues%2Fnew%2Fchoose
NathanWalkerhttps://github.com/NathanWalker
NativeScript:mainhttps://github.com/NativeScript/docs/tree/main
edusperoni:docs/drop-global-nativehttps://github.com/edusperoni/docs/tree/docs/drop-global-native
Conversation 1 https://github.com/NativeScript/docs/pull/206
Commits 2 https://github.com/NativeScript/docs/pull/206/commits
Checks 2 https://github.com/NativeScript/docs/pull/206/checks
Files changed https://github.com/NativeScript/docs/pull/206/files
Please reload this pagehttps://github.com/NativeScript/docs/pull/206/files
docs: drop return global.__native(this) from Android subclass examples https://github.com/NativeScript/docs/pull/206/files#top
Show all changes 2 commits https://github.com/NativeScript/docs/pull/206/files
7a00133 docs: drop `return global.__native(this)` from Android subclass examples edusperoni Nov 11, 2026 https://github.com/NativeScript/docs/pull/206/commits/7a00133b618beb0335301c95e35da35161dd87bf
836791f docs: format the Vite configuration pages with prettier edusperoni Nov 11, 2026 https://github.com/NativeScript/docs/pull/206/commits/836791fbc2f4e0ca398cd0033d2a5b36bb5e975f
Clear filters https://github.com/NativeScript/docs/pull/206/files
Please reload this pagehttps://github.com/NativeScript/docs/pull/206/files
Please reload this pagehttps://github.com/NativeScript/docs/pull/206/files
vite-framework-flavors.md https://github.com/NativeScript/docs/pull/206/files#diff-7a316a9a3d7ae7968eb6f43d0598f18eb4c12c5d2061a87adac9a969306da2bc
vite.md https://github.com/NativeScript/docs/pull/206/files#diff-eddefbabcc0b43ea93632013d21f3a39168c27f72585d641594dc0f498a944a7
android-marshalling.md https://github.com/NativeScript/docs/pull/206/files#diff-14168d90140cd8bb893192275263607ecf07227da5afb5961f720efc730b9d4a
extending-classes-and-implementing-interfaces-android.md https://github.com/NativeScript/docs/pull/206/files#diff-629f790b76380bdda8d51663e3e492a5b276b0d0986a3ae1b4f0dcedbbf4e9fb
NATIVESCRIPT.md https://github.com/NativeScript/docs/pull/206/files#diff-9f237bbe383165234ced48d1ee6a7a8137dae2b5b374daba1a2ec2bae3987f40
Please reload this pagehttps://github.com/NativeScript/docs/pull/206/files
Please reload this pagehttps://github.com/NativeScript/docs/pull/206/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.