rsnext/test
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
..
.stats-app Remove remaining granular chunks references (#13672) 2020-06-02 14:45:07 +00:00
acceptance Use single webpack runtimeChunk for Node.js compilation (#14722) 2020-07-01 15:34:00 +00:00
eslint-plugin-next bug fixes for css eslint rule (#14202) 2020-06-15 23:42:36 +00:00
integration Re-enable scroll restoration behind flag (#14046) 2020-07-06 14:27:45 +00:00
isolated Fix pages/index.js and pages/index/index.js behavior (#13699) 2020-06-04 17:32:45 +00:00
lib Use single webpack runtimeChunk for Node.js compilation (#14722) 2020-07-01 15:34:00 +00:00
unit Add no-anon-default-export Babel lint rule (#14519) 2020-06-30 13:05:29 +00:00
.babelrc Use preset-react's development option + enable modules transform in test env (#5081) 2018-09-03 16:41:52 +02:00
.gitignore Universal Webpack (#3578) 2018-01-30 16:44:44 +01:00
jest-environment.js Upgrade to Prettier 2 (#13061) 2020-05-18 15:24:37 -04:00
jest-global-setup.js Upgrade to Prettier 2 (#13061) 2020-05-18 15:24:37 -04:00
jest-global-teardown.js Update CI/test set up (#9499) 2019-11-25 13:19:45 -05:00
jest-setup-after-env.js Only retry tests on CI (#12998) 2020-05-17 12:10:02 -04:00
test-file.txt Add additional file serving tests (#12479) 2020-05-04 11:58:19 -05:00
tsconfig.json Update tsconfig for tests 2020-01-21 15:29:39 -06:00