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

Ensure "Developer: Reload Window" actually picks up new css file contents #237603

Closed
wants to merge 1 commit into from

Conversation

tmm1
Copy link
Contributor

@tmm1 tmm1 commented Jan 9, 2025

I made an edit to a css file, and then used Reload Window from the command palette. The css change was not present, and when I looked at the Sources list in the developer tools, the old file contents were still present.

Adding a random query param to force disk loads fixed the issue, so I created this PR with that change.

(Is there a better dev workflow for testing css changes? The setupCSSImportMaps step seems quite slow)

@tmm1
Copy link
Contributor Author

tmm1 commented Jan 9, 2025

Is there a better dev workflow for testing css changes?

An approach used by others is to watch the css files for changes and update the nocache parameters: https://github.com/dperrymorrow/electron-css-reload?tab=readme-ov-file#how-does-it-work

@deepak1556
Copy link
Collaborator

Hi, thanks for the PR. Yeah this is a known issue and is not restricted to css files, we have tracked the root cause in #234357. The tl:dr; is that cache validation headers are not respected for custom protocols in the runtime today. I am not aware of better workarounds than disabling the in-memory cache.

If we want to land a workaround till the runtime issue is fixed then I suggest we add the no-cache header to the protocol layer (/protocolMainService.ts) when running out of sources.

@tmm1
Copy link
Contributor Author

tmm1 commented Jan 10, 2025

Interesting, thank you for the additional context!

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

Successfully merging this pull request may close these issues.

3 participants