* Added babel typescript for the core files
* Add __NEXT_VERSION
* Added noop.js to the babel taskfile
* Only include dynamic-import-node for the bin task
* Added babel-plugin-dynamic-import-node
* Use loose option to prevent Object.defineProperty
* Enable loose in preset and enable compact mode
* Disable compact and loose to compare
* Re-enable compact and loose
* 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`
- 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