* 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`
- Use the new [@react.component] decorator for all of the react
components and bindings.
- Use the new react hook integrations for the counter component.
- Add a `npm run dev:reason` and `npm run dev:next` commands to make
running the build processes in separate terminals easier. I didn't
update the README because I'm unsure if this is something that would
be desired.
- upgrade to reason react 0.7.0
- upgrade to react and react-dom 16.8.6
- upgrade to bs-platform 5.0.3
- upgrade to @babel/core 7.4.3
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
* Remove client bundles for AMP pages
after build since they are not used
* Remove trailing white space
* Use async-sema to limit removing AMP client bundles
* Bring AMP client bundle removing
semaphore concurrency down to 20
* Don't check blocked pages when
deleting AMP client bundles
* Update client bundle removing for AMP pages
* Add error handling for removing client AMP pages
* rethrow error unless ENOENT during
deleting AMP client pages
* Handle error during removing AMP client
pages the same during dev
* Fix throwing instead of rejecting
* Make sure next/config is set before requiring page
* Update error check
* return on reject
* Fix next/config
* 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
Not sure when it was introduced, but on the latest Next v8.0.4, there's no descriptive name attached to the component returns from `withRouter`.
This makes it harder to debug and write test cases for components wrapped by `withRouter`.
* Only refresh the page when the active
page is updated in AMP mode
* Update handling of page reload to make sure it
still refreshes after a change to another page
* Update checking to be more accurate
* Fix amp-dev not being loaded without
experimental.amp and remove next.config from amp example
* Remove old with-amp example and
rename experimental-amp to with-amp
* update example name
Co-Authored-By: ijjk <jj@jjsweb.site>
* Update comment wording
Co-Authored-By: ijjk <jj@jjsweb.site>
* Use document for reload to keep scroll position
Co-Authored-By: ijjk <jj@jjsweb.site>
* fallback to reloading on error
Co-Authored-By: ijjk <jj@jjsweb.site>
* Update with-amp example readme
* 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