No description
Find a file
Gerald Monaco 039eb817e1
Remove next-head-count (#16758)
Removes `next-head-count`, improving support for 3rd party libraries that insert or append new elements to `<head>`.

---

This is more or less what a solution with a `data-` attribute would look like, except that instead of directly searching for elements with that attribute, we serialize the elements expected in `<head>` and then find them/assume ownership of them during initialization (in a manner similar to React's reconciliation) based on their properties.

There are two main assumptions here:
1. Content is served with compression, so duplicate serialization of e.g. inline script or style tags doesn't have a meaningful impact. Storing a hash would be a potential optimization.
2. 3rd party libraries primarily only insert new, unique elements to head. Libraries trying to actively manage elements that overlap with those that Next.js claims ownership of will still be unsupported.

The reason for this roundabout approach is that I'd really like to avoid `data-` if possible, for maximum compatibility. Implicitly adding an attribute could be a breaking change for some class of tools or crawlers and makes it otherwise impossible to insert raw HTML into `<head>`. Adding an unexpected attribute is why the original `class="next-head"` approach was problematic in the first place!

That said, while I don't expect this to be more problematic than `next-head-count` (anything that would break in this new model also should have broken in the old model), if that does end up being the case, it might make sense to just bite the bullet.

Fixes #11012
Closes #16707

---

cc @Timer @timneutkens
2020-09-09 01:41:04 +00:00
.github Auto enable React's new JSX transform on 17.x (#16603) 2020-09-01 11:29:25 -04:00
.vscode skip node internals (#13345) 2020-05-25 16:21:06 +02:00
bench Upgrade to Prettier 2 (#13061) 2020-05-18 15:24:37 -04:00
docs Fix align documentation with the code (#16843) 2020-09-08 12:29:42 -04:00
errors Remove next-head-count (#16758) 2020-09-09 01:41:04 +00:00
examples Fix typo in Pet mongoose model (#16943) 2020-09-08 17:00:25 +00:00
packages Remove next-head-count (#16758) 2020-09-09 01:41:04 +00:00
test Remove next-head-count (#16758) 2020-09-09 01:41:04 +00:00
.eslintignore Move next-codemod to Next.js monorepo (#15536) 2020-08-10 11:14:53 +02:00
.eslintrc.json Remove unused variable (#13716) 2020-06-03 11:58:58 -04:00
.gitignore ci: add pnp test (#16255) 2020-08-17 13:39:57 -04:00
.npmrc Remove version prefix 2018-10-02 01:35:56 +02:00
.prettierignore Move next-codemod to Next.js monorepo (#15536) 2020-08-10 11:14:53 +02:00
.prettierignore_staged Move next-codemod to Next.js monorepo (#15536) 2020-08-10 11:14:53 +02:00
.prettierrc.json Prettier trailingComma default value to es5 since 2.0 (#14391) 2020-06-22 13:25:24 +02:00
azure-pipelines.yml Update to track test timings separate for Azure and Actions (#12083) 2020-04-21 16:11:04 -04:00
check-examples.sh Ensure all examples are MIT licensed (#16691) 2020-08-29 22:32:35 -04:00
check-pre-compiled.sh Pre-ncc compiled packages to prevent re-nccing unnecessarily (#11569) 2020-04-07 09:42:16 -04:00
CODE_OF_CONDUCT.md Update Code of Conduct email address (#12108) 2020-04-22 16:27:24 +02:00
contributing.md Simplify example usage instructions (#16678) 2020-08-29 22:22:02 -04:00
jest.config.js Use the jest-circus test runner (#12974) 2020-05-16 16:56:06 -04:00
lerna.json v9.5.4-canary.6 2020-09-08 11:07:29 +02:00
license.md Update year on license files 2020-04-21 12:24:08 +02:00
lint-staged.config.js Update browserslist/caniuse-lite (#13605) 2020-05-31 19:37:01 +00:00
package.json Auto enable React's new JSX transform on 17.x (#16603) 2020-09-01 11:29:25 -04:00
publish-release.sh Make sure to exit publish script with correct code (#10310) 2020-01-28 14:03:32 -05:00
readme.md Monorepo (#5341) 2018-10-01 01:02:10 +02:00
release.js Remove common PR title prefixes 2020-08-07 09:34:50 +02:00
run-tests.js Stabilize more tests (#15470) 2020-07-26 04:57:06 +00:00
SECURITY.md Create SECURITY.md 2020-07-13 19:25:08 +02:00
test-file.txt Add additional file serving tests (#12479) 2020-05-04 11:58:19 -05:00
UPGRADING.md Move upgrading guide to /docs (#10727) 2020-02-28 23:46:18 +01:00
yarn.lock Only update lookups for dev overlay if mounted (#16776) 2020-09-02 09:25:19 +00:00

Next.js

Getting Started

Visit https://nextjs.org/learn to get started with Next.js.

Documentation

Visit https://nextjs.org/docs to view the full documentation.

Who is using Next.js?

Next.js is used by the world's leading companies. Check out the Next.js Showcase to learn more.

Contributing

Please see our contributing.md.

Authors