Skip to content
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

Modifying SASS files triggers full reload since 2.6.2 #577

Open
Timbuktu1982 opened this issue Apr 20, 2023 · 7 comments
Open

Modifying SASS files triggers full reload since 2.6.2 #577

Timbuktu1982 opened this issue Apr 20, 2023 · 7 comments

Comments

@Timbuktu1982
Copy link

Hi there,

modifying a SASS file causes full page reload instead of CSS livereload in Ember since ember-auto-import 2.6.2. It wasn't the case when I was using 2.6.1 previously.

Thx

@apellerano-pw
Copy link

apellerano-pw commented May 23, 2023

We are noticing this as well, on ember-cli-inject-live-reload@2.1.0 and ember-auto-import@2.6.3 which are the latest as of writing.

Editing an scss file causes both the SassCompiler and ember-auto-import-webpack broccoli task to run. The css hot reloads, but then a moment later the entire ember app unnecessarily reloads.

When I look at the websocket traffic to livereload I see reload commands for chunks generated by ember-auto-import, as well as the reload command for my app.css.

The question then, is why does ember-auto-import-webpack rebuild chunk js and issue livereload commands when only scss files have changed?

@apellerano-pw
Copy link

apellerano-pw commented May 23, 2023

I tried downgrading to ember-auto-import@2.6.1 based on @Timbuktu1982's comment and the issue went away.

On 2.6.1 after editing an scss file I still see both SassCompiler and ember-auto-import-webpack broccoli tasks run, but ember-auto-import-webpack no longer appears in my "Slowest Nodes" list so it must be doing less work.

The websocket traffic now only shows a reload command for app.css. The reload commands for various chunk.js generated by ember-auto-import are now gone.

I think that confirms that this issue was introduced by 2.6.2 and not fixed by 2.6.3.

I looked at the diff between 2.6.2 and 2.6.1, but it was a bit over my head. Does anyone with more familiarity in this codebase have some ideas why that diff causes this regression?

@KoKuToru
Copy link

Since 2.6.2 the code writes new js-files for each build https://github.com/embroider-build/ember-auto-import/blob/v2.6.3/packages/ember-auto-import/ts/webpack.ts#L366

These files don't get cached like in https://github.com/embroider-build/ember-auto-import/blob/v2.6.3/packages/ember-auto-import/ts/inserter.ts#L228

From my testing .. caching these files should solve the reload problem..

@erkie
Copy link

erkie commented Sep 26, 2023

Also ran into this after an upgrade. Downgrading to 2.6.1 seems to have fixed it.

@erkie
Copy link

erkie commented Sep 26, 2023

However, it looks like even if I just make changes to .ts files now, it still sends a reload on the css file. I added some logging:

send reload: [ 'assets/frontend.css', 'assets/frontend.js' ]

This was when I only changed a typescript file. Still better than a page reload on simple CSS changes.

@Timbuktu1982
Copy link
Author

Hello everyone,
Is there any new information on this topic?

@sly7-7
Copy link

sly7-7 commented May 3, 2024

This is still happening with ember-auto-import 2.7.2, though a new app with embroider doesn't have this problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants