René's URL Explorer Experiment


Title: feat(vite): single-process HMR dev and debug cleartext for Android by edusperoni · Pull Request #6209 · NativeScript/nativescript-cli · GitHub

Open Graph Title: feat(vite): single-process HMR dev and debug cleartext for Android by edusperoni · Pull Request #6209 · NativeScript/nativescript-cli

X Title: feat(vite): single-process HMR dev and debug cleartext for Android by edusperoni · Pull Request #6209 · NativeScript/nativescript-cli

Description: PR Checklist The PR title follows our guidelines: https://github.com/NativeScript/NativeScript/blob/master/tools/notes/CONTRIBUTING.md#commit-messages. There is an issue for the bug/feature this PR is for. To avoid wasting your time, it's best to open a suggestion issue first and wait for approval before working on it. You have signed the CLA. All existing tests are passing: https://github.com/NativeScript/nativescript-cli/blob/master/CONTRIBUTING.md#contribute-to-the-code-base Tests for the changes are included. Stacked on #6208 (feat/vite-restart-ipc); review that one first. Pairs with NativeScript/NativeScript#11650 (the @nativescript/vite side). What is the current behavior? A Vite HMR session runs two Vite processes per platform: vite serve for HMR and vite build --watch to produce bundle.mjs, package.json and the app's static files that the CLI copies into the native project. On Android, a Vite HMR app loads its code from the dev server (127.0.0.1 through adb reverse) over plain HTTP. Android blocks cleartext HTTP by default since API 28, so the app cannot reach the dev server unless the project opts in by hand. What is the new behavior? Single-process HMR dev (iOS / visionOS) When the installed @nativescript/vite lists the platform under nativescriptCli.singleProcessDev in its package.json, the CLI spawns only vite serve with NS_VITE_SINGLE_PROCESS=1 and does not start the vite build --watch child. The dev server writes bundle.mjs, package.json and the app's static files into the staging directory itself and sends the same build messages vite build --watch sends today. The CLI takes those messages from the vite serve child, copies and syncs on them as before, and launches the app on the first one. One Vite process instead of two. A build message may now carry an optional removedFiles list, which the CLI deletes from the native app folder (assets removed during a session). The serve process is tracked as the platform's bundler process; a serve exit before its first message fails the run, and stopping the session terminates it once. The capability is a handshake: a package without the field keeps the two-process session, and an older CLI never sets NS_VITE_SINGLE_PROCESS, so the package keeps its two-process behavior. Every old/new package + CLI combination stays on a working path. NS_VITE_SINGLE_PROCESS=0 in the CLI's environment opts out. Debug-only cleartext for Android Vite HMR runs For a debug build with HMR on and the Vite bundler, native prepare writes a debug source set manifest (platforms/android/app/src/debug/AndroidManifest.xml) with android:usesCleartextTraffic="true" (and tools:replace for it). An app that ships its own debug manifest in App_Resources gets the attribute added to the copied file instead. App_Resources is never modified. Any other prepare (release, --no-hmr, another bundler) removes the file the CLI wrote, and the change check compares the wanted state with the native project so switching modes rebuilds the app. Because it lives in the debug source set, the attribute never reaches release builds. An app's own networkSecurityConfig takes precedence over the attribute and has to allow the dev host itself. Host projects (hostProjectPath) are skipped: native prepare doesn't write the manifest there, so the change check must not compare it. Verification iOS simulator, Vue and Angular apps in single-process mode: boot, edits, boot-error card, server-down fallback, and assets added / changed / removed. Compatibility matrix: new / old @nativescript/vite × new / old CLI, each combination takes a working path (single-process only when both sides are new). Android emulator API 35: debug HMR run reaches the dev server with cleartext enabled; a release build has no usesCleartextTraffic in its merged manifest (checked with aapt2). CLI unit suite: 2179 tests passing, including new specs for the single-process session and the cleartext manifest. Stacked on #6208. Pairs with NativeScript/NativeScript#11650.

Open Graph Description: PR Checklist The PR title follows our guidelines: https://github.com/NativeScript/NativeScript/blob/master/tools/notes/CONTRIBUTING.md#commit-messages. There is an issue for the bug/feature this...

X Description: PR Checklist The PR title follows our guidelines: https://github.com/NativeScript/NativeScript/blob/master/tools/notes/CONTRIBUTING.md#commit-messages. There is an issue for the bug/feature this...

Opengraph URL: https://github.com/NativeScript/nativescript-cli/pull/6209

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:cb2cab1b-e4dc-07e7-0541-ff59a4c3381e
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idE378:20AA01:19A30B5:2097241:6B0133BB
html-safe-nonce0f9629edbd1b71b3018a3bfaf6360e4f3e979311b0a843d7bafc1566ff53c39e
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFMzc4OjIwQUEwMToxOUEzMEI1OjIwOTcyNDE6NkIwMTMzQkIiLCJ2aXNpdG9yX2lkIjoiNzk5NDAzNTYxNDA3OTA3MTE2NCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmacb95ca750ba3bce9e51512b680e2076cd6578f765f0df0b5d77afbf44f5b0eff8
hovercard-subject-tagpull_request:5413955728
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/nativescript-cli/pull/6209/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:altPR Checklist The PR title follows our guidelines: https://github.com/NativeScript/NativeScript/blob/master/tools/notes/CONTRIBUTING.md#commit-messages. There is an issue for the bug/feature this...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
Nonecc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/NativeScript/nativescript-cli git https://github.com/NativeScript/nativescript-cli.git
octolytics-dimension-user_id7392261
octolytics-dimension-user_loginNativeScript
octolytics-dimension-repository_id21347346
octolytics-dimension-repository_nwoNativeScript/nativescript-cli
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id21347346
octolytics-dimension-repository_network_root_nwoNativeScript/nativescript-cli
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/nativescript-cli/pull/6209/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FNativeScript%2Fnativescript-cli%2Fpull%2F6209%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%2Fnativescript-cli%2Fpull%2F6209%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%2Fnativescript-cli
Reloadhttps://github.com/NativeScript/nativescript-cli/pull/6209/files
Reloadhttps://github.com/NativeScript/nativescript-cli/pull/6209/files
Reloadhttps://github.com/NativeScript/nativescript-cli/pull/6209/files
NativeScripthttps://github.com/NativeScript
nativescript-clihttps://github.com/NativeScript/nativescript-cli
Codehttps://github.com/NativeScript/nativescript-cli
Issues357 (357)https://github.com/NativeScript/nativescript-cli/issues
Pull requests37 (37)https://github.com/NativeScript/nativescript-cli/pulls
Actionshttps://github.com/NativeScript/nativescript-cli/actions
Projectshttps://github.com/NativeScript/nativescript-cli/projects
Security and qualityhttps://github.com/NativeScript/nativescript-cli/security
Insightshttps://github.com/NativeScript/nativescript-cli/insights
Sign up for GitHub https://github.com/signup?return_to=%2FNativeScript%2Fnativescript-cli%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2FNativeScript%2Fnativescript-cli%2Fissues%2Fnew%2Fchoose
edusperonihttps://github.com/edusperoni
feat/vite-restart-ipchttps://github.com/NativeScript/nativescript-cli/tree/feat/vite-restart-ipc
feat/vite-single-processhttps://github.com/NativeScript/nativescript-cli/tree/feat/vite-single-process
Conversation 1 https://github.com/NativeScript/nativescript-cli/pull/6209
Commits 4 https://github.com/NativeScript/nativescript-cli/pull/6209/commits
Checks 8 https://github.com/NativeScript/nativescript-cli/pull/6209/checks
Files changed 9 https://github.com/NativeScript/nativescript-cli/pull/6209/files
feat(vite): single-process HMR dev and debug cleartext for Android https://github.com/NativeScript/nativescript-cli/pull/6209/files#top
Show all changes 4 commits https://github.com/NativeScript/nativescript-cli/pull/6209/files
8aad4ea feat(vite): run HMR sessions on vite serve alone when the package sup… edusperoni Nov 20, 2026 https://github.com/NativeScript/nativescript-cli/pull/6209/commits/8aad4eaa6cbd71bcd7f4a2945f62999d51385a9f
a399bbd feat(vite): allow cleartext HTTP to the dev server in Android debug H… edusperoni Nov 20, 2026 https://github.com/NativeScript/nativescript-cli/pull/6209/commits/a399bbd66e4ddd6610a1d76ba3756880f0a5c894
15c9aa8 fix(vite): skip the dev cleartext change check for host projects edusperoni Nov 20, 2026 https://github.com/NativeScript/nativescript-cli/pull/6209/commits/15c9aa8785b7f0f92a24c2c18633c129e07a75c4
4442612 fix(vite): skip the in-app refresh before restarting on Android HMR s… edusperoni Nov 20, 2026 https://github.com/NativeScript/nativescript-cli/pull/6209/commits/4442612ee58f1a3ea0edfee52cc1c54422a1c861
Clear filters https://github.com/NativeScript/nativescript-cli/pull/6209/files
Please reload this pagehttps://github.com/NativeScript/nativescript-cli/pull/6209/files
Please reload this pagehttps://github.com/NativeScript/nativescript-cli/pull/6209/files
android-project-service.ts https://github.com/NativeScript/nativescript-cli/pull/6209/files#diff-cc87259033e9377285616a13cbe198cd3bf42d79a9c6f63ce1642a9f03486415
dev-cleartext-manifest.ts https://github.com/NativeScript/nativescript-cli/pull/6209/files#diff-c32e2a1a82b2bc33bd425185035e83ab4e332e0a076fee4865f7affaa8c25f84
bundler-compiler-service.ts https://github.com/NativeScript/nativescript-cli/pull/6209/files#diff-8521a4dbe0da9ef2aed7d98bcabac41a7465f50c76019e2b539c9d214c4bf310
bundler.ts https://github.com/NativeScript/nativescript-cli/pull/6209/files#diff-bf2c028ccaa68f98c759ceb02473b4c450317d6944f12d21f1f1cb0014c721f6
android-device-livesync-sockets-service.ts https://github.com/NativeScript/nativescript-cli/pull/6209/files#diff-6c5a97f67df430e4a7f9d50ea4696fc8d98860f17056bd0a478a11349e43aed4
prepare-native-platform-service.ts https://github.com/NativeScript/nativescript-cli/pull/6209/files#diff-fbc223b306c2ee92f4dd44ecaadf7f1ca0fce9c0ed9a7f91c0ad8ddbeaedc175
dev-cleartext-manifest.ts https://github.com/NativeScript/nativescript-cli/pull/6209/files#diff-93cd679cf1661af437431f75149534cda6b7070a7002dbcee582aa5b7c66d06c
bundler-compiler-service.ts https://github.com/NativeScript/nativescript-cli/pull/6209/files#diff-4aff644393b3f3d7396dc660ba7b7accf6c9ef623274ae52cf7ea04e9b5c774f
android-device-livesync-sockets-service.ts https://github.com/NativeScript/nativescript-cli/pull/6209/files#diff-b6e7511fbb695d4b80302c2683414e52e59d515076a352f38b482f34b2c9695a
lib/services/android-project-service.tshttps://github.com/NativeScript/nativescript-cli/pull/6209/files#diff-cc87259033e9377285616a13cbe198cd3bf42d79a9c6f63ce1642a9f03486415
View file https://github.com/NativeScript/nativescript-cli/blob/4442612ee58f1a3ea0edfee52cc1c54422a1c861/lib/services/android-project-service.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/NativeScript/nativescript-cli/pull/6209/{{ revealButtonHref }}
https://github.com/NativeScript/nativescript-cli/pull/6209/files#diff-cc87259033e9377285616a13cbe198cd3bf42d79a9c6f63ce1642a9f03486415
https://github.com/NativeScript/nativescript-cli/pull/6209/files#diff-cc87259033e9377285616a13cbe198cd3bf42d79a9c6f63ce1642a9f03486415
https://github.com/NativeScript/nativescript-cli/pull/6209/files#diff-cc87259033e9377285616a13cbe198cd3bf42d79a9c6f63ce1642a9f03486415
https://github.com/NativeScript/nativescript-cli/pull/6209/files#diff-cc87259033e9377285616a13cbe198cd3bf42d79a9c6f63ce1642a9f03486415
lib/services/android/dev-cleartext-manifest.tshttps://github.com/NativeScript/nativescript-cli/pull/6209/files#diff-c32e2a1a82b2bc33bd425185035e83ab4e332e0a076fee4865f7affaa8c25f84
View file https://github.com/NativeScript/nativescript-cli/blob/4442612ee58f1a3ea0edfee52cc1c54422a1c861/lib/services/android/dev-cleartext-manifest.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/NativeScript/nativescript-cli/pull/6209/{{ revealButtonHref }}
Please reload this pagehttps://github.com/NativeScript/nativescript-cli/pull/6209/files
Please reload this pagehttps://github.com/NativeScript/nativescript-cli/pull/6209/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.