* Use intersection observer to preload
links that are in viewport
* Clean up names
* Check for window before returning observer
* update check for IntersectionObserver
* Remove duplicate IntersectionObserver checks
* Add test for prefetching links in viewport
* Remove loadGetInitialProps from _app and fix
cache-control header not being
* Update to still use loadGetInitialProps
in _app since it's simpler
* Add test for cache-control header with custom _app
* add local identifier to suppoort parallel runs BrowserStack
Signed-off-by: Nimit <nimitagg95@gmail.com>
* calling driver quit to stop test and then killing binary
Signed-off-by: Nimit <nimitagg95@gmail.com>
* run lint-fix
* standard fixes
Signed-off-by: Nimit <nimitagg95@gmail.com>
* Moved server/lib/utils.js to Typescript
* moved _app.js to Typescript
* Moved _error.js to Typescript
* Added argument for custom props in _app and _error
* Moved _document.js to Typescript
* updated one test
* Updated types and added a validation for _document props
* Improved types
* Fixed some types
* Updated AppType
* Fixed some tests
* Added missing import
* Removed a not very useful type
* Fix missing type
* Move @types/styled-jsx
* Fix typescript errors
* Add --no-subfolders argument to next export
* Use experimental.exportTrailingSlash instead of a cli flag
* Add experimental.exportTrailingSlash documentation
* Add tests for export with experimental.exportTrailingSlash
* Remove docs
* Remove comment
* Make styles compatible in AMP mode
* bump
* Update to parse styles from fragment for
backwards compat in AMP mode
* Add test for AMP styles fragment support
We also close the connection when the window is in the background and re-connect when it is brought to the foreground. This prevents us from using up too many connections.
This PR adds the `_error`-page as an `404.html`-export, even when it is not explicitly defined in a custom `exportPathMap`.
It also fixes two false negative tests related to this. Previously the tests were matching the fallback 404-page from the test-server, rather than the `404.html`-page from next, which was actually not being generated. The test server is also not set up to serve `/404.html` as `/404` which the tests now reflect.
**Caveat**
In its current state, this PR removes `/404.html` from the `defaultPathMap` passed to the custom `exportPathMap`-functions, since it instead adds it after that function is run. While it is possible that someone is relying on this to exist, it is to my knowledge undocumented and also unlikely to be used for anything but merging it into the custom pathMap.
Since this would now merge `undefined` which would result in it being added later on anyway, I deemed it safe, but would be happy to undo that part of the PR if necessary as it was only cleanup.
**Examples**
As a way to demonstrate what this PR does, this is how examples changed:
* `basic-export` - Behaviour is unchanged, still has a `404.html`
* `with-static-export` - Now has a `404.html`
if `&=1` is used to point to the `amphtml` version of a page it get's escaped causing it to become `&amp=1` this fixes it to stay as `&=1`
Closes: #7038
* Update amphtml and canonical rels, put amp behind
experimental flag again, and update checking for amp query
* Fix typescript error
* Re-add flag to next.config.js
* Make sure AmpContext is available during _document
render and update filtering of script tags in AMP mode
* Update amphtml test to make sure
AmpContext is set for _document render
* Fix stray comma in render.tsx
* Add WithAmp to enable AMP support for
pages instead of .amp.js
* Update handling for exporting AMP
* Fix ampPath in export for / path and
revert isAmp logic to handle right
* Update amphtml test suite
* Add handling for noDirtyAmp during
export and update amp-export test suite
* Update serverless and export-default-map
test suites
* Update require-page tests
* Add Flying Shuttle tests
* Test second version of server
* Finish first version of tests
* Apply suggestions from code review
Co-Authored-By: Timer <timer150@gmail.com>
* Apply suggestions from code review
Co-Authored-By: Timer <timer150@gmail.com>
* Remove CLI and negative page building
* Remove select all tests
* Update test of getSpecifiedPages
* Prune old tests from snapshot
* Remove old flying shuttle tests
* Fix re-rendering on client after navigating
back from external site
* Clean up tagging before unload
* Add check for history.state 1/2
Co-Authored-By: ijjk <22380829+ijjk@users.noreply.github.com>
* Add check for history.state 2/2
Co-Authored-By: ijjk <22380829+ijjk@users.noreply.github.com>
* Add check for options
Co-Authored-By: ijjk <22380829+ijjk@users.noreply.github.com>
* Add test for navigating to external site and back
also added testing in safari and firefox
* Add test for query in url
* Do not clear the console
Its rude to clear the console, you may be sharing output with other processes even in tty mode.
* Remove unused dependency
* Dedupe and cleanup dev output without clearing
* use logError
* Remove exit handler
* Add next helper
* Add log helpers
* Switch store to log helpers and a shallow object compare
* Update other files to use new logging utility
* request => build
* Update ready on messages
* Use case insensitive matching
* Add checking of react versions to make sure it
meets the minimum set in peerDependencies
* Simplify react check
* Update error wording
Co-Authored-By: timneutkens <tim@timneutkens.nl>
* Add err.sh
* Update test-production circleci job name
* Add react error message to next-dev-server
* Update test for new wording
* Add amp request header and check for amp
query in serverless mode
* Add serverless test for an AMP page
* Update to handle querystring weirdness
* Update serverless test config