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

Dedupe only items with unique key #5800

Merged
merged 1 commit into from
Dec 3, 2018

Conversation

timneutkens
Copy link
Member

@timneutkens timneutkens commented Dec 3, 2018

Fixes #3705
Fixes #4656

  • No longer automatically dedupe certain tags. Only the ones we know are never going to be duplicate like charSet, title etc.
  • Fix key="" behavior, making sure that if a unique key is provided tags are deduped based on that.

For example:

<meta property='fb:pages' content='one'>
<meta property='fb:pages' content='two'>

Would currently cause

<meta property='fb:pages' content='two'>

After this change:

<meta property='fb:pages' content='one'>
<meta property='fb:pages' content='two'>

Then if you use next/head multiple times / want to be able to override:

<meta property='fb:pages' content='one' key="not-unique-key">
<meta property='fb:pages' content='two' key="not-unique-key">

Would cause:

<meta property='fb:pages' content='two'>

As key gets deduped correctly after this PR, similar to how React itself works.

@timneutkens timneutkens merged commit 9890e06 into vercel:canary Dec 3, 2018
@timneutkens timneutkens deleted the fix/unique-key-next-head branch December 3, 2018 16:52
JeromeFitz added a commit to JeromeFitz/next-seo that referenced this pull request Jan 6, 2019
`next@7.0.2-canary.35` was the implementation
- Dedupe only items with unique key: [5800](vercel/next.js#5800)

In upgrading all the packges in this PR, some
 versions were not working (not sure why).

I've tested with the latest `canary` from `next`
 and everything is passing.
@lock lock bot locked as resolved and limited conversation to collaborators Dec 3, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
2 participants