* hoist `react-dom/server` imports to reduce module load time in nodejs
* simplify `reactRoot` detection condition by checking the streaming rendering API we're using. (if it doesn't existed, like react 17, then we won't enable `reactRoot`)
* Merge `__NEXT_CONCURRENT_FEATURES` into `__NEXT_REACT_ROOT` env var since they're identical now
x-ref: #34021 , #34004
Only log each warning once and only trigger in concurrent mode
## Bug
- [x] Related issues linked using `fixes #number`
- [x] Integration tests added
- [x] Errors have helpful link attached, see `contributing.md`
In #33968, a warning was added for script tags inserted through the
next/head component. This change unintentionally included
application/ld+json scripts, which shouldn't be triggering the
warnings (as they were originally intended to catch scripts where
loading order or timing could be important). This change adds an
exception for application/ld+json scripts, so they do not log the
warning if they are included through next/head.
This commit adds a development mode warning in the console
if you try to include <link rel="stylesheet"> tags in
next/head, e.g.
```
<Head>
<link ref="stylesheet" href="..." />
</Head>
```
The warning message explains that this pattern will not
work well with Suspense/streaming and recommends using a
custom Document component instead.
## Feature
- [x] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [x] Integration tests added
- [x] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [x] Errors have helpful link attached, see `contributing.md`
Co-authored-by: JJ Kasper <22380829+ijjk@users.noreply.github.com>
This commit adds a development mode warning in the console
if you try to include <script> tags in next/head, e.g.
```
<Head>
<script async src="..." />
</Head>
```
The warning message explains that this pattern will not
work well with Suspense/streaming and recommends using the
next/script component instead.
TODO in follow-up PR: add same warning for stylesheets, etc
## Feature
- [x] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [x] Integration tests added
- [x] Documentation added
- [x] Errors have helpful link attached, see `contributing.md`