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 next.js cache #43

Merged
merged 2 commits into from
Apr 10, 2024
Merged

fix next.js cache #43

merged 2 commits into from
Apr 10, 2024

Conversation

Zn4rK
Copy link
Contributor

@Zn4rK Zn4rK commented Apr 10, 2024

Next.js can create up to at least three webpack compilations. The way we create the singleton for the renderer, there's no way for us to know when we should write to cache. We kind of run in to a race condition.

The solution for now is to put the caching logic for next.js in the that plugin.

I did experiment a bit with making the engine async to support a more direct cache approach, and it would be feasible. Some integrations do require sync operations (mainly jest...), so we would need to build a more abstracted caching layer, that can support either async or sync operations.

Unfortunately, that's not something I have the time for atm, so we'll probably have to revisit that again sometime in the future.

Copy link

changeset-bot bot commented Apr 10, 2024

🦋 Changeset detected

Latest commit: acf3b2f

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

This PR includes changesets to release 2 packages
Name Type
@navita/webpack-plugin Minor
@navita/next-plugin Minor

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

@Zn4rK Zn4rK merged commit 7c50e30 into main Apr 10, 2024
2 checks passed
@Zn4rK Zn4rK deleted the nextjs-cache branch October 1, 2024 22:07
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.

1 participant