Unverified Commit 2c047359 authored by Sebastian "Sebbie" Silbermann's avatar Sebastian "Sebbie" Silbermann Committed by GitHub

[fragment-scroll] Remove `config.experimental.appNewScrollHandler` (#95602)

parent 79168556
...@@ -394,7 +394,6 @@ jobs: ...@@ -394,7 +394,6 @@ jobs:
export NEXT_TEST_MODE=dev export NEXT_TEST_MODE=dev
export NEXT_TEST_REACT_VERSION="${{ matrix.react }}" export NEXT_TEST_REACT_VERSION="${{ matrix.react }}"
export __NEXT_EXPERIMENTAL_STRICT_ROUTE_TYPES=true export __NEXT_EXPERIMENTAL_STRICT_ROUTE_TYPES=true
export __NEXT_EXPERIMENTAL_APP_NEW_SCROLL_HANDLER=false
export RUST_BACKTRACE=1 export RUST_BACKTRACE=1
node run-tests.js \ node run-tests.js \
...@@ -437,7 +436,6 @@ jobs: ...@@ -437,7 +436,6 @@ jobs:
export NEXT_TEST_MODE=start export NEXT_TEST_MODE=start
export NEXT_TEST_REACT_VERSION="${{ matrix.react }}" export NEXT_TEST_REACT_VERSION="${{ matrix.react }}"
export __NEXT_EXPERIMENTAL_STRICT_ROUTE_TYPES=true export __NEXT_EXPERIMENTAL_STRICT_ROUTE_TYPES=true
export __NEXT_EXPERIMENTAL_APP_NEW_SCROLL_HANDLER=false
export RUST_BACKTRACE=1 export RUST_BACKTRACE=1
node run-tests.js --timings --require-timings -g ${{ matrix.group }} --type production node run-tests.js --timings --require-timings -g ${{ matrix.group }} --type production
...@@ -474,7 +472,6 @@ jobs: ...@@ -474,7 +472,6 @@ jobs:
export NEXT_TEST_MODE=dev export NEXT_TEST_MODE=dev
export NEXT_TEST_REACT_VERSION="${{ matrix.react }}" export NEXT_TEST_REACT_VERSION="${{ matrix.react }}"
export __NEXT_EXPERIMENTAL_STRICT_ROUTE_TYPES=true export __NEXT_EXPERIMENTAL_STRICT_ROUTE_TYPES=true
export __NEXT_EXPERIMENTAL_APP_NEW_SCROLL_HANDLER=false
# rspack flags # rspack flags
export NEXT_RSPACK=1 export NEXT_RSPACK=1
...@@ -521,7 +518,6 @@ jobs: ...@@ -521,7 +518,6 @@ jobs:
export NEXT_TEST_MODE=start export NEXT_TEST_MODE=start
export NEXT_TEST_REACT_VERSION="${{ matrix.react }}" export NEXT_TEST_REACT_VERSION="${{ matrix.react }}"
export __NEXT_EXPERIMENTAL_STRICT_ROUTE_TYPES=true export __NEXT_EXPERIMENTAL_STRICT_ROUTE_TYPES=true
export __NEXT_EXPERIMENTAL_APP_NEW_SCROLL_HANDLER=false
# rspack flags # rspack flags
export NEXT_RSPACK=1 export NEXT_RSPACK=1
...@@ -684,7 +680,6 @@ jobs: ...@@ -684,7 +680,6 @@ jobs:
with: with:
afterBuild: | afterBuild: |
export __NEXT_EXPERIMENTAL_STRICT_ROUTE_TYPES=true export __NEXT_EXPERIMENTAL_STRICT_ROUTE_TYPES=true
export __NEXT_EXPERIMENTAL_APP_NEW_SCROLL_HANDLER=false
node scripts/test-new-tests.mjs \ node scripts/test-new-tests.mjs \
--flake-detection \ --flake-detection \
--mode dev \ --mode dev \
...@@ -711,7 +706,6 @@ jobs: ...@@ -711,7 +706,6 @@ jobs:
with: with:
afterBuild: | afterBuild: |
export __NEXT_EXPERIMENTAL_STRICT_ROUTE_TYPES=true export __NEXT_EXPERIMENTAL_STRICT_ROUTE_TYPES=true
export __NEXT_EXPERIMENTAL_APP_NEW_SCROLL_HANDLER=false
node scripts/test-new-tests.mjs \ node scripts/test-new-tests.mjs \
--flake-detection \ --flake-detection \
--mode start \ --mode start \
...@@ -781,7 +775,6 @@ jobs: ...@@ -781,7 +775,6 @@ jobs:
export NEXT_ENABLE_ADAPTER=1 export NEXT_ENABLE_ADAPTER=1
export NEXT_E2E_TEST_TIMEOUT=240000 export NEXT_E2E_TEST_TIMEOUT=240000
export __NEXT_EXPERIMENTAL_STRICT_ROUTE_TYPES=true export __NEXT_EXPERIMENTAL_STRICT_ROUTE_TYPES=true
export __NEXT_EXPERIMENTAL_APP_NEW_SCROLL_HANDLER=false
export IS_TURBOPACK_TEST=1 export IS_TURBOPACK_TEST=1
node scripts/test-new-tests.mjs \ node scripts/test-new-tests.mjs \
--mode deploy \ --mode deploy \
...@@ -848,7 +841,6 @@ jobs: ...@@ -848,7 +841,6 @@ jobs:
export NEXT_TEST_MODE=dev export NEXT_TEST_MODE=dev
export NEXT_TEST_REACT_VERSION="${{ matrix.react }}" export NEXT_TEST_REACT_VERSION="${{ matrix.react }}"
export __NEXT_EXPERIMENTAL_STRICT_ROUTE_TYPES=true export __NEXT_EXPERIMENTAL_STRICT_ROUTE_TYPES=true
export __NEXT_EXPERIMENTAL_APP_NEW_SCROLL_HANDLER=false
node run-tests.js \ node run-tests.js \
--timings \ --timings \
...@@ -870,7 +862,6 @@ jobs: ...@@ -870,7 +862,6 @@ jobs:
afterBuild: | afterBuild: |
export NEXT_TEST_MODE=dev export NEXT_TEST_MODE=dev
export __NEXT_EXPERIMENTAL_STRICT_ROUTE_TYPES=true export __NEXT_EXPERIMENTAL_STRICT_ROUTE_TYPES=true
export __NEXT_EXPERIMENTAL_APP_NEW_SCROLL_HANDLER=false
export IS_TURBOPACK_TEST=1 export IS_TURBOPACK_TEST=1
export TURBOPACK_DEV=1 export TURBOPACK_DEV=1
...@@ -894,7 +885,6 @@ jobs: ...@@ -894,7 +885,6 @@ jobs:
afterBuild: | afterBuild: |
export NEXT_TEST_MODE=start export NEXT_TEST_MODE=start
export __NEXT_EXPERIMENTAL_STRICT_ROUTE_TYPES=true export __NEXT_EXPERIMENTAL_STRICT_ROUTE_TYPES=true
export __NEXT_EXPERIMENTAL_APP_NEW_SCROLL_HANDLER=false
export IS_TURBOPACK_TEST=1 export IS_TURBOPACK_TEST=1
export TURBOPACK_BUILD=1 export TURBOPACK_BUILD=1
...@@ -919,7 +909,6 @@ jobs: ...@@ -919,7 +909,6 @@ jobs:
afterBuild: | afterBuild: |
export NEXT_TEST_MODE=start export NEXT_TEST_MODE=start
export __NEXT_EXPERIMENTAL_STRICT_ROUTE_TYPES=true export __NEXT_EXPERIMENTAL_STRICT_ROUTE_TYPES=true
export __NEXT_EXPERIMENTAL_APP_NEW_SCROLL_HANDLER=false
export IS_TURBOPACK_TEST=1 export IS_TURBOPACK_TEST=1
export TURBOPACK_BUILD=1 export TURBOPACK_BUILD=1
...@@ -961,7 +950,6 @@ jobs: ...@@ -961,7 +950,6 @@ jobs:
export NEXT_TEST_MODE=start export NEXT_TEST_MODE=start
export NEXT_TEST_REACT_VERSION="${{ matrix.react }}" export NEXT_TEST_REACT_VERSION="${{ matrix.react }}"
export __NEXT_EXPERIMENTAL_STRICT_ROUTE_TYPES=true export __NEXT_EXPERIMENTAL_STRICT_ROUTE_TYPES=true
export __NEXT_EXPERIMENTAL_APP_NEW_SCROLL_HANDLER=false
node run-tests.js --timings --require-timings -g ${{ matrix.group }} --type production node run-tests.js --timings --require-timings -g ${{ matrix.group }} --type production
testTimingsArtifact: 'test-timings' testTimingsArtifact: 'test-timings'
...@@ -981,7 +969,6 @@ jobs: ...@@ -981,7 +969,6 @@ jobs:
# these all run without concurrency because they're heavier # these all run without concurrency because they're heavier
export TEST_CONCURRENCY=1 export TEST_CONCURRENCY=1
export IS_TURBOPACK_TEST=1 export IS_TURBOPACK_TEST=1
export __NEXT_EXPERIMENTAL_APP_NEW_SCROLL_HANDLER=false
TURBOPACK_BUILD=1 NEXT_TEST_MODE=start BROWSER_NAME=firefox node run-tests.js \ TURBOPACK_BUILD=1 NEXT_TEST_MODE=start BROWSER_NAME=firefox node run-tests.js \
test/production/pages-dir/production/test/index.test.ts \ test/production/pages-dir/production/test/index.test.ts \
test/production/chunk-load-failure/chunk-load-failure.test.ts test/production/chunk-load-failure/chunk-load-failure.test.ts
......
...@@ -1333,7 +1333,6 @@ pub struct ExperimentalConfig { ...@@ -1333,7 +1333,6 @@ pub struct ExperimentalConfig {
adjust_font_fallbacks_with_size_adjust: Option<bool>, adjust_font_fallbacks_with_size_adjust: Option<bool>,
after: Option<bool>, after: Option<bool>,
app_document_preloading: Option<bool>, app_document_preloading: Option<bool>,
app_new_scroll_handler: Option<bool>,
case_sensitive_routes: Option<bool>, case_sensitive_routes: Option<bool>,
cpus: Option<f64>, cpus: Option<f64>,
cra_compat: Option<bool>, cra_compat: Option<bool>,
......
...@@ -171,9 +171,6 @@ export function getDefineEnv({ ...@@ -171,9 +171,6 @@ export function getDefineEnv({
'process.env.__NEXT_APP_NAV_FAIL_HANDLING': Boolean( 'process.env.__NEXT_APP_NAV_FAIL_HANDLING': Boolean(
config.experimental.appNavFailHandling config.experimental.appNavFailHandling
), ),
'process.env.__NEXT_APP_NEW_SCROLL_HANDLER': Boolean(
config.experimental.appNewScrollHandler
),
'process.env.__NEXT_TURBOPACK_SHARED_RUNTIME': Boolean( 'process.env.__NEXT_TURBOPACK_SHARED_RUNTIME': Boolean(
config.experimental.turbopackSharedRuntime config.experimental.turbopackSharedRuntime
), ),
......
...@@ -22,7 +22,6 @@ import React, { ...@@ -22,7 +22,6 @@ import React, {
type JSX, type JSX,
type ActivityProps, type ActivityProps,
} from 'react' } from 'react'
import ReactDOM from 'react-dom'
import { import {
LayoutRouterContext, LayoutRouterContext,
GlobalLayoutRouterContext, GlobalLayoutRouterContext,
...@@ -51,56 +50,6 @@ import { getParamValueFromCacheKey } from '../route-params' ...@@ -51,56 +50,6 @@ import { getParamValueFromCacheKey } from '../route-params'
import type { Params } from '../../server/request/params' import type { Params } from '../../server/request/params'
import { isDeferredRsc } from './router-reducer/ppr-navigations' import { isDeferredRsc } from './router-reducer/ppr-navigations'
const enableNewScrollHandler = process.env.__NEXT_APP_NEW_SCROLL_HANDLER
const __DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = (
ReactDOM as any
).__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE
// TODO-APP: Replace with new React API for finding dom nodes without a `ref` when available
/**
* Wraps ReactDOM.findDOMNode with additional logic to hide React Strict Mode warning
*/
function findDOMNode(
instance: React.ReactInstance | null | undefined
): Element | Text | null {
// Tree-shake for server bundle
if (typeof window === 'undefined') return null
// __DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE.findDOMNode is null during module init.
// We need to lazily reference it.
const internal_reactDOMfindDOMNode =
__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE.findDOMNode
return internal_reactDOMfindDOMNode(instance)
}
const rectProperties = [
'bottom',
'height',
'left',
'right',
'top',
'width',
'x',
'y',
] as const
/**
* Check if a HTMLElement is hidden or fixed/sticky position
*/
function shouldSkipElement(element: HTMLElement) {
// we ignore fixed or sticky positioned elements since they'll likely pass the "in-viewport" check
// and will result in a situation we bail on scroll because of something like a fixed nav,
// even though the actual page content is offscreen
if (['sticky', 'fixed'].includes(getComputedStyle(element).position)) {
return true
}
// Uses `getBoundingClientRect` to check if the element is hidden instead of `offsetParent`
// because `offsetParent` doesn't consider document/body
const rect = element.getBoundingClientRect()
return rectProperties.every((item) => rect[item] === 0)
}
const enum ScrollTargetState { const enum ScrollTargetState {
NoClientRects, NoClientRects,
InViewport, InViewport,
...@@ -189,145 +138,14 @@ interface ScrollAndMaybeFocusHandlerProps { ...@@ -189,145 +138,14 @@ interface ScrollAndMaybeFocusHandlerProps {
children: React.ReactNode children: React.ReactNode
cacheNode: CacheNode cacheNode: CacheNode
} }
class InnerScrollAndFocusHandlerOld extends React.Component<ScrollAndMaybeFocusHandlerProps> {
handlePotentialScroll = () => {
// Handle scroll and focus, it's only applied once.
const { focusAndScrollRef, cacheNode } = this.props
const scrollRef = focusAndScrollRef.forceScroll
? focusAndScrollRef.scrollRef
: cacheNode.scrollRef
if (scrollRef === null || !scrollRef.current) return
let domNode:
| ReturnType<typeof getHashFragmentDomNode>
| ReturnType<typeof findDOMNode> = null
const hashFragment = focusAndScrollRef.hashFragment
if (hashFragment) {
domNode = getHashFragmentDomNode(hashFragment)
if (domNode === null) {
// A missing hash target is still a handled scroll intent. Do not
// fall back to the route segment or leave the intent pending.
scrollRef.current = false
focusAndScrollRef.onlyHashChange = false
focusAndScrollRef.hashFragment = null
return
}
}
// `findDOMNode` is tricky because it returns just the first child if the component is a fragment.
// This already caused a bug where the first child was a <link/> in head.
if (!domNode) {
domNode = findDOMNode(this)
}
// If there is no DOM node this layout-router level is skipped. It'll be handled higher-up in the tree.
if (!(domNode instanceof Element)) {
return
}
// Verify if the element is a HTMLElement and if we want to consider it for scroll behavior.
// If the element is skipped, try to select the next sibling and try again.
while (!(domNode instanceof HTMLElement) || shouldSkipElement(domNode)) {
if (process.env.NODE_ENV !== 'production') {
if (domNode.parentElement?.localName === 'head') {
// We enter this state when metadata was rendered as part of the page or via Next.js.
// This is always a bug in Next.js and caused by React hoisting metadata.
// Fixed with `experimental.appNewScrollHandler`
}
}
// No siblings found that match the criteria are found, so handle scroll higher up in the tree instead.
if (domNode.nextElementSibling === null) {
return
}
domNode = domNode.nextElementSibling
}
// Mark as scrolled so no other segment scrolls for this navigation.
scrollRef.current = false
disableSmoothScrollDuringRouteTransition(
() => {
// In case of hash scroll, we only need to scroll the element into view
if (hashFragment) {
domNode.scrollIntoView()
return
}
// Store the current viewport height because reading `clientHeight` causes a reflow,
// and it won't change during this function.
const htmlElement = document.documentElement
const viewportHeight = htmlElement.clientHeight
let scrollPaddingTop: number | null = null
const getScrollPaddingTop = () => {
if (scrollPaddingTop === null) {
// Reuse the style and layout update from the geometry read above.
scrollPaddingTop = getScrollPaddingTopInPixels(
htmlElement,
viewportHeight
)
}
return scrollPaddingTop
}
// If the element's top edge is already in the viewport, exit early.
if (
getScrollTargetState(domNode, viewportHeight, getScrollPaddingTop) ===
ScrollTargetState.InViewport
) {
return
}
// Otherwise, try scrolling go the top of the document to be backward compatible with pages
// scrollIntoView() called on `<html/>` element scrolls horizontally on chrome and firefox (that shouldn't happen)
// We could use it to scroll horizontally following RTL but that also seems to be broken - it will always scroll left
// scrollLeft = 0 also seems to ignore RTL and manually checking for RTL is too much hassle so we will scroll just vertically
htmlElement.scrollTop = 0
// Scroll to domNode if domNode is not in viewport when scrolled to top of document
if (
getScrollTargetState(domNode, viewportHeight, getScrollPaddingTop) !==
ScrollTargetState.InViewport
) {
// Scroll into view doesn't scroll horizontally by default when not needed
domNode.scrollIntoView()
}
},
{
// We will force layout by querying domNode position
dontForceLayout: true,
onlyHashChange: focusAndScrollRef.onlyHashChange,
}
)
// Mutate after scrolling so that it can be read by `disableSmoothScrollDuringRouteTransition`
focusAndScrollRef.onlyHashChange = false
focusAndScrollRef.hashFragment = null
// Set focus on the element
domNode.focus()
}
componentDidMount() {
this.handlePotentialScroll()
}
componentDidUpdate() {
this.handlePotentialScroll()
}
render() {
return this.props.children
}
}
/** /**
* Fork of InnerScrollAndFocusHandlerOld using Fragment refs for scrolling. * Uses Fragment refs for scrolling.
* No longer focuses the first host descendant. * Does not focus the first host descendant.
*/ */
function InnerScrollHandlerNew(props: ScrollAndMaybeFocusHandlerProps) { function InnerScrollAndMaybeFocusHandler(
props: ScrollAndMaybeFocusHandlerProps
) {
const childrenRef = React.useRef<FragmentInstance>(null) const childrenRef = React.useRef<FragmentInstance>(null)
useLayoutEffect( useLayoutEffect(
...@@ -459,10 +277,6 @@ function InnerScrollHandlerNew(props: ScrollAndMaybeFocusHandlerProps) { ...@@ -459,10 +277,6 @@ function InnerScrollHandlerNew(props: ScrollAndMaybeFocusHandlerProps) {
return <Fragment ref={childrenRef}>{props.children}</Fragment> return <Fragment ref={childrenRef}>{props.children}</Fragment>
} }
const InnerScrollAndMaybeFocusHandler = enableNewScrollHandler
? InnerScrollHandlerNew
: InnerScrollAndFocusHandlerOld
function ScrollAndMaybeFocusHandler({ function ScrollAndMaybeFocusHandler({
children, children,
cacheNode, cacheNode,
......
...@@ -194,7 +194,6 @@ export const experimentalSchema = { ...@@ -194,7 +194,6 @@ export const experimentalSchema = {
useSkewCookie: z.boolean().optional(), useSkewCookie: z.boolean().optional(),
after: z.boolean().optional(), after: z.boolean().optional(),
appNavFailHandling: z.boolean().optional(), appNavFailHandling: z.boolean().optional(),
appNewScrollHandler: z.boolean().optional(),
coldCacheBadge: z.boolean().optional(), coldCacheBadge: z.boolean().optional(),
preloadEntriesOnStart: z.boolean().optional(), preloadEntriesOnStart: z.boolean().optional(),
allowedRevalidateHeaderKeys: z.array(z.string()).optional(), allowedRevalidateHeaderKeys: z.array(z.string()).optional(),
......
...@@ -469,7 +469,6 @@ export interface ExperimentalConfig { ...@@ -469,7 +469,6 @@ export interface ExperimentalConfig {
*/ */
outputHashSalt?: string outputHashSalt?: string
appNewScrollHandler?: boolean
/** /**
* Shows a persistent "Cold cache" badge in the dev overlay after a load that * Shows a persistent "Cold cache" badge in the dev overlay after a load that
* filled an empty cache while streaming. Off by default while the badge's * filled an empty cache while streaming. Off by default while the badge's
...@@ -2156,7 +2155,6 @@ export const defaultConfig = Object.freeze({ ...@@ -2156,7 +2155,6 @@ export const defaultConfig = Object.freeze({
}, },
adapterPath: process.env.NEXT_ADAPTER_PATH || undefined, adapterPath: process.env.NEXT_ADAPTER_PATH || undefined,
experimental: { experimental: {
appNewScrollHandler: true,
coldCacheBadge: false, coldCacheBadge: false,
devValidationWorker: true, devValidationWorker: true,
useSkewCookie: false, useSkewCookie: false,
......
...@@ -2384,30 +2384,6 @@ function enforceExperimentalFeatures( ...@@ -2384,30 +2384,6 @@ function enforceExperimentalFeatures(
config.experimental.cachedNavigations = true config.experimental.cachedNavigations = true
} }
// appNewScrollHandler defaults to `true`. The env var lets us opt back out to
// keep test coverage of the old scroll handler on the non-experimental CI
// shards. Like the other env-var experimental toggles, opting out is surfaced
// in the reported experimental features.
// TODO: Remove this once the appNewScrollHandler opt-out is no longer needed
// for test coverage.
if (
process.env.__NEXT_EXPERIMENTAL_APP_NEW_SCROLL_HANDLER === 'false' &&
// We do respect an explicit value in the user config.
(config.experimental.appNewScrollHandler === undefined ||
(isDefaultConfig && config.experimental.appNewScrollHandler))
) {
config.experimental.appNewScrollHandler = false
if (configuredExperimentalFeatures) {
addConfiguredExperimentalFeature(
configuredExperimentalFeatures,
'appNewScrollHandler',
false,
'disabled by `__NEXT_EXPERIMENTAL_APP_NEW_SCROLL_HANDLER`'
)
}
}
// TODO: Remove this once strictRouteTypes is the default. // TODO: Remove this once strictRouteTypes is the default.
if ( if (
process.env.__NEXT_EXPERIMENTAL_STRICT_ROUTE_TYPES === 'true' && process.env.__NEXT_EXPERIMENTAL_STRICT_ROUTE_TYPES === 'true' &&
......
...@@ -15,8 +15,6 @@ ...@@ -15,8 +15,6 @@
set -eo pipefail set -eo pipefail
experimental=false
while [ $# -gt 0 ]; do while [ $# -gt 0 ]; do
case "$1" in case "$1" in
--mode=dev|--mode=start|--mode=deploy) --mode=dev|--mode=start|--mode=deploy)
...@@ -41,7 +39,6 @@ while [ $# -gt 0 ]; do ...@@ -41,7 +39,6 @@ while [ $# -gt 0 ]; do
exit 1 exit 1
;; ;;
--experimental) --experimental)
experimental=true
export __NEXT_CACHE_COMPONENTS=true export __NEXT_CACHE_COMPONENTS=true
;; ;;
--headless) --headless)
...@@ -59,14 +56,6 @@ while [ $# -gt 0 ]; do ...@@ -59,14 +56,6 @@ while [ $# -gt 0 ]; do
shift shift
done done
# appNewScrollHandler defaults to `true`. Non-experimental runs opt out so
# local runs mirror the non-experimental CI shards and keep coverage of the old
# scroll handler; experimental runs leave it on via the default. An explicit
# value in the environment is respected either way.
if [ "$experimental" != true ]; then
export __NEXT_EXPERIMENTAL_APP_NEW_SCROLL_HANDLER="${__NEXT_EXPERIMENTAL_APP_NEW_SCROLL_HANDLER:-false}"
fi
# Resolves to `node_modules/.bin/jest` via `$PATH`. This relies on being # Resolves to `node_modules/.bin/jest` via `$PATH`. This relies on being
# invoked through pnpm (or another package runner), which prepends the # invoked through pnpm (or another package runner), which prepends the
# workspace's `node_modules/.bin/` to `$PATH` before running the script. # workspace's `node_modules/.bin/` to `$PATH` before running the script.
......
...@@ -4,11 +4,6 @@ import stripAnsi from 'strip-ansi' ...@@ -4,11 +4,6 @@ import stripAnsi from 'strip-ansi'
import { retry } from 'next-test-utils' import { retry } from 'next-test-utils'
const bundlerName = process.env.IS_TURBOPACK_TEST ? 'Turbopack' : 'Webpack' const bundlerName = process.env.IS_TURBOPACK_TEST ? 'Turbopack' : 'Webpack'
const enableNewScrollHandler =
process.env.__NEXT_EXPERIMENTAL_APP_NEW_SCROLL_HANDLER !== 'false'
const innerScrollAndMaybeFocusHandlerName = enableNewScrollHandler
? 'InnerScrollHandlerNew'
: 'InnerScrollAndFocusHandlerOld'
function setupLogCapture() { function setupLogCapture() {
const logs: string[] = [] const logs: string[] = []
...@@ -382,26 +377,25 @@ describe(`Terminal Logging (${bundlerName})`, () => { ...@@ -382,26 +377,25 @@ describe(`Terminal Logging (${bundlerName})`, () => {
https://react.dev/link/hydration-mismatch https://react.dev/link/hydration-mismatch
... ...
<RenderFromTemplateContext> <ScrollAndMaybeFocusHandler cacheNode={{rsc:{...}, ...}}>
<ScrollAndMaybeFocusHandler cacheNode={{rsc:{...}, ...}}> <InnerScrollAndMaybeFocusHandler focusAndScrollRef={{scrollRef:null, ...}} cacheNode={{rsc:{...}, ...}}>
<${innerScrollAndMaybeFocusHandlerName} focusAndScrollRef={{scrollRef:null, ...}} cacheNode={{rsc:{...}, ...}}> <ErrorBoundary errorComponent={undefined} errorStyles={undefined} errorScripts={undefined}>
<ErrorBoundary errorComponent={undefined} errorStyles={undefined} errorScripts={undefined}> <LoadingBoundary name="hydration-..." loading={null}>
<LoadingBoundary name="hydration-..." loading={null}> <HTTPAccessFallbackBoundary notFound={undefined} forbidden={undefined} unauthorized={undefined}>
<HTTPAccessFallbackBoundary notFound={undefined} forbidden={undefined} unauthorized={undefined}> <RedirectBoundary>
<RedirectBoundary> <RedirectErrorBoundary router={{...}}>
<RedirectErrorBoundary router={{...}}> <InnerLayoutRouter url="/hydration..." tree={[...]} params={{}} cacheNode={{rsc:{...}, ...}} ...>
<InnerLayoutRouter url="/hydration..." tree={[...]} params={{}} cacheNode={{rsc:{...}, ...}} ...> <SegmentViewNode type="page" pagePath="hydration-...">
<SegmentViewNode type="page" pagePath="hydration-..."> <SegmentTrieNode>
<SegmentTrieNode> <ClientPageRoot Component={function Page} serverProvidedParams={{...}}>
<ClientPageRoot Component={function Page} serverProvidedParams={{...}}> <Page params={Promise} searchParams={Promise}>
<Page params={Promise} searchParams={Promise}> <div>
<div> <p>
<p> + client
+ client - server
- server
...
... ...
... ...
...
at <unknown> (https://react.dev/link/hydration-mismatch) at <unknown> (https://react.dev/link/hydration-mismatch)
at p (<anonymous>) at p (<anonymous>)
......
...@@ -27,7 +27,7 @@ describe('server-side dev errors', () => { ...@@ -27,7 +27,7 @@ describe('server-side dev errors', () => {
if (/^[✓⚠△] /.test(trimmed)) return false if (/^[✓⚠△] /.test(trimmed)) return false
// Individual entries under the `- Experiments` header are indented and // Individual entries under the `- Experiments` header are indented and
// use status glyphs (✓ enabled, ⨯ disabled, · value), e.g. // use status glyphs (✓ enabled, ⨯ disabled, · value), e.g.
// ` ⨯ appNewScrollHandler (disabled by ...)`. Only these banner entries // ` ⨯ exampleFlag (disabled by ...)`. Only these banner entries
// are indented; real dev errors start at column 0 (`⨯ ReferenceError: // are indented; real dev errors start at column 0 (`⨯ ReferenceError:
// ...`), so key off the leading indentation to avoid dropping them. // ...`), so key off the leading indentation to avoid dropping them.
if (/^\s+[✓⚠△⨯·] /.test(item)) return false if (/^\s+[✓⚠△⨯·] /.test(item)) return false
......
import { nextTestSetup } from 'e2e-utils' import { nextTestSetup } from 'e2e-utils'
import { retry } from 'next-test-utils' import { retry } from 'next-test-utils'
const enableNewScrollHandler =
process.env.__NEXT_EXPERIMENTAL_APP_NEW_SCROLL_HANDLER !== 'false'
// The new handler leaves focus on the clicked link; the old handler focuses the
// navigated segment.
describe('navigation-focus', () => { describe('navigation-focus', () => {
const { next } = nextTestSetup({ const { next } = nextTestSetup({
files: __dirname, files: __dirname,
...@@ -18,17 +13,9 @@ describe('navigation-focus', () => { ...@@ -18,17 +13,9 @@ describe('navigation-focus', () => {
await retry(async () => { await retry(async () => {
// Good debug info is a moving target. Use Playwright traces to find out // Good debug info is a moving target. Use Playwright traces to find out
// what was focused if this fails // what was focused if this fails
if (enableNewScrollHandler) { expect(
expect( await browser.eval(() => document.activeElement.getAttribute('href'))
await browser.eval(() => document.activeElement.getAttribute('href')) ).toBe('/interactive-segment')
).toBe('/interactive-segment')
} else {
expect(
await browser.eval(() =>
document.activeElement.getAttribute('data-testid')
)
).toBe('segment-container')
}
}) })
}) })
...@@ -37,17 +24,9 @@ describe('navigation-focus', () => { ...@@ -37,17 +24,9 @@ describe('navigation-focus', () => {
await browser.elementByCss('a[href="/scrollable-segment"]').click() await browser.elementByCss('a[href="/scrollable-segment"]').click()
await retry(async () => { await retry(async () => {
if (enableNewScrollHandler) { expect(
expect( await browser.eval(() => document.activeElement.getAttribute('href'))
await browser.eval(() => document.activeElement.getAttribute('href')) ).toBe('/scrollable-segment')
).toBe('/scrollable-segment')
} else {
expect(
await browser.eval(() =>
document.activeElement.getAttribute('data-testid')
)
).toBe('segment-container')
}
}) })
}) })
......
import { nextTestSetup } from 'e2e-utils' import { nextTestSetup } from 'e2e-utils'
import { getTitle, retry, waitFor } from 'next-test-utils' import { getTitle, retry, waitFor } from 'next-test-utils'
// bump this every time you want to validate flakiness: 1
describe('app dir - navigation', () => { describe('app dir - navigation', () => {
const { next, isNextDev, isNextStart, isNextDeploy } = nextTestSetup({ const { next, isNextDev, isNextStart, isNextDeploy } = nextTestSetup({
files: __dirname, files: __dirname,
......
import { nextTestSetup } from 'e2e-utils' import { nextTestSetup } from 'e2e-utils'
import { retry } from 'next-test-utils' import { retry } from 'next-test-utils'
describe.each([false, true])( describe('parallel-routes-empty-fragment-scroll', () => {
'parallel-routes-empty-fragment-scroll (appNewScrollHandler: %s)', const { next } = nextTestSetup({
(appNewScrollHandler) => { files: __dirname,
const { next } = nextTestSetup({ })
files: __dirname,
nextConfig: {
experimental: {
appNewScrollHandler,
},
},
})
it('preserves scroll when an empty intercepted modal is the only changed slot', async () => {
const browser = await next.browser('/modal')
await browser.eval('window.scrollTo(0, 1200)') it('preserves scroll when an empty intercepted modal is the only changed slot', async () => {
const initialScroll = await browser.eval('window.scrollY') const browser = await next.browser('/modal')
expect(initialScroll).toBeGreaterThan(0)
await browser.elementByCss('#open-empty-modal').click() await browser.eval('window.scrollTo(0, 1200)')
await retry(async () => { const initialScroll = await browser.eval('window.scrollY')
expect(await browser.url()).toBe(`${next.url}/modal/open`) expect(initialScroll).toBeGreaterThan(0)
})
await browser.eval( await browser.elementByCss('#open-empty-modal').click()
'new Promise((resolve) => requestAnimationFrame(() => requestAnimationFrame(resolve)))' await retry(async () => {
) expect(await browser.url()).toBe(`${next.url}/modal/open`)
expect(await browser.eval('window.scrollY')).toBe(initialScroll)
}) })
it('does not blur focus when the empty slot cannot handle scroll', async () => { await browser.eval(
const browser = await next.browser('/modal') 'new Promise((resolve) => requestAnimationFrame(() => requestAnimationFrame(resolve)))'
)
expect(await browser.eval('window.scrollY')).toBe(initialScroll)
})
it('does not blur focus when the empty slot cannot handle scroll', async () => {
const browser = await next.browser('/modal')
await browser.eval(` await browser.eval(`
window.scrollTo(0, 1200) window.scrollTo(0, 1200)
document.getElementById('focus-target').focus({ preventScroll: true }) document.getElementById('focus-target').focus({ preventScroll: true })
document.getElementById('open-empty-modal').click() document.getElementById('open-empty-modal').click()
`) `)
await retry(async () => { await retry(async () => {
expect(await browser.url()).toBe(`${next.url}/modal/open`) expect(await browser.url()).toBe(`${next.url}/modal/open`)
})
await browser.eval(
'new Promise((resolve) => requestAnimationFrame(() => requestAnimationFrame(resolve)))'
)
expect(await browser.eval('document.activeElement.id')).toBe(
'focus-target'
)
}) })
it('consumes a missing hash without scrolling or blurring', async () => { await browser.eval(
const browser = await next.browser('/modal') 'new Promise((resolve) => requestAnimationFrame(() => requestAnimationFrame(resolve)))'
)
expect(await browser.eval('document.activeElement.id')).toBe('focus-target')
})
const initialScroll = await browser.eval(` it('consumes a missing hash without scrolling or blurring', async () => {
const browser = await next.browser('/modal')
const initialScroll = await browser.eval(`
window.scrollTo(0, 1200) window.scrollTo(0, 1200)
document.getElementById('focus-target').focus({ preventScroll: true }) document.getElementById('focus-target').focus({ preventScroll: true })
document.getElementById('open-modal-missing-hash').click() document.getElementById('open-modal-missing-hash').click()
window.scrollY window.scrollY
`) `)
await retry(async () => { await retry(async () => {
expect(await browser.url()).toBe( expect(await browser.url()).toBe(
`${next.url}/modal/visible#missing-target` `${next.url}/modal/visible#missing-target`
)
})
await retry(async () => {
expect(await browser.elementByCss('#visible-modal').text()).toBe(
'Visible modal'
)
})
await browser.eval(
'new Promise((resolve) => requestAnimationFrame(() => requestAnimationFrame(resolve)))'
) )
expect(await browser.eval('window.scrollY')).toBe(initialScroll) })
expect(await browser.eval('document.activeElement.id')).toBe( await retry(async () => {
'focus-target' expect(await browser.elementByCss('#visible-modal').text()).toBe(
'Visible modal'
) )
}) })
it('scrolls to a real hash target', async () => { await browser.eval(
const browser = await next.browser('/modal') 'new Promise((resolve) => requestAnimationFrame(() => requestAnimationFrame(resolve)))'
)
expect(await browser.eval('window.scrollY')).toBe(initialScroll)
expect(await browser.eval('document.activeElement.id')).toBe('focus-target')
})
await browser.elementByCss('#open-empty-modal-real-hash').click() it('scrolls to a real hash target', async () => {
await retry(async () => { const browser = await next.browser('/modal')
expect(await browser.url()).toBe(`${next.url}/modal/open#hash-target`)
})
await retry(async () => { await browser.elementByCss('#open-empty-modal-real-hash').click()
const targetTop = await browser.eval( await retry(async () => {
"document.getElementById('hash-target').getBoundingClientRect().top" expect(await browser.url()).toBe(`${next.url}/modal/open#hash-target`)
) })
expect(Math.abs(targetTop)).toBeLessThan(1)
}) await retry(async () => {
const targetTop = await browser.eval(
"document.getElementById('hash-target').getBoundingClientRect().top"
)
expect(Math.abs(targetTop)).toBeLessThan(1)
}) })
} })
) })
import { nextTestSetup, type Playwright } from 'e2e-utils' import { nextTestSetup, type Playwright } from 'e2e-utils'
import { check, assertNoConsoleErrors, retry } from 'next-test-utils' import { check, assertNoConsoleErrors, retry } from 'next-test-utils'
const enableNewScrollHandler =
process.env.__NEXT_EXPERIMENTAL_APP_NEW_SCROLL_HANDLER !== 'false'
describe('router autoscrolling on navigation', () => { describe('router autoscrolling on navigation', () => {
const { next, isNextDev } = nextTestSetup({ const { next, isNextDev } = nextTestSetup({
files: __dirname, files: __dirname,
...@@ -319,12 +316,6 @@ describe('router autoscrolling on navigation', () => { ...@@ -319,12 +316,6 @@ describe('router autoscrolling on navigation', () => {
expect( expect(
await browser.eval('document.documentElement.scrollHeight') await browser.eval('document.documentElement.scrollHeight')
).toBeGreaterThan(0) ).toBeGreaterThan(0)
if (enableNewScrollHandler) { await waitForScrollToComplete(browser, { x: 0, y: 0 })
await waitForScrollToComplete(browser, { x: 0, y: 0 })
} else {
await expect(
waitForScrollToComplete(browser, { x: 0, y: 0 })
).rejects.toThrow()
}
}) })
}) })
...@@ -39,8 +39,6 @@ describe('Config Experimental Warning', () => { ...@@ -39,8 +39,6 @@ describe('Config Experimental Warning', () => {
experimental: { experimental: {
// We enable this in some CI shards // We enable this in some CI shards
strictRouteTypes: false, strictRouteTypes: false,
// We disable this in some CI shards
appNewScrollHandler: true,
}, },
}, },
}) })
...@@ -103,8 +101,6 @@ describe('Config Experimental Warning', () => { ...@@ -103,8 +101,6 @@ describe('Config Experimental Warning', () => {
workerThreads: false, workerThreads: false,
// We enable this in some CI shards // We enable this in some CI shards
strictRouteTypes: false, strictRouteTypes: false,
// We disable this in some CI shards
appNewScrollHandler: true,
} }
}) })
`, `,
......
...@@ -35,7 +35,7 @@ function extractErrorBlock(output: string, errorTitle: string): string { ...@@ -35,7 +35,7 @@ function extractErrorBlock(output: string, errorTitle: string): string {
// path (e.g. `⨯ ./app/file.js`). In prod mode, errors start with a bare // path (e.g. `⨯ ./app/file.js`). In prod mode, errors start with a bare
// file-path line above the title. Match `⨯ ./` specifically so we don't latch // file-path line above the title. Match `⨯ ./` specifically so we don't latch
// onto unrelated `⨯` markers in the startup output, such as the experimental // onto unrelated `⨯` markers in the startup output, such as the experimental
// features list (e.g. `⨯ appNewScrollHandler (disabled by ...)`). // features list (e.g. `⨯ exampleFlag (disabled by ...)`).
const markerIdx = beforeTitle.lastIndexOf('⨯ ./') const markerIdx = beforeTitle.lastIndexOf('⨯ ./')
let startIdx: number let startIdx: number
if (markerIdx !== -1) { if (markerIdx !== -1) {
......
...@@ -499,10 +499,6 @@ export class NextInstance { ...@@ -499,10 +499,6 @@ export class NextInstance {
if (process.env.NEXT_PRIVATE_EXPERIMENTAL_CACHED_NAVIGATIONS) { if (process.env.NEXT_PRIVATE_EXPERIMENTAL_CACHED_NAVIGATIONS) {
process.env.__NEXT_EXPERIMENTAL_CACHED_NAVIGATIONS = process.env.NEXT_PRIVATE_EXPERIMENTAL_CACHED_NAVIGATIONS process.env.__NEXT_EXPERIMENTAL_CACHED_NAVIGATIONS = process.env.NEXT_PRIVATE_EXPERIMENTAL_CACHED_NAVIGATIONS
} }
if (process.env.NEXT_PRIVATE_EXPERIMENTAL_APP_NEW_SCROLL_HANDLER) {
process.env.__NEXT_EXPERIMENTAL_APP_NEW_SCROLL_HANDLER = process.env.NEXT_PRIVATE_EXPERIMENTAL_APP_NEW_SCROLL_HANDLER
}
` `
) )
......
...@@ -433,11 +433,6 @@ export class NextDeployInstance extends NextInstance { ...@@ -433,11 +433,6 @@ export class NextDeployInstance extends NextInstance {
`NEXT_PRIVATE_EXPERIMENTAL_CACHED_NAVIGATIONS=${process.env.__NEXT_EXPERIMENTAL_CACHED_NAVIGATIONS}` `NEXT_PRIVATE_EXPERIMENTAL_CACHED_NAVIGATIONS=${process.env.__NEXT_EXPERIMENTAL_CACHED_NAVIGATIONS}`
) )
} }
if (process.env.__NEXT_EXPERIMENTAL_APP_NEW_SCROLL_HANDLER) {
additionalEnv.push(
`NEXT_PRIVATE_EXPERIMENTAL_APP_NEW_SCROLL_HANDLER=${process.env.__NEXT_EXPERIMENTAL_APP_NEW_SCROLL_HANDLER}`
)
}
if (process.env.IS_TURBOPACK_TEST) { if (process.env.IS_TURBOPACK_TEST) {
additionalEnv.push(`IS_TURBOPACK_TEST=1`) additionalEnv.push(`IS_TURBOPACK_TEST=1`)
} }
......
...@@ -1541,8 +1541,7 @@ const nextjsClientComponentNames = [ ...@@ -1541,8 +1541,7 @@ const nextjsClientComponentNames = [
'HTTPAccessFallbackBoundary', 'HTTPAccessFallbackBoundary',
'HTTPAccessFallbackErrorBoundary', 'HTTPAccessFallbackErrorBoundary',
'InnerLayoutRouter', 'InnerLayoutRouter',
'InnerScrollAndFocusHandlerOld', 'InnerScrollAndMaybeFocusHandler',
'InnerScrollHandlerNew',
'RedirectBoundary', 'RedirectBoundary',
'RedirectErrorBoundary', 'RedirectErrorBoundary',
'RenderFromTemplateContext', 'RenderFromTemplateContext',
......
...@@ -52,7 +52,6 @@ describe('build-output-prerender', () => { ...@@ -52,7 +52,6 @@ describe('build-output-prerender', () => {
✓ Running next.config.js took N ✓ Running next.config.js took N
- Cache Components enabled - Cache Components enabled
- Experiments (use with caution): - Experiments (use with caution):
⨯ appNewScrollHandler (disabled by \`__NEXT_EXPERIMENTAL_APP_NEW_SCROLL_HANDLER\`)
· staticGenerationMaxConcurrency: 1 · staticGenerationMaxConcurrency: 1
✓ strictRouteTypes (enabled by \`__NEXT_EXPERIMENTAL_STRICT_ROUTE_TYPES\`)" ✓ strictRouteTypes (enabled by \`__NEXT_EXPERIMENTAL_STRICT_ROUTE_TYPES\`)"
`) `)
...@@ -62,7 +61,6 @@ describe('build-output-prerender', () => { ...@@ -62,7 +61,6 @@ describe('build-output-prerender', () => {
✓ Running next.config.js took N ✓ Running next.config.js took N
- Cache Components enabled - Cache Components enabled
- Experiments (use with caution): - Experiments (use with caution):
⨯ appNewScrollHandler (disabled by \`__NEXT_EXPERIMENTAL_APP_NEW_SCROLL_HANDLER\`)
· staticGenerationMaxConcurrency: 1" · staticGenerationMaxConcurrency: 1"
`) `)
} else { } else {
...@@ -71,7 +69,6 @@ describe('build-output-prerender', () => { ...@@ -71,7 +69,6 @@ describe('build-output-prerender', () => {
✓ Running next.config.js took N ✓ Running next.config.js took N
- Cache Components enabled - Cache Components enabled
- Experiments (use with caution): - Experiments (use with caution):
⨯ appNewScrollHandler (disabled by \`__NEXT_EXPERIMENTAL_APP_NEW_SCROLL_HANDLER\`)
· staticGenerationMaxConcurrency: 1 · staticGenerationMaxConcurrency: 1
✓ strictRouteTypes (enabled by \`__NEXT_EXPERIMENTAL_STRICT_ROUTE_TYPES\`)" ✓ strictRouteTypes (enabled by \`__NEXT_EXPERIMENTAL_STRICT_ROUTE_TYPES\`)"
`) `)
...@@ -193,7 +190,6 @@ describe('build-output-prerender', () => { ...@@ -193,7 +190,6 @@ describe('build-output-prerender', () => {
- Cache Components enabled - Cache Components enabled
- Experiments (use with caution): - Experiments (use with caution):
✓ allowDevelopmentBuild (enabled by \`--debug-prerender\`) ✓ allowDevelopmentBuild (enabled by \`--debug-prerender\`)
⨯ appNewScrollHandler (disabled by \`__NEXT_EXPERIMENTAL_APP_NEW_SCROLL_HANDLER\`)
⨯ prerenderEarlyExit (disabled by \`--debug-prerender\`) ⨯ prerenderEarlyExit (disabled by \`--debug-prerender\`)
✓ serverSourceMaps (enabled by \`--debug-prerender\`) ✓ serverSourceMaps (enabled by \`--debug-prerender\`)
· staticGenerationMaxConcurrency: 1 · staticGenerationMaxConcurrency: 1
...@@ -208,7 +204,6 @@ describe('build-output-prerender', () => { ...@@ -208,7 +204,6 @@ describe('build-output-prerender', () => {
- Cache Components enabled - Cache Components enabled
- Experiments (use with caution): - Experiments (use with caution):
✓ allowDevelopmentBuild (enabled by \`--debug-prerender\`) ✓ allowDevelopmentBuild (enabled by \`--debug-prerender\`)
⨯ appNewScrollHandler (disabled by \`__NEXT_EXPERIMENTAL_APP_NEW_SCROLL_HANDLER\`)
⨯ prerenderEarlyExit (disabled by \`--debug-prerender\`) ⨯ prerenderEarlyExit (disabled by \`--debug-prerender\`)
⨯ serverMinification (disabled by \`--debug-prerender\`) ⨯ serverMinification (disabled by \`--debug-prerender\`)
✓ serverSourceMaps (enabled by \`--debug-prerender\`) ✓ serverSourceMaps (enabled by \`--debug-prerender\`)
...@@ -222,7 +217,6 @@ describe('build-output-prerender', () => { ...@@ -222,7 +217,6 @@ describe('build-output-prerender', () => {
- Cache Components enabled - Cache Components enabled
- Experiments (use with caution): - Experiments (use with caution):
✓ allowDevelopmentBuild (enabled by \`--debug-prerender\`) ✓ allowDevelopmentBuild (enabled by \`--debug-prerender\`)
⨯ appNewScrollHandler (disabled by \`__NEXT_EXPERIMENTAL_APP_NEW_SCROLL_HANDLER\`)
⨯ prerenderEarlyExit (disabled by \`--debug-prerender\`) ⨯ prerenderEarlyExit (disabled by \`--debug-prerender\`)
⨯ serverMinification (disabled by \`--debug-prerender\`) ⨯ serverMinification (disabled by \`--debug-prerender\`)
✓ serverSourceMaps (enabled by \`--debug-prerender\`) ✓ serverSourceMaps (enabled by \`--debug-prerender\`)
...@@ -376,22 +370,19 @@ describe('build-output-prerender', () => { ...@@ -376,22 +370,19 @@ describe('build-output-prerender', () => {
"▲ Next.js x.y.z (Turbopack) "▲ Next.js x.y.z (Turbopack)
✓ Running next.config took N ✓ Running next.config took N
- Experiments (use with caution): - Experiments (use with caution):
⨯ appNewScrollHandler (disabled by \`__NEXT_EXPERIMENTAL_APP_NEW_SCROLL_HANDLER\`)
✓ strictRouteTypes (enabled by \`__NEXT_EXPERIMENTAL_STRICT_ROUTE_TYPES\`)" ✓ strictRouteTypes (enabled by \`__NEXT_EXPERIMENTAL_STRICT_ROUTE_TYPES\`)"
`) `)
} else if (isRspack) { } else if (isRspack) {
expect(getPreambleOutput(next.cliOutput)).toMatchInlineSnapshot(` expect(getPreambleOutput(next.cliOutput)).toMatchInlineSnapshot(`
"▲ Next.js x.y.z (Rspack) "▲ Next.js x.y.z (Rspack)
✓ Running next.config took N ✓ Running next.config took N
- Experiments (use with caution): - Experiments (use with caution):"
⨯ appNewScrollHandler (disabled by \`__NEXT_EXPERIMENTAL_APP_NEW_SCROLL_HANDLER\`)"
`) `)
} else { } else {
expect(getPreambleOutput(next.cliOutput)).toMatchInlineSnapshot(` expect(getPreambleOutput(next.cliOutput)).toMatchInlineSnapshot(`
"▲ Next.js x.y.z (webpack) "▲ Next.js x.y.z (webpack)
✓ Running next.config took N ✓ Running next.config took N
- Experiments (use with caution): - Experiments (use with caution):
⨯ appNewScrollHandler (disabled by \`__NEXT_EXPERIMENTAL_APP_NEW_SCROLL_HANDLER\`)
✓ strictRouteTypes (enabled by \`__NEXT_EXPERIMENTAL_STRICT_ROUTE_TYPES\`)" ✓ strictRouteTypes (enabled by \`__NEXT_EXPERIMENTAL_STRICT_ROUTE_TYPES\`)"
`) `)
} }
...@@ -459,7 +450,6 @@ describe('build-output-prerender', () => { ...@@ -459,7 +450,6 @@ describe('build-output-prerender', () => {
✓ Running next.config took N ✓ Running next.config took N
- Experiments (use with caution): - Experiments (use with caution):
✓ allowDevelopmentBuild (enabled by \`--debug-prerender\`) ✓ allowDevelopmentBuild (enabled by \`--debug-prerender\`)
⨯ appNewScrollHandler (disabled by \`__NEXT_EXPERIMENTAL_APP_NEW_SCROLL_HANDLER\`)
⨯ prerenderEarlyExit (disabled by \`--debug-prerender\`) ⨯ prerenderEarlyExit (disabled by \`--debug-prerender\`)
✓ serverSourceMaps (enabled by \`--debug-prerender\`) ✓ serverSourceMaps (enabled by \`--debug-prerender\`)
✓ strictRouteTypes (enabled by \`__NEXT_EXPERIMENTAL_STRICT_ROUTE_TYPES\`) ✓ strictRouteTypes (enabled by \`__NEXT_EXPERIMENTAL_STRICT_ROUTE_TYPES\`)
...@@ -472,7 +462,6 @@ describe('build-output-prerender', () => { ...@@ -472,7 +462,6 @@ describe('build-output-prerender', () => {
✓ Running next.config took N ✓ Running next.config took N
- Experiments (use with caution): - Experiments (use with caution):
✓ allowDevelopmentBuild (enabled by \`--debug-prerender\`) ✓ allowDevelopmentBuild (enabled by \`--debug-prerender\`)
⨯ appNewScrollHandler (disabled by \`__NEXT_EXPERIMENTAL_APP_NEW_SCROLL_HANDLER\`)
⨯ prerenderEarlyExit (disabled by \`--debug-prerender\`) ⨯ prerenderEarlyExit (disabled by \`--debug-prerender\`)
⨯ serverMinification (disabled by \`--debug-prerender\`) ⨯ serverMinification (disabled by \`--debug-prerender\`)
✓ serverSourceMaps (enabled by \`--debug-prerender\`)" ✓ serverSourceMaps (enabled by \`--debug-prerender\`)"
...@@ -484,7 +473,6 @@ describe('build-output-prerender', () => { ...@@ -484,7 +473,6 @@ describe('build-output-prerender', () => {
✓ Running next.config took N ✓ Running next.config took N
- Experiments (use with caution): - Experiments (use with caution):
✓ allowDevelopmentBuild (enabled by \`--debug-prerender\`) ✓ allowDevelopmentBuild (enabled by \`--debug-prerender\`)
⨯ appNewScrollHandler (disabled by \`__NEXT_EXPERIMENTAL_APP_NEW_SCROLL_HANDLER\`)
⨯ prerenderEarlyExit (disabled by \`--debug-prerender\`) ⨯ prerenderEarlyExit (disabled by \`--debug-prerender\`)
⨯ serverMinification (disabled by \`--debug-prerender\`) ⨯ serverMinification (disabled by \`--debug-prerender\`)
✓ serverSourceMaps (enabled by \`--debug-prerender\`) ✓ serverSourceMaps (enabled by \`--debug-prerender\`)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment