Skip to content

ASP.NET Core 3.1 React template live reload is extremely slow #22769

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
empz opened this issue Jun 10, 2020 · 6 comments
Closed

ASP.NET Core 3.1 React template live reload is extremely slow #22769

empz opened this issue Jun 10, 2020 · 6 comments
Labels
affected-few This issue impacts only small number of customers area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates enhancement This issue represents an ask for new feature or an enhancement to an existing one feature-spa ✔️ Resolution: Won't Fix Resolved because we decided not to change the behavior reported in this issue. severity-minor This label is used by an internal tool Status: Resolved
Milestone

Comments

@empz
Copy link

empz commented Jun 10, 2020

A fresh new ASP.NET Core 3.1 React app created with dotnet new react using dotnet SDK 3.1.300 is very slow to live reload.

Start the dotnet application, change something in the client App.js, wait for live reload. It takes almost 10s to perform the reload. This is clearly too much for any decent developer experience.

Windows 10 x64
node v12.14.1
dotnet SDK 3.1.300

Is this expected? Is everybody getting the same slowness or is it something related to my setup?

EDIT
Needless to say that if I just run the react app alone, the live reload takes less than a second.

@javiercn javiercn added area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates feature-spa labels Jun 10, 2020
@mkArtakMSFT mkArtakMSFT added this to the Backlog milestone Jun 10, 2020
@mkArtakMSFT
Copy link
Contributor

We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.

@superdopey
Copy link

I have the same experience, I agree that this is a very bad developer experience.

@empz
Copy link
Author

empz commented Jul 15, 2020

Yes, it's unusable. Moved to Next.js.

@superdopey
Copy link

I have disabled the spa for now
// if (env.IsDevelopment()) // { // spa.UseReactDevelopmentServer(npmScript: "start"); // }

And I run npm start manually, which is far from ideal but works for now. I did hope for a better reaction from aspnetcore team.

@jjleavitt
Copy link

I was able to get hot module refreshes down to 2 seconds by:

  1. overriding the CRA config to use Fast-Refresh via packages and instructions here:
    https://github.com/esetnik/customize-cra-react-refresh
  2. run development directly on kestrel, without IIS Express

@javiercn javiercn added affected-few This issue impacts only small number of customers enhancement This issue represents an ask for new feature or an enhancement to an existing one severity-minor This label is used by an internal tool labels Nov 6, 2020 — with ASP.NET Core Issue Ranking
@javiercn
Copy link
Member

@empz thanks for contacting us.

We've significantly changed the way the SPA templates are setup for development and production to align with how other backend frameworks approach this and as a result we no longer use SpaServices as part of the development workflow.

While we haven't removed or obsoleted the code, we don't plan to make future changes/fixes on it and we recommend people migrate to the new approach we use in the templates.

We recommend switching to the new approach that leverages the SPA proxy in front of the ASP.NET Core and doesn't have these issues.

@javiercn javiercn added the ✔️ Resolution: Won't Fix Resolved because we decided not to change the behavior reported in this issue. label Oct 28, 2021
@ghost ghost added the Status: Resolved label Oct 28, 2021
@ghost ghost locked as resolved and limited conversation to collaborators Nov 27, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affected-few This issue impacts only small number of customers area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates enhancement This issue represents an ask for new feature or an enhancement to an existing one feature-spa ✔️ Resolution: Won't Fix Resolved because we decided not to change the behavior reported in this issue. severity-minor This label is used by an internal tool Status: Resolved
Projects
None yet
Development

No branches or pull requests

5 participants