-
Notifications
You must be signed in to change notification settings - Fork 1.4k
feat(router): [breaking] change head merge order #7970
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
base: build/v2
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: 7961fe9 The changes in this PR will be included in the next version bump. 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
d99826c
to
4a80aad
Compare
commit: |
built with Refined Cloudflare Pages Action⚡ Cloudflare Pages Deployment
|
reverses head merging for plain objects but retains order for functions
4a80aad
to
7961fe9
Compare
'@qwik.dev/router': major | ||
--- | ||
|
||
Breaking: The order of head export merging has been slightly. Plain objects now override outer ones. Functions still are run inner-first. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe add 💥 in front of the BREAKING
|
||
So first all plain object `head` exports are merged, and then the function `head` exports are called in reverse order. | ||
|
||
Furthermore, if two values in arrays (like `meta` or `links`) have the same `key`, the last one wins. This allows you to override specific meta tags. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is related to objects not functions right?
if so I think it should come before the paragraph about functions, to make sure people won't think it's related to functions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It applies to both. Let me think about how to word it better
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cool thanks
The current way of merging head objects is surprising, like #7868.
This PR changes it to merge objects in the unsurprising order, but keep merging functions in the original order.