rsnext/test/integration
JJ Kasper 38bd1a024c
Re-enable scroll restoration behind flag (#14046)
This updates the scroll position saving to occur as the scroll position changes instead of trying to do it when the navigation is changing since the `popState` event doesn't allow us to update the leaving history state once the `popState` has occurred. 

The order of events that was previously attempted to save scroll position on a `popState` event (back/forward navigation)

1. history.state is already updated with state from `popState`
2. we replace state with the currently rendered page adding scroll info
3. we replace state again with the `popState` event state overriding scroll info

Using this approach the above event order is no longer in conflict since we don't attempt to populate the state with scroll position while it's leaving the state and instead do it while it is still the active state in history

This approach resembles existing solutions:
https://www.npmjs.com/package/scroll-behavior
https://twitter.com/ryanflorence/status/1029121580855488512

Fixes: https://github.com/vercel/next.js/issues/13990
Fixes: #12530
x-ref: https://github.com/vercel/next.js/pull/14075
2020-07-06 14:27:45 +00:00
..
404-page Remove buildId from server-side files (#14413) 2020-06-22 21:12:36 +00:00
404-page-app Remove buildId from server-side files (#14413) 2020-06-22 21:12:36 +00:00
404-page-custom-error Remove buildId from server-side files (#14413) 2020-06-22 21:12:36 +00:00
404-page-ssg Upgrade to Prettier 2 (#13061) 2020-05-18 15:24:37 -04:00
amp-export-validation Refactor moveExportedPages to use getPagePath (#14247) 2020-06-17 03:40:07 +00:00
amphtml Remove buildId from server-side files (#14413) 2020-06-22 21:12:36 +00:00
amphtml-custom-optimizer Upgrade to Prettier 2 (#13061) 2020-05-18 15:24:37 -04:00
amphtml-custom-validator Use the jest-circus test runner (#12974) 2020-05-16 16:56:06 -04:00
amphtml-fragment-style Use the jest-circus test runner (#12974) 2020-05-16 16:56:06 -04:00
amphtml-ssg Normalize trailing slashes (#13333) 2020-06-23 13:38:49 +02:00
api-catch-all Normalize trailing slashes (#13333) 2020-06-23 13:38:49 +02:00
api-support Update filename generation for client-side compilation (#14279) 2020-06-20 19:59:47 +00:00
app-aspath Upgrade to Prettier 2 (#13061) 2020-05-18 15:24:37 -04:00
app-document Update references to zeit/next.js (#13463) 2020-05-27 17:51:11 -04:00
app-document-import-order Upgrade to Prettier 2 (#13061) 2020-05-18 15:24:37 -04:00
app-document-style-fragment Use the jest-circus test runner (#12974) 2020-05-16 16:56:06 -04:00
app-functional Upgrade to Prettier 2 (#13061) 2020-05-18 15:24:37 -04:00
app-tree Use the jest-circus test runner (#12974) 2020-05-16 16:56:06 -04:00
auto-export Upgrade to Prettier 2 (#13061) 2020-05-18 15:24:37 -04:00
auto-export-error-bail Add warning when reserved pages are nested (#13449) 2020-05-27 16:45:53 +00:00
auto-export-query-error Use the jest-circus test runner (#12974) 2020-05-16 16:56:06 -04:00
auto-export-serverless Use the jest-circus test runner (#12974) 2020-05-16 16:56:06 -04:00
auto-export-serverless-error Use the jest-circus test runner (#12974) 2020-05-16 16:56:06 -04:00
babel Upgrade to Prettier 2 (#13061) 2020-05-18 15:24:37 -04:00
babel-custom Use the jest-circus test runner (#12974) 2020-05-16 16:56:06 -04:00
basepath Fix URL being updated with basePath for 404 page (#14740) 2020-07-02 11:11:57 +02:00
basic Use single webpack runtimeChunk for Node.js compilation (#14722) 2020-07-01 15:34:00 +00:00
bigint Upgrade to Prettier 2 (#13061) 2020-05-18 15:24:37 -04:00
build-indicator Upgrade to Prettier 2 (#13061) 2020-05-18 15:24:37 -04:00
build-output Update to use getDataHref in fetchNextData (#14667) 2020-06-29 15:14:45 +00:00
build-warnings Upgrade to Prettier 2 (#13061) 2020-05-18 15:24:37 -04:00
bundle-size-profiling Enable polyfillsOptimization (#10574) 2020-02-18 19:26:55 +01:00
catches-missing-getStaticProps Use the jest-circus test runner (#12974) 2020-05-16 16:56:06 -04:00
chunking Remove buildId from server-side files (#14413) 2020-06-22 21:12:36 +00:00
cli Use the jest-circus test runner (#12974) 2020-05-16 16:56:06 -04:00
client-404 Add test case for loading 404 on invalid bundle (#14082) 2020-06-11 16:59:25 +00:00
client-navigation Normalize trailing slashes (#13333) 2020-06-23 13:38:49 +02:00
compression Use the jest-circus test runner (#12974) 2020-05-16 16:56:06 -04:00
config Simplify test checks (#14094) 2020-06-11 19:02:53 +00:00
config-devtool-dev Warn/revert custom devtool in development mode (#14285) 2020-06-24 04:15:57 +00:00
config-empty Update references to zeit/next.js (#13463) 2020-05-27 17:51:11 -04:00
config-experimental-warning Use the jest-circus test runner (#12974) 2020-05-16 16:56:06 -04:00
config-promise-error Update references to zeit/next.js (#13463) 2020-05-27 17:51:11 -04:00
config-resolve-alias Update filename generation for client-side compilation (#14279) 2020-06-20 19:59:47 +00:00
conflicting-public-file-page Use the jest-circus test runner (#12974) 2020-05-16 16:56:06 -04:00
conformance Remove remaining granular chunks references (#13672) 2020-06-02 14:45:07 +00:00
create-next-app chore(create-next-app): remove example picker (#13977) 2020-06-10 03:14:24 +00:00
css/test Upgrade CSSNano Version (#14638) 2020-06-29 21:29:53 +00:00
css-client-nav/test Upgrade to Prettier 2 (#13061) 2020-05-18 15:24:37 -04:00
css-customization/test Upgrade CSSNano Version (#14638) 2020-06-29 21:29:53 +00:00
css-features Upgrade CSSNano Version (#14638) 2020-06-29 21:29:53 +00:00
css-fixtures Upgrade CSSNano Version (#14638) 2020-06-29 21:29:53 +00:00
css-modules/test Upgrade to Prettier 2 (#13061) 2020-05-18 15:24:37 -04:00
custom-error Add eslint-plugin-jest (#13003) 2020-05-18 13:16:07 -04:00
custom-page-extension Use the jest-circus test runner (#12974) 2020-05-16 16:56:06 -04:00
custom-routes Update warning for rewriting to auto-export dynamic pages (#14751) 2020-07-02 04:12:41 +00:00
custom-routes-catchall De-experimentalize custom-routes (#14602) 2020-06-27 09:18:18 +00:00
custom-server Upgrade to Prettier 2 (#13061) 2020-05-18 15:24:37 -04:00
custom-server-types Use the jest-circus test runner (#12974) 2020-05-16 16:56:06 -04:00
data-fetching-errors Render a helpful message for null GS(S)P return (#14252) 2020-06-17 09:25:27 +00:00
dedupes-scripts Use the jest-circus test runner (#12974) 2020-05-16 16:56:06 -04:00
disable-js Use the jest-circus test runner (#12974) 2020-05-16 16:56:06 -04:00
dist-dir Use the jest-circus test runner (#12974) 2020-05-16 16:56:06 -04:00
duplicate-pages Upgrade to Prettier 2 (#13061) 2020-05-18 15:24:37 -04:00
dynamic-optional-routing Enable Optional Catch-All by Default (#14687) 2020-06-29 18:50:32 +00:00
dynamic-require Use the jest-circus test runner (#12974) 2020-05-16 16:56:06 -04:00
dynamic-route-rename Use the jest-circus test runner (#12974) 2020-05-16 16:56:06 -04:00
dynamic-routing Fix native-url path parsing bug (#14442) 2020-06-25 17:19:12 +00:00
empty-object-getInitialProps Upgrade to Prettier 2 (#13061) 2020-05-18 15:24:37 -04:00
empty-project Use the jest-circus test runner (#12974) 2020-05-16 16:56:06 -04:00
env-config Fix encoding for env files in serverless mode (#14750) 2020-06-30 21:33:37 +00:00
error-in-error Use the jest-circus test runner (#12974) 2020-05-16 16:56:06 -04:00
error-load-fail Update filename generation for client-side compilation (#14279) 2020-06-20 19:59:47 +00:00
errors-on-output-to-public Use the jest-circus test runner (#12974) 2020-05-16 16:56:06 -04:00
export Fix trailing slash handling in exporting pages with getStaticPaths (#14620) 2020-06-27 11:59:27 +00:00
export-default-map Use the jest-circus test runner (#12974) 2020-05-16 16:56:06 -04:00
export-default-map-serverless Use the jest-circus test runner (#12974) 2020-05-16 16:56:06 -04:00
export-dynamic-pages Use the jest-circus test runner (#12974) 2020-05-16 16:56:06 -04:00
export-dynamic-pages-serverless Use the jest-circus test runner (#12974) 2020-05-16 16:56:06 -04:00
export-fallback-true-error Add error when exporting pages with fallback: true (#13063) 2020-05-19 09:29:34 -04:00
export-intent Update to reject when test command fails (#13722) 2020-06-09 18:28:15 +00:00
export-override-404 Use the jest-circus test runner (#12974) 2020-05-16 16:56:06 -04:00
export-serverless Update references to zeit/next.js (#13463) 2020-05-27 17:51:11 -04:00
export-subfolders Use the jest-circus test runner (#12974) 2020-05-16 16:56:06 -04:00
export-subfolders-serverless Use the jest-circus test runner (#12974) 2020-05-16 16:56:06 -04:00
external-assets Use the jest-circus test runner (#12974) 2020-05-16 16:56:06 -04:00
externalize-next-server Remove buildId from server-side files (#14413) 2020-06-22 21:12:36 +00:00
fetch-polyfill Upgrade to Prettier 2 (#13061) 2020-05-18 15:24:37 -04:00
fetch-polyfill-ky-universal Upgrade to Prettier 2 (#13061) 2020-05-18 15:24:37 -04:00
file-serving Fix typo in test names: "treversing" → "traversing" (#14347) 2020-06-19 01:05:09 +00:00
filesystempublicroutes Update filename generation for client-side compilation (#14279) 2020-06-20 19:59:47 +00:00
firebase-grpc Add eslint-plugin-jest (#13003) 2020-05-18 13:16:07 -04:00
future Use the jest-circus test runner (#12974) 2020-05-16 16:56:06 -04:00
getserversideprops Update routeKeys to handle non-word characters (#12801) 2020-06-16 13:49:13 +00:00
getserversideprops-export-error Use the jest-circus test runner (#12974) 2020-05-16 16:56:06 -04:00
getserversideprops-preview Upgrade to Prettier 2 (#13061) 2020-05-18 15:24:37 -04:00
gip-identifier Upgrade to Prettier 2 (#13061) 2020-05-18 15:24:37 -04:00
gssp-pageProps-merge Upgrade to Prettier 2 (#13061) 2020-05-18 15:24:37 -04:00
handle-non-page-in-pages Use the jest-circus test runner (#12974) 2020-05-16 16:56:06 -04:00
handles-export-errors Add failing paths to export error summary (#10026) 2020-05-26 19:50:25 +00:00
hydration Add no-anon-default-export Babel lint rule (#14519) 2020-06-30 13:05:29 +00:00
index-index Fix pages/index.js and pages/index/index.js behavior (#13699) 2020-06-04 17:32:45 +00:00
initial-ref Use the jest-circus test runner (#12974) 2020-05-16 16:56:06 -04:00
invalid-config-values Ignore nullish user configs (#10250) 2020-05-22 16:46:36 +00:00
invalid-custom-routes De-experimentalize custom-routes (#14602) 2020-06-27 09:18:18 +00:00
invalid-href Speedup tests (#13461) 2020-05-29 07:57:51 +00:00
invalid-multi-match De-experimentalize custom-routes (#14602) 2020-06-27 09:18:18 +00:00
invalid-page-automatic-static-optimization Use the jest-circus test runner (#12974) 2020-05-16 16:56:06 -04:00
invalid-server-options Detailed error and warnings upon next() call (#13539) 2020-06-03 03:19:29 +00:00
jsconfig Improve jsconfig.json error message (#13053) 2020-05-18 12:07:08 -04:00
jsconfig-baseurl Use the jest-circus test runner (#12974) 2020-05-16 16:56:06 -04:00
jsconfig-empty An empty jsconfig.json should not fail the build (#13051) 2020-05-18 12:31:15 -04:00
jsconfig-paths Add eslint-plugin-jest (#13003) 2020-05-18 13:16:07 -04:00
legacy-pkg-gently Use the jest-circus test runner (#12974) 2020-05-16 16:56:06 -04:00
legacy-sass Remove refs to old css experiment (#13673) 2020-06-02 16:57:35 +00:00
legacy-ssg-methods-error Add eslint-plugin-jest (#13003) 2020-05-18 13:16:07 -04:00
link-ref Upgrade to Prettier 2 (#13061) 2020-05-18 15:24:37 -04:00
link-with-encoding Fix dynamic route encoding for NextLinks (#14281) 2020-06-29 16:44:43 -04:00
mixed-ssg-serverprops-error Use the jest-circus test runner (#12974) 2020-05-16 16:56:06 -04:00
modern-mode Use chunkhash instead of buildId for pages (#13937) 2020-06-11 10:57:24 +02:00
next-dynamic Use the jest-circus test runner (#12974) 2020-05-16 16:56:06 -04:00
next-plugins Clean up render.tsx options (#13759) 2020-06-06 23:00:03 +00:00
no-anon-default-export Add no-anon-default-export Babel lint rule (#14519) 2020-06-30 13:05:29 +00:00
no-override-next-props Update references to zeit/next.js (#13463) 2020-05-27 17:51:11 -04:00
non-next-dist-exclude Remove buildId from server-side files (#14413) 2020-06-22 21:12:36 +00:00
non-standard-node-env-warning Upgrade to Prettier 2 (#13061) 2020-05-18 15:24:37 -04:00
nullish-config Ignore nullish user configs (#10250) 2020-05-22 16:46:36 +00:00
ondemand Use entry option instead of custom make hook (#14527) 2020-06-26 04:26:09 +00:00
optional-chaining-nullish-coalescing Use the jest-circus test runner (#12974) 2020-05-16 16:56:06 -04:00
page-config Update references to zeit/next.js (#13463) 2020-05-27 17:51:11 -04:00
page-extensions Ignore nullish user configs (#10250) 2020-05-22 16:46:36 +00:00
plugin-mdx Use the jest-circus test runner (#12974) 2020-05-16 16:56:06 -04:00
polyfilling-minimal Use the jest-circus test runner (#12974) 2020-05-16 16:56:06 -04:00
polyfills Upgrade to Prettier 2 (#13061) 2020-05-18 15:24:37 -04:00
preload-viewport Update filename generation for client-side compilation (#14279) 2020-06-20 19:59:47 +00:00
prerender Enable Optional Catch-All by Default (#14687) 2020-06-29 18:50:32 +00:00
prerender-invalid-catchall-params Use the jest-circus test runner (#12974) 2020-05-16 16:56:06 -04:00
prerender-invalid-paths Use the jest-circus test runner (#12974) 2020-05-16 16:56:06 -04:00
prerender-legacy Use the jest-circus test runner (#12974) 2020-05-16 16:56:06 -04:00
prerender-no-revalidate Remove buildId from server-side files (#14413) 2020-06-22 21:12:36 +00:00
prerender-preview Upgrade to Prettier 2 (#13061) 2020-05-18 15:24:37 -04:00
process-env-stub Upgrade to Prettier 2 (#13061) 2020-05-18 15:24:37 -04:00
production Add etag support for getServerSideProps/getStaticProps pages (#14760) 2020-07-01 14:59:18 +00:00
production-browser-sourcemaps Upgrade to Prettier 2 (#13061) 2020-05-18 15:24:37 -04:00
production-build-dir Use the jest-circus test runner (#12974) 2020-05-16 16:56:06 -04:00
production-config Remove refs to old css experiment (#13673) 2020-06-02 16:57:35 +00:00
production-nav Use the jest-circus test runner (#12974) 2020-05-16 16:56:06 -04:00
profiling Use the jest-circus test runner (#12974) 2020-05-16 16:56:06 -04:00
query-with-encoding Use the jest-circus test runner (#12974) 2020-05-16 16:56:06 -04:00
react-profiling-mode Introduce react profiling production flag (#13873) 2020-06-28 11:23:29 +00:00
relay-analytics Use the jest-circus test runner (#12974) 2020-05-16 16:56:06 -04:00
render-error-on-module-error Use the jest-circus test runner (#12974) 2020-05-16 16:56:06 -04:00
route-index Fix pages/index.js and pages/index/index.js behavior (#13699) 2020-06-04 17:32:45 +00:00
route-indexes Fix pages/index.js and pages/index/index.js behavior (#13699) 2020-06-04 17:32:45 +00:00
route-load-cancel Upgrade to Prettier 2 (#13061) 2020-05-18 15:24:37 -04:00
scroll-back-restoration Re-enable scroll restoration behind flag (#14046) 2020-07-06 14:27:45 +00:00
scroll-forward-restoration Re-enable scroll restoration behind flag (#14046) 2020-07-06 14:27:45 +00:00
scss/test Upgrade CSSNano Version (#14638) 2020-06-29 21:29:53 +00:00
scss-fixtures Update references to zeit/next.js (#13463) 2020-05-27 17:51:11 -04:00
scss-modules/test Upgrade to Prettier 2 (#13061) 2020-05-18 15:24:37 -04:00
serverless Normalize trailing slashes (#13333) 2020-06-23 13:38:49 +02:00
serverless-runtime-configs Use the jest-circus test runner (#12974) 2020-05-16 16:56:06 -04:00
serverless-trace Normalize trailing slashes (#13333) 2020-06-23 13:38:49 +02:00
size-limit Wait for flush before firing routing event (#13287) 2020-05-23 21:54:11 +00:00
src-dir-support Upgrade to Prettier 2 (#13061) 2020-05-18 15:24:37 -04:00
src-dir-support-double-dir Use the jest-circus test runner (#12974) 2020-05-16 16:56:06 -04:00
ssg-dynamic-routes-404-page Use the jest-circus test runner (#12974) 2020-05-16 16:56:06 -04:00
ssr-ctx Upgrade to Prettier 2 (#13061) 2020-05-18 15:24:37 -04:00
ssr-prepass Use the jest-circus test runner (#12974) 2020-05-16 16:56:06 -04:00
static-404 Remove buildId from server-side files (#14413) 2020-06-22 21:12:36 +00:00
static-page-name Use the jest-circus test runner (#12974) 2020-05-16 16:56:06 -04:00
styled-jsx-module Use the jest-circus test runner (#12974) 2020-05-16 16:56:06 -04:00
styled-jsx-plugin Use the jest-circus test runner (#12974) 2020-05-16 16:56:06 -04:00
telemetry Record presence of reportWebVitals (#13155) 2020-05-20 18:44:39 +00:00
trailing-slash-dist Update filename generation for client-side compilation (#14279) 2020-06-20 19:59:47 +00:00
trailing-slashes Fix link to file url behavior with trailingSlash (#14681) 2020-06-30 02:25:12 +00:00
tsconfig-verifier refactor(typescript): extract preflight functions (#13510) 2020-05-28 23:39:46 +00:00
typeof-window-replace Use chunkhash instead of buildId for pages (#13937) 2020-06-11 10:57:24 +02:00
typescript Add type inference for getStaticProps and getServerSideProps (#11842) 2020-05-27 19:02:22 +00:00
typescript-baseurl Use the jest-circus test runner (#12974) 2020-05-16 16:56:06 -04:00
typescript-hmr Speedup tests (#13461) 2020-05-29 07:57:51 +00:00
typescript-ignore-errors Replace fork-ts-checker-webpack-plugin with faster alternative (#13529) 2020-05-29 08:16:22 +00:00
typescript-numeric-sep-exclusive Use the jest-circus test runner (#12974) 2020-05-16 16:56:06 -04:00
typescript-only-remove-type-imports Upgrade to Prettier 2 (#13061) 2020-05-18 15:24:37 -04:00
typescript-paths Add eslint-plugin-jest (#13003) 2020-05-18 13:16:07 -04:00
with-router Speedup tests (#13461) 2020-05-29 07:57:51 +00:00
test-file.txt Add additional file serving tests (#12479) 2020-05-04 11:58:19 -05:00