René's URL Explorer Experiment


Title: feat(vite): restart the app when the Vite dev server asks for it by edusperoni · Pull Request #6208 · NativeScript/nativescript-cli · GitHub

Open Graph Title: feat(vite): restart the app when the Vite dev server asks for it by edusperoni · Pull Request #6208 · NativeScript/nativescript-cli

X Title: feat(vite): restart the app when the Vite dev server asks for it by edusperoni · Pull Request #6208 · 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. (No issue. This is the CLI half of NativeScript/NativeScript#11650.) 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. What is the current behavior? The CLI spawns vite serve (the Vite HMR dev server) with stdio: "inherit", so the dev server has no channel back to the CLI. Some changes can't be applied as a hot update, and the dev server has no way to get the app process restarted for them. In @nativescript/vite thin client mode (NativeScript/NativeScript#11650), most edits are applied in place: a hot update, or a soft reload that re-evaluates the app's own modules inside the running process. Some changes need a fresh process instead: edits to code that is evaluated once per process and never re-evaluated by a soft reload (node_modules, linked core, the dev client); a vite.config change, after which Vite restarts its server; a module that called import.meta.hot.decline(); a failed in-process teardown. What is the new behavior? vite serve is spawned with an IPC channel: stdio: ["inherit", "inherit", "inherit", "ipc"]. Its output still goes straight to the terminal. Contract. The dev server may send this message over that channel: process.send({ type: "nativescript:restart", reason: "src/polyfills.ts changed" }); reason is a human-readable string. One message may stand for several requests that the dev server already collapsed. Any other message shape is ignored without a log, so newer @nativescript/vite versions can add message types without breaking this CLI. Flow. BundlerCompilerService receives the message and debounces per platform. Requests that arrive within 300 ms collapse into one, with their distinct reasons joined by ; . It then emits the new BUNDLER_APP_RESTART_REQUESTED event with { projectDir, platform, reason }. RunController subscribes to that event in run() and unsubscribes in stop(). It looks up the session's devices on that platform, logs Restarting the app on : at info level, and calls the existing restartApplication({ projectDir, deviceIdentifiers }). That is the same path the r key shortcut uses: nothing is prepared, built or synced; it waits behind any sync or build already queued on the session's action chain; it goes through refreshApplication, so debug sessions get their debugger re-attached; and errors are reported per device. If the session has no device on that platform, nothing is restarted. Stopping the dev server, whether on session stop or a file-watcher pause, drops its message listener and any pending debounced request. Backwards compatibility. Older @nativescript/vite versions never send anything over the channel, so behaviour is unchanged. The only process.send use in released versions is the nativescript-cli-integration plugin, which is apply: 'build' and doesn't run under vite serve. Vite itself doesn't use the channel. The channel doesn't change process lifetime. The serve child is still registered with the cleanup service and stopped through terminate() as before. A child with no message listener exits normally, and the parent exits once the child does. The debounce timer is unref'd. Webpack, and Vite runs without HMR or without watch, don't start vite serve, so nothing changes for them. Tests. Bundler compiler service: the spawn options include IPC; a restart message emits the event; requests close together collapse into one; unknown messages are ignored, including the build watcher's emittedFiles shape; a pending request is dropped when the dev server stops. Run controller: a request restarts only the session's devices on that platform; a request for a platform with no session device restarts nothing; a request waits for the action already running; the listener is removed when the session stops. Related to 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/6208

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:c3d38c23-d548-5b5d-715c-b30c0e7403a9
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idB1A4:19F84C:198F7D9:209AE69:6B0133C4
html-safe-nonce5a6d7be0805e257bff71fe445d389acce0707d3c6592e02045f868654554b73e
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMUE0OjE5Rjg0QzoxOThGN0Q5OjIwOUFFNjk6NkIwMTMzQzQiLCJ2aXNpdG9yX2lkIjoiMjE2ODA4NTM5NjczMzM3NTQyOSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmaccc0193a432a67fcb25b6d15f7a5f38334adbc02399d3f24af53533e1e01f6b95
hovercard-subject-tagpull_request:5387811403
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/6208/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/6208/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FNativeScript%2Fnativescript-cli%2Fpull%2F6208%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%2F6208%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/6208/files
Reloadhttps://github.com/NativeScript/nativescript-cli/pull/6208/files
Reloadhttps://github.com/NativeScript/nativescript-cli/pull/6208/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
mainhttps://github.com/NativeScript/nativescript-cli/tree/main
feat/vite-restart-ipchttps://github.com/NativeScript/nativescript-cli/tree/feat/vite-restart-ipc
Conversation 2 https://github.com/NativeScript/nativescript-cli/pull/6208
Commits 1 https://github.com/NativeScript/nativescript-cli/pull/6208/commits
Checks 11 https://github.com/NativeScript/nativescript-cli/pull/6208/checks
Files changed https://github.com/NativeScript/nativescript-cli/pull/6208/files
Please reload this pagehttps://github.com/NativeScript/nativescript-cli/pull/6208/files
feat(vite): restart the app when the Vite dev server asks for it https://github.com/NativeScript/nativescript-cli/pull/6208/files#top
Show all changes 1 commit https://github.com/NativeScript/nativescript-cli/pull/6208/files
437a3bc feat(vite): restart the app when the Vite dev server asks for it edusperoni Nov 19, 2026 https://github.com/NativeScript/nativescript-cli/pull/6208/commits/437a3bcfb19e616c53b4255c5b0e76fc7861d579
Clear filters https://github.com/NativeScript/nativescript-cli/pull/6208/files
Please reload this pagehttps://github.com/NativeScript/nativescript-cli/pull/6208/files
Please reload this pagehttps://github.com/NativeScript/nativescript-cli/pull/6208/files
constants.ts https://github.com/NativeScript/nativescript-cli/pull/6208/files#diff-561ab956a0b904914573a9544f92493c5493b6e14d30372365bcdd9c5c7f6e59
run-controller.ts https://github.com/NativeScript/nativescript-cli/pull/6208/files#diff-73b7dd9d5c397c4480431594f57db56cea38b1b826fde043238c66be19c12a6d
bundler-compiler-service.ts https://github.com/NativeScript/nativescript-cli/pull/6208/files#diff-8521a4dbe0da9ef2aed7d98bcabac41a7465f50c76019e2b539c9d214c4bf310
bundler.ts https://github.com/NativeScript/nativescript-cli/pull/6208/files#diff-bf2c028ccaa68f98c759ceb02473b4c450317d6944f12d21f1f1cb0014c721f6
run-controller.ts https://github.com/NativeScript/nativescript-cli/pull/6208/files#diff-ccbf4fb592dcd0762981b2d83f501ba0ac5ae3bc66f2c86cd47bfb7e930afb69
bundler-compiler-service.ts https://github.com/NativeScript/nativescript-cli/pull/6208/files#diff-4aff644393b3f3d7396dc660ba7b7accf6c9ef623274ae52cf7ea04e9b5c774f
lib/constants.tshttps://github.com/NativeScript/nativescript-cli/pull/6208/files#diff-561ab956a0b904914573a9544f92493c5493b6e14d30372365bcdd9c5c7f6e59
View file https://github.com/NativeScript/nativescript-cli/blob/437a3bcfb19e616c53b4255c5b0e76fc7861d579/lib/constants.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/NativeScript/nativescript-cli/pull/6208/{{ revealButtonHref }}
https://github.com/NativeScript/nativescript-cli/pull/6208/files#diff-561ab956a0b904914573a9544f92493c5493b6e14d30372365bcdd9c5c7f6e59
https://github.com/NativeScript/nativescript-cli/pull/6208/files#diff-561ab956a0b904914573a9544f92493c5493b6e14d30372365bcdd9c5c7f6e59
lib/controllers/run-controller.tshttps://github.com/NativeScript/nativescript-cli/pull/6208/files#diff-73b7dd9d5c397c4480431594f57db56cea38b1b826fde043238c66be19c12a6d
View file https://github.com/NativeScript/nativescript-cli/blob/437a3bcfb19e616c53b4255c5b0e76fc7861d579/lib/controllers/run-controller.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/NativeScript/nativescript-cli/pull/6208/{{ revealButtonHref }}
https://github.com/NativeScript/nativescript-cli/pull/6208/files#diff-73b7dd9d5c397c4480431594f57db56cea38b1b826fde043238c66be19c12a6d
https://github.com/NativeScript/nativescript-cli/pull/6208/files#diff-73b7dd9d5c397c4480431594f57db56cea38b1b826fde043238c66be19c12a6d
https://github.com/NativeScript/nativescript-cli/pull/6208/files#diff-73b7dd9d5c397c4480431594f57db56cea38b1b826fde043238c66be19c12a6d
https://github.com/NativeScript/nativescript-cli/pull/6208/files#diff-73b7dd9d5c397c4480431594f57db56cea38b1b826fde043238c66be19c12a6d
https://github.com/NativeScript/nativescript-cli/pull/6208/files#diff-73b7dd9d5c397c4480431594f57db56cea38b1b826fde043238c66be19c12a6d
https://github.com/NativeScript/nativescript-cli/pull/6208/files#diff-73b7dd9d5c397c4480431594f57db56cea38b1b826fde043238c66be19c12a6d
https://github.com/NativeScript/nativescript-cli/pull/6208/files#diff-73b7dd9d5c397c4480431594f57db56cea38b1b826fde043238c66be19c12a6d
https://github.com/NativeScript/nativescript-cli/pull/6208/files#diff-73b7dd9d5c397c4480431594f57db56cea38b1b826fde043238c66be19c12a6d
https://github.com/NativeScript/nativescript-cli/pull/6208/files#diff-73b7dd9d5c397c4480431594f57db56cea38b1b826fde043238c66be19c12a6d
https://github.com/NativeScript/nativescript-cli/pull/6208/files#diff-73b7dd9d5c397c4480431594f57db56cea38b1b826fde043238c66be19c12a6d
lib/services/bundler/bundler-compiler-service.tshttps://github.com/NativeScript/nativescript-cli/pull/6208/files#diff-8521a4dbe0da9ef2aed7d98bcabac41a7465f50c76019e2b539c9d214c4bf310
View file https://github.com/NativeScript/nativescript-cli/blob/437a3bcfb19e616c53b4255c5b0e76fc7861d579/lib/services/bundler/bundler-compiler-service.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/NativeScript/nativescript-cli/pull/6208/{{ revealButtonHref }}
https://github.com/NativeScript/nativescript-cli/pull/6208/files#diff-8521a4dbe0da9ef2aed7d98bcabac41a7465f50c76019e2b539c9d214c4bf310
https://github.com/NativeScript/nativescript-cli/pull/6208/files#diff-8521a4dbe0da9ef2aed7d98bcabac41a7465f50c76019e2b539c9d214c4bf310
https://github.com/NativeScript/nativescript-cli/pull/6208/files#diff-8521a4dbe0da9ef2aed7d98bcabac41a7465f50c76019e2b539c9d214c4bf310
https://github.com/NativeScript/nativescript-cli/pull/6208/files#diff-8521a4dbe0da9ef2aed7d98bcabac41a7465f50c76019e2b539c9d214c4bf310
https://github.com/NativeScript/nativescript-cli/pull/6208/files#diff-8521a4dbe0da9ef2aed7d98bcabac41a7465f50c76019e2b539c9d214c4bf310
https://github.com/NativeScript/nativescript-cli/pull/6208/files#diff-8521a4dbe0da9ef2aed7d98bcabac41a7465f50c76019e2b539c9d214c4bf310
https://github.com/NativeScript/nativescript-cli/pull/6208/files#diff-8521a4dbe0da9ef2aed7d98bcabac41a7465f50c76019e2b539c9d214c4bf310
https://github.com/NativeScript/nativescript-cli/pull/6208/files#diff-8521a4dbe0da9ef2aed7d98bcabac41a7465f50c76019e2b539c9d214c4bf310
https://github.com/NativeScript/nativescript-cli/pull/6208/files#diff-8521a4dbe0da9ef2aed7d98bcabac41a7465f50c76019e2b539c9d214c4bf310
https://github.com/NativeScript/nativescript-cli/pull/6208/files#diff-8521a4dbe0da9ef2aed7d98bcabac41a7465f50c76019e2b539c9d214c4bf310
https://github.com/NativeScript/nativescript-cli/pull/6208/files#diff-8521a4dbe0da9ef2aed7d98bcabac41a7465f50c76019e2b539c9d214c4bf310
https://github.com/NativeScript/nativescript-cli/pull/6208/files#diff-8521a4dbe0da9ef2aed7d98bcabac41a7465f50c76019e2b539c9d214c4bf310
lib/services/bundler/bundler.tshttps://github.com/NativeScript/nativescript-cli/pull/6208/files#diff-bf2c028ccaa68f98c759ceb02473b4c450317d6944f12d21f1f1cb0014c721f6
View file https://github.com/NativeScript/nativescript-cli/blob/437a3bcfb19e616c53b4255c5b0e76fc7861d579/lib/services/bundler/bundler.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/NativeScript/nativescript-cli/pull/6208/{{ revealButtonHref }}
https://github.com/NativeScript/nativescript-cli/pull/6208/files#diff-bf2c028ccaa68f98c759ceb02473b4c450317d6944f12d21f1f1cb0014c721f6
https://github.com/NativeScript/nativescript-cli/pull/6208/files#diff-bf2c028ccaa68f98c759ceb02473b4c450317d6944f12d21f1f1cb0014c721f6
test/controllers/run-controller.tshttps://github.com/NativeScript/nativescript-cli/pull/6208/files#diff-ccbf4fb592dcd0762981b2d83f501ba0ac5ae3bc66f2c86cd47bfb7e930afb69
View file https://github.com/NativeScript/nativescript-cli/blob/437a3bcfb19e616c53b4255c5b0e76fc7861d579/test/controllers/run-controller.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/NativeScript/nativescript-cli/pull/6208/{{ revealButtonHref }}
https://github.com/NativeScript/nativescript-cli/pull/6208/files#diff-ccbf4fb592dcd0762981b2d83f501ba0ac5ae3bc66f2c86cd47bfb7e930afb69
https://github.com/NativeScript/nativescript-cli/pull/6208/files#diff-ccbf4fb592dcd0762981b2d83f501ba0ac5ae3bc66f2c86cd47bfb7e930afb69
https://github.com/NativeScript/nativescript-cli/pull/6208/files#diff-ccbf4fb592dcd0762981b2d83f501ba0ac5ae3bc66f2c86cd47bfb7e930afb69
https://github.com/NativeScript/nativescript-cli/pull/6208/files#diff-ccbf4fb592dcd0762981b2d83f501ba0ac5ae3bc66f2c86cd47bfb7e930afb69
https://github.com/NativeScript/nativescript-cli/pull/6208/files#diff-ccbf4fb592dcd0762981b2d83f501ba0ac5ae3bc66f2c86cd47bfb7e930afb69
https://github.com/NativeScript/nativescript-cli/pull/6208/files#diff-ccbf4fb592dcd0762981b2d83f501ba0ac5ae3bc66f2c86cd47bfb7e930afb69
Please reload this pagehttps://github.com/NativeScript/nativescript-cli/pull/6208/files
Please reload this pagehttps://github.com/NativeScript/nativescript-cli/pull/6208/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.