René's URL Explorer Experiment


Title: feat: in-place component HMR under Vite by edusperoni · Pull Request #183 · NativeScript/angular · GitHub

Open Graph Title: feat: in-place component HMR under Vite by edusperoni · Pull Request #183 · NativeScript/angular

X Title: feat: in-place component HMR under Vite by edusperoni · Pull Request #183 · NativeScript/angular

Description: PR Checklist The PR title follows our guidelines: https://github.com/NativeScript/NativeScript/blob/master/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/angular/blob/master/DevelopmentWorkflow.md#running-the-tests Tests for the changes are included. Draft, for tracking progress. This is the Angular side of NativeScript/NativeScript#11650 (Vite thin client mode). So far it has been verified only on an iOS 26.3 simulator, using the Angular 22 + Analog 2.9.7 fixture from that PR. There are no unit tests yet: the renderer has no spec harness in this repo. What is the current behavior? HMR under Vite never bootstraps the app. runNativeScriptAngularApp waits for launchEvent, but the dev server's boot UI has already consumed it. The HMR dispose and reboot hooks are also gated on import.meta.webpackHot only. Angular's web-style HMR (ɵɵreplaceMetadata) can't apply styles: every emulated component's CSS shares a single tag; componentReplaced isn't implemented; external runtime styles (getExternalStyles, which dev servers emit for style HMR) are ignored, so a restyled component loses its styles. Edits to those stylesheets arrive as Vite's css-update, which nothing on device handles. What is the new behavior? Bootstrap and HMR hooks: The app bootstraps immediately when it has already launched (Application.hasLaunched()). The HMR hooks are wired for import.meta.hot as well as webpackHot. Per-component styles: Each EmulatedRenderer tags its CSS with :. NativeScriptRendererFactory.componentReplaced() drops the component's renderer and styles, so the replacement metadata's styles apply. ngOnDestroy cleans up all of them. External runtime styles: They are fetched with Accept: text/css, as a would request them, and resolved against the new NATIVESCRIPT_STYLE_BASE_URL token. That token defaults to globalThis.__NS_DEV_ORIGIN__, which @nativescript/vite sets during dev. They are applied under the component's tag, followed by _onCssStateChange(). Stylesheet HMR: The renderer factory listens for vite:beforeUpdate on @nativescript/vite's device HMR registry (__NS_HOT_REGISTRY__.on/off). For each css-update, every emulated renderer that loaded that path refetches it with t= and rebuilds its tag. This is a stylesheet swap like Vite's handling on the web, so no views are recreated. The registry only exists during Vite dev, so release and webpack builds are unaffected. Verified on the iOS simulator, same process throughout: template edits apply in place with component state kept; four CSS edits in a row each apply; a template edit followed by a CSS edit both apply. Known gaps: ViewEncapsulation.None components don't load external styles yet. .ts edits under thin mode fail on the @nativescript/vite side; see the companion PR. No issue yet; this PR tracks the experiment.

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

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

Opengraph URL: https://github.com/NativeScript/angular/pull/183

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:f27bec56-06ff-7ea4-6c2e-c439986982ee
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-id9CFA:3DD488:159639B:1B6060C:6B013362
html-safe-noncec0ed16fccbcf85f7873b0be0e4bd2cac010e5eed8f443dd5497d6ced4fa2ea95
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5Q0ZBOjNERDQ4ODoxNTk2MzlCOjFCNjA2MEM6NkIwMTMzNjIiLCJ2aXNpdG9yX2lkIjoiNTE1NTQ4NTA0OTQ3ODUyNTc5NCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac8cbb3cbe41bc286c6a3e6e4292f9466dab4bb78daf0827f189e980fd737feb6e
hovercard-subject-tagpull_request:5384867026
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/angular/pull/183/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/CONTRIBUTING.md#commit-messages. There is an issue for the bug/feature this PR is for. ...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
Nonecc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/NativeScript/angular git https://github.com/NativeScript/angular.git
octolytics-dimension-user_id7392261
octolytics-dimension-user_loginNativeScript
octolytics-dimension-repository_id302428305
octolytics-dimension-repository_nwoNativeScript/angular
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id302428305
octolytics-dimension-repository_network_root_nwoNativeScript/angular
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/angular/pull/183/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FNativeScript%2Fangular%2Fpull%2F183%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%2Fangular%2Fpull%2F183%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%2Fangular
Reloadhttps://github.com/NativeScript/angular/pull/183/files
Reloadhttps://github.com/NativeScript/angular/pull/183/files
Reloadhttps://github.com/NativeScript/angular/pull/183/files
NativeScripthttps://github.com/NativeScript
angularhttps://github.com/NativeScript/angular
Codehttps://github.com/NativeScript/angular
Issues38 (38)https://github.com/NativeScript/angular/issues
Pull requests5 (5)https://github.com/NativeScript/angular/pulls
Actionshttps://github.com/NativeScript/angular/actions
Projectshttps://github.com/NativeScript/angular/projects
Security and qualityhttps://github.com/NativeScript/angular/security
Insightshttps://github.com/NativeScript/angular/insights
Sign up for GitHub https://github.com/signup?return_to=%2FNativeScript%2Fangular%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2FNativeScript%2Fangular%2Fissues%2Fnew%2Fchoose
edusperonihttps://github.com/edusperoni
mainhttps://github.com/NativeScript/angular/tree/main
feat/web-style-hmrhttps://github.com/NativeScript/angular/tree/feat/web-style-hmr
Conversation 4 https://github.com/NativeScript/angular/pull/183
Commits 4 https://github.com/NativeScript/angular/pull/183/commits
Checks 9 https://github.com/NativeScript/angular/pull/183/checks
Files changed https://github.com/NativeScript/angular/pull/183/files
Please reload this pagehttps://github.com/NativeScript/angular/pull/183/files
feat: in-place component HMR under Vite https://github.com/NativeScript/angular/pull/183/files#top
Show all changes 4 commits https://github.com/NativeScript/angular/pull/183/files
e815cd1 feat: in-place component HMR under Vite edusperoni Nov 18, 2026 https://github.com/NativeScript/angular/pull/183/commits/e815cd1bb7cb2f00f5365f9676700937a2a127a4
6a3e3c7 feat: Vite full reload via import.meta.hot, no dev globals edusperoni Nov 19, 2026 https://github.com/NativeScript/angular/pull/183/commits/6a3e3c7b9d0c11fa1c0b75a67e20f125cd532d18
a1fc68e feat: soft reboot hooks and HMR participants for Vite edusperoni Nov 19, 2026 https://github.com/NativeScript/angular/pull/183/commits/a1fc68eb61a9490fe90923d91ffb2511a8045208
deaf49a fix: restore HMR participants after a failed reboot edusperoni Nov 19, 2026 https://github.com/NativeScript/angular/pull/183/commits/deaf49aa67a702a46e3ad52e13234d456dbb0b5d
Clear filters https://github.com/NativeScript/angular/pull/183/files
Please reload this pagehttps://github.com/NativeScript/angular/pull/183/files
Please reload this pagehttps://github.com/NativeScript/angular/pull/183/files
application.ts https://github.com/NativeScript/angular/pull/183/files#diff-1187759051f6ab61c921236b47108a86ed46fb7b38b8162dadfb9d5d8a00f830
hmr-reboot-state.spec.ts https://github.com/NativeScript/angular/pull/183/files#diff-3c7795a034f71e8c134b00c03b180177aa49e8bb991a3140a9557f8a2d58d065
hmr-reboot-state.ts https://github.com/NativeScript/angular/pull/183/files#diff-b3c68da88607814c3ecb16c87660d57614c7dca4a17e6dffc79d65f843c11b91
hmr-snapshots.spec.ts https://github.com/NativeScript/angular/pull/183/files#diff-7090ada74baa0563ceffb0a769bb5441322d5873cd68b4d727a734a14d550eec
hmr-snapshots.ts https://github.com/NativeScript/angular/pull/183/files#diff-4d70b55191e27fee5166ac769ef935bf43668a23df4c86624bb4db6d68e56d8b
nativescript-renderer.ts https://github.com/NativeScript/angular/pull/183/files#diff-82425df59166a2f7bd99b20a33dfde0dfeda1cb46bbe3f4a1a127dcf8d267c9e
public_api.ts https://github.com/NativeScript/angular/pull/183/files#diff-bb21adb61d1dff7b17135409fce4ad0553c22593968fe49b5d9c92e283c47f95
tokens.ts https://github.com/NativeScript/angular/pull/183/files#diff-375fb93ee131c45035ac82a390d4ae06318be503e05b40081db94d1969b794de
packages/angular/src/lib/application.tshttps://github.com/NativeScript/angular/pull/183/files#diff-1187759051f6ab61c921236b47108a86ed46fb7b38b8162dadfb9d5d8a00f830
View file https://github.com/NativeScript/angular/blob/deaf49aa67a702a46e3ad52e13234d456dbb0b5d/packages/angular/src/lib/application.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/NativeScript/angular/pull/183/{{ revealButtonHref }}
https://github.com/NativeScript/angular/pull/183/files#diff-1187759051f6ab61c921236b47108a86ed46fb7b38b8162dadfb9d5d8a00f830
https://github.com/NativeScript/angular/pull/183/files#diff-1187759051f6ab61c921236b47108a86ed46fb7b38b8162dadfb9d5d8a00f830
https://github.com/NativeScript/angular/pull/183/files#diff-1187759051f6ab61c921236b47108a86ed46fb7b38b8162dadfb9d5d8a00f830
https://github.com/NativeScript/angular/pull/183/files#diff-1187759051f6ab61c921236b47108a86ed46fb7b38b8162dadfb9d5d8a00f830
https://github.com/NativeScript/angular/pull/183/files#diff-1187759051f6ab61c921236b47108a86ed46fb7b38b8162dadfb9d5d8a00f830
https://github.com/NativeScript/angular/pull/183/files#diff-1187759051f6ab61c921236b47108a86ed46fb7b38b8162dadfb9d5d8a00f830
https://github.com/NativeScript/angular/pull/183/files#diff-1187759051f6ab61c921236b47108a86ed46fb7b38b8162dadfb9d5d8a00f830
https://github.com/NativeScript/angular/pull/183/files#diff-1187759051f6ab61c921236b47108a86ed46fb7b38b8162dadfb9d5d8a00f830
https://github.com/NativeScript/angular/pull/183/files#diff-1187759051f6ab61c921236b47108a86ed46fb7b38b8162dadfb9d5d8a00f830
https://github.com/NativeScript/angular/pull/183/files#diff-1187759051f6ab61c921236b47108a86ed46fb7b38b8162dadfb9d5d8a00f830
https://github.com/NativeScript/angular/pull/183/files#diff-1187759051f6ab61c921236b47108a86ed46fb7b38b8162dadfb9d5d8a00f830
https://github.com/NativeScript/angular/pull/183/files#diff-1187759051f6ab61c921236b47108a86ed46fb7b38b8162dadfb9d5d8a00f830
https://github.com/NativeScript/angular/pull/183/files#diff-1187759051f6ab61c921236b47108a86ed46fb7b38b8162dadfb9d5d8a00f830
https://github.com/NativeScript/angular/pull/183/files#diff-1187759051f6ab61c921236b47108a86ed46fb7b38b8162dadfb9d5d8a00f830
Please reload this pagehttps://github.com/NativeScript/angular/pull/183/files
Please reload this pagehttps://github.com/NativeScript/angular/pull/183/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.