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

fix(remix-dev/vite): invalidate route manifest on route export change #8157

Conversation

hi-ogawa
Copy link
Contributor

@hi-ogawa hi-ogawa commented Nov 28, 2023

Closes: #8114

I went with a very direct approach just to fix this exact issue and the change itself is relatively small, but it might make sense to move this part of code into own filesystem watcher, which I'm experimenting in #8164.

Testing Strategy

I added integration/vite-manifest-invalidation-test.ts to test the similar scenario from the reproduction.

Copy link

changeset-bot bot commented Nov 28, 2023

🦋 Changeset detected

Latest commit: dff9f79

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 16 packages
Name Type
@remix-run/dev Patch
create-remix Patch
remix Patch
@remix-run/architect Patch
@remix-run/cloudflare Patch
@remix-run/cloudflare-pages Patch
@remix-run/cloudflare-workers Patch
@remix-run/css-bundle Patch
@remix-run/deno Patch
@remix-run/eslint-config Patch
@remix-run/express Patch
@remix-run/node Patch
@remix-run/react Patch
@remix-run/serve Patch
@remix-run/server-runtime Patch
@remix-run/testing Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@hi-ogawa hi-ogawa force-pushed the fix-vite-invalidate-vmod-on-hot-exports-change branch 2 times, most recently from 82cef66 to 500b839 Compare November 28, 2023 10:08
@hi-ogawa hi-ogawa changed the title fix(remix-dev/vite): invalidate route manifest on route exports hot u… fix(remix-dev/vite): invalidate route manifest on route exports hot update Nov 28, 2023
@hi-ogawa hi-ogawa marked this pull request as ready for review November 28, 2023 12:20
@hi-ogawa hi-ogawa changed the title fix(remix-dev/vite): invalidate route manifest on route exports hot update fix(remix-dev/vite): invalidate route manifest on route export change Nov 28, 2023
@hi-ogawa hi-ogawa marked this pull request as draft November 28, 2023 13:52
Comment on lines 76 to 80
if (browserName === "webkit") {
// force new page instance for webkit.
// otherwise browser doesn't seem to fetch new manifest probably due to caching.
page = await context.newPage();
}
Copy link
Contributor Author

@hi-ogawa hi-ogawa Dec 1, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found a very odd quirk on webkit after the huge amount of debugging (on CI).
It seems webkit is using caching for some assets between multiple page.goto, reload, etc... calls.
In this test, I'm almost certain that /@id/__x00__virtual:browser-manifest (aka. browserManifestId) was cached and webkit doesn't fetch new manifest when page.goto after server invalidated the module.

I hope this behavior is only playwright integration specific quirk and it doesn't happen on local usage of mac/safari.
I would appreciate if someone can verify this locally.

@hi-ogawa hi-ogawa marked this pull request as ready for review December 1, 2023 01:25
Copy link
Member

@markdalgleish markdalgleish left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR! Sorry for the delay on this. I'll follow up on your other PR tomorrow, but for now I'm keen to get this fix in as-is.

I've added clientLoader and clientAction to the list of checked route exports since they've recently been introduced, and I've made a few minor refactors, but otherwise this looks great!

@markdalgleish markdalgleish merged commit 2ef85a1 into remix-run:dev Jan 4, 2024
9 checks passed
@hi-ogawa
Copy link
Contributor Author

hi-ogawa commented Jan 4, 2024

Thanks for follow up! No worries a all. Please feel free to ping me if you want me to fix merge conflict or deal with something in the PR.

@hi-ogawa hi-ogawa deleted the fix-vite-invalidate-vmod-on-hot-exports-change branch January 4, 2024 10:55
Copy link
Contributor

github-actions bot commented Jan 9, 2024

🤖 Hello there,

We just published version 2.5.0-pre.0 which includes this pull request. If you'd like to take it for a test run please try it out and let us know what you think!

Thanks!

Copy link
Contributor

🤖 Hello there,

We just published version 2.5.0 which includes this pull request. If you'd like to take it for a test run please try it out and let us know what you think!

Thanks!

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

Successfully merging this pull request may close these issues.

3 participants