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 glob importer cache in development #1578

Merged
merged 3 commits into from
Jun 15, 2022

Conversation

frandiox
Copy link
Contributor

@frandiox frandiox commented Jun 15, 2022

Description

Closes #1545

We were invalidating the client components cache after 100ms (throttling it), but Vite refreshes the browser faster than that. As a result, we were getting the old list of client components instead of the new one. Removing the 100ms timeout fixes the issue (and it wasn't needed anymore).

@benjaminsehl @juanpprieto @lordofthecactus Can you play with this and see if you can find other situations where it breaks? I tested the situation where you import a new client component for the first time in a any server component, and it seems to be fixed now.

-- Edit: this PR is also adding the same changes that Shopify/hydrogen#1577 is adding because the code comes from the PR we have in React repo. #1577 should be merged before this one.
The real change to review in this PR is basically here: facebook/react@c8a747d


Before submitting the PR, please make sure you do the following:

  • Read the Contributing Guidelines
  • Provide a description in this PR that addresses what the PR is solving, or reference the issue that it solves (e.g. fixes #123)
  • Update docs in this repository according to your change
  • Run yarn changeset add if this PR cause a version bump based on Keep a Changelog and adheres to Semantic Versioning

@frandiox frandiox requested a review from a team June 15, 2022 07:25
Copy link
Contributor

@blittle blittle left a comment

Choose a reason for hiding this comment

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

I've tried to test this in a variety of ways. It looks great! Thank you @frandiox!

@blittle blittle merged commit f529039 into v1.x-2022-07 Jun 15, 2022
@blittle blittle deleted the fd-fix-client-importer-cache branch June 15, 2022 14:54
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.

[BUG] Could not find client component Link
3 participants