-
Notifications
You must be signed in to change notification settings - Fork 5
fix!: add <HeadProvider />
#43
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
Open
SukkaW
wants to merge
2
commits into
ascorbic:main
Choose a base branch
from
SukkaW:fix-head
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
✅ Deploy Preview for impala-preact-js ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for impala-react-js ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for impala-react-ts ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for impala-preact-ts ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
92ca50f to
8dbdb0a
Compare
<HeadProvider /><HeadProvider />
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
@ascorbic Here is another bugfix~
I have some routes under the
src/routesfolder, and I noticed that there are duplicated<meta />tags within the generated<head />from the SSR-ed HTML.It turns out that although there are many routes, they all share only one singleton head manager class instance (there is only one
new HeadContext()). So any heads added in the route A will also be there for route B.The proper way to do this would be to have one head manager instance for each route, not sharing one head manager across all routes.
The PR changes a few things:
class HeadProvidertoclass HeadManagerentry-server, wraps<Page />with a<HeadContext.Provider /><head />Breaking Changes
Currently, all routes share one head manager instance, so every HTML generated will contain all routes' heads altogether.
Though this behavior might be buggy, some existing apps might be relying on this behavior.
After the PR, every route will have its own head manager instance, its HTML will only contain its own head, which will break above mentioned apps (if any).