mirror of
https://github.com/aspnet/JavaScriptServices.git
synced 2026-02-07 08:34:07 +00:00
UseProxyToSpaDevelopmentServer doesn't auto-refresh browser using an Aurelia ClientApp with HMR #22
Closed
opened 2025-08-09 17:14:42 +00:00 by fergalmoran
·
0 comments
No Branch/Tag Specified
master
rybrande/masterToSrc
pakrym/no-console-fb
release/2.2
pakrym/remove-obsole-api-usage
maestro/release/2.2
maestro/master
release/2.1
release/2.0
rybrande/MergeRelease21IntoDev
rel/2.0.0-extensions
angular-animations-example
fix-angular-material-publishing
rel/2.0.0-templates
httpwithstatetransfer-example
rel/2.0.0-preview2-templates
aspnet-webpack-react-2.x
angular4-prerender-data-example
version-1.x
angular2-lazy-loading-example
581-isomorphic-react-cookies-example
example-using-typescript-paths-for-494
v1.0.x
angular2-materialize-example
redux-typed-1-x
primeng-example
font-awesome-example
karma-testing-example
2.2.0
2.2.0-preview3
2.2.0-preview2
2.2.0-preview1
2.1.1
2.1.0
2.0.4
2.1.0-rc1-final
2.1.0-preview2-final
2.0.3
2.1.0-preview1-final
2.0.2
2.0.1
rel/2.0.0
rel/2.0.0-preview2
Labels
Clear labels
2 - Working
2 - Working
3 - Done
3 - Done
3 - Done
3 - Done
3 - Done
3 - Done
3 - Done
angular
angular
angular
angular
angular
bug
bug
bug
bug
bug
bug
bug
bug
bug
core
core
core
core
core
core
core
duplicate
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
external
external
P1
P1
P1
P1
P1
P1
P2
P2
P2
P2
P2
P2
P2
P2
P2
PRI: 1 - Required
react
react
task
task
up-for-grabs
up-for-grabs
up-for-grabs
waiting
waiting
waiting
waiting
No Label
Milestone
No items
No Milestone
Projects
Clear projects
No project
Assignees
fergalmoran
Clear assignees
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: github/JavaScriptServices#22
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @chrisckc on 8/21/2018
I created a project using the latest dotnet new angular template and replaced the ClientApp folder with an Aurelia app created using the Aurelia CLI.
The command
au newwas ran inside the project folder to create a new ClientApp folder, the following options were used:
Name: ClientApp
Platform: Web
Bundler: Webpack
Startup.cs was modified to use spa.UseProxyToSpaDevelopmentServer:
//spa.UseAngularCliServer(npmScript: "start");spa.UseProxyToSpaDevelopmentServer(baseUri: "http://localhost:8080");When i run both
au run --watchand
dotnet runit works fine, i can edit a file in the Aurelia app and the browser refreshes automatically using a full page refresh.
However if i run
au run --watch --hmrinstead, the auto refresh no longer works, but still works if i visit the Aurelia app directly via http://localhost:8080 (still refreshes the whole page as there is only 1 module in the au new template) it just no longer works from the dotnet host on http://localhost:5000 or https://localhost:5001
I then checked to see if "Hot Module Replacement" worked in the Angular app which was created by the template by enabling it using the following guide:
https://github.com/angular/angular-cli/wiki/1-x-stories-configure-hmr
and edited startup.cs to use the angular url:
spa.UseProxyToSpaDevelopmentServer(baseUri: "http://localhost:4200");It works fine, i can edit a file in the angular project and see that the page updates without a full page refresh.
I have not read enough about HMR to understand how it does what it does, but as both ClientApps are using Webpack hmr, i would have expected it to also work in Aurelia through the spa proxy.