{"id":26944950,"url":"https://github.com/angularsen/dotnet9-watch-slow-repro","last_synced_at":"2025-04-02T18:19:40.520Z","repository":{"id":284323128,"uuid":"954555624","full_name":"angularsen/dotnet9-watch-slow-repro","owner":"angularsen","description":"Repro for https://github.com/dotnet/sdk/issues/47179","archived":false,"fork":false,"pushed_at":"2025-03-25T09:29:20.000Z","size":887,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-25T10:26:56.187Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"CSS","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/angularsen.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-03-25T09:06:25.000Z","updated_at":"2025-03-25T09:29:23.000Z","dependencies_parsed_at":"2025-03-25T10:37:00.386Z","dependency_job_id":null,"html_url":"https://github.com/angularsen/dotnet9-watch-slow-repro","commit_stats":null,"previous_names":["angularsen/dotnet9-watch-slow-repro"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/angularsen%2Fdotnet9-watch-slow-repro","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/angularsen%2Fdotnet9-watch-slow-repro/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/angularsen%2Fdotnet9-watch-slow-repro/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/angularsen%2Fdotnet9-watch-slow-repro/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/angularsen","download_url":"https://codeload.github.com/angularsen/dotnet9-watch-slow-repro/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246866066,"owners_count":20846496,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-04-02T18:19:39.886Z","updated_at":"2025-04-02T18:19:40.510Z","avatar_url":"https://github.com/angularsen.png","language":"CSS","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Repro for slow dotnet watch with Blazor on .NET9\nRelated:\n- [hot reload takes too much time · Issue \\#47179 · dotnet/sdk](https://github.com/dotnet/sdk/issues/47179)\n- [dotnet 9, \"dotnet watch\" is really bad in Blazor Server · Issue \\#45810 · dotnet/sdk](https://github.com/dotnet/sdk/issues/45810)\n\n## Problem\n1. `dotnet watch` is slower on net9 than net8, in particular the _first_ change can take 10-20 seconds vs a few seconds for a trivial change to `.razor` files in our large Blazor Server app. (1)\n2. Blazor seems to do a page reload after hot reload in our app, but have not yet been able to create a repro of this behavior in these sample apps. See details below.\n\n(1)\nIn 9.0.2 SDK release, the hot reload was 10-20x slower for every change, but in 9.0.3 SDK release only the first hot reload is 10-20x slow and subsequent changes are fast.\u003cbr\u003e\n`9.0.104`, `9.0.202` and `9.0.300-preview.0.25174.3` all exhibit the slow first hot reload, and in our app, also a special page reload.\u003cbr\u003e\nIn our app, these versions also do a special page reload upon hot reload. Details below.\n\n## To run this sample\nRun both projects in two separate shells:\n```sh\ndotnet watch --verbose --project Blazor8\n```\n\n```sh\ndotnet watch --verbose --project Blazor9\n```\n\n- Wait for browser to launch for each project.\n- Edit `Components/Pages/Home.razor` in either project, and change the title text or something trivial.\n\n## Observations in template apps\n- Simulating a slow `OnInitializedAsync` with Task.Delay, delays the hot reload on both (probably by design)\n\n## Observations in our large Blazor Server app\n- On net9, hot reload incurs what seems like a special page reload. The circuit stays connected and no new HTTP GET request to Blazor, but the page is pre-rendered again, and all scoped services are recreated and re-initialized.\n- This page load is slow in our app and delays hot reload, and this did not happen in net8 SDK.\n\n![image](https://github.com/user-attachments/assets/5e88dc7e-bc29-441c-bffe-eb4dcc8cbb36)\n\n![image](https://github.com/user-attachments/assets/088547ae-ae77-4e85-a92d-4411c6136305)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fangularsen%2Fdotnet9-watch-slow-repro","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fangularsen%2Fdotnet9-watch-slow-repro","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fangularsen%2Fdotnet9-watch-slow-repro/lists"}