This refactors the `handleSlug` method in preparation for catch-all routing.
This PR is opened separately so the catch-all diff can be reviewed easier.
* Fix redirect logic for unauthenticated flows
* check for lack of existence of window for server code
Co-Authored-By: Luis Alvarez D. <luis@zeit.co>
* remove comment
Co-Authored-By: Luis Alvarez D. <luis@zeit.co>
* remove comment
Co-Authored-By: Luis Alvarez D. <luis@zeit.co>
* Initialize Git repo on app creation
This PR initializes a Git repository after Create Next App runs.
We ensure the app was not created in an already-existing Git or Mercurial repo.
Failures of setup (no Git installed) do not fail the application bootstrapping.
Closes#9077 (replaces)
* Add test
* Update index.test.js
* Add AMP First example
The sample demonstrates how to build an AMP First Site with AMP. If
follows all the best-practices recommended by Lighthouse and will
result in a fully-qualified PWA.
Live demo of the page: https://my-next-app.sebastianbenz.now.sh/#development=1
* small improvements to AmpScript and AmpState
* remove gitignore
* Update example
* Move styles down in Layout
* Apply lint fix and tweak prop-types
* Add warning for host header usage
* Test custom-routes serverless
* Make sure we add default statusCode to routes-manifest
* Update routes-manifest
* Add DEFAULT_REDIRECT_STATUS constant
* Convert wrapper class to function component
* Remove unneeded export
* Check versions of chrome and chromedriver
* Update to chromedriver 76
* Revert config.yml
* Update with-router.tsx
* add initial custom-routes handling
* Add tests for custom-routes
* Handle chained redirects, separate dev custom
routes reading, and add version to routes manifest
* Handle no routes manifest
* Swap build custom routes calling
* Add flatten-routes
* Add flattening of custom routes
* Re-work implementation to follow routes top-down
* Add regex field to routes-manifest
* Fix path-to-regexp match breaking after upgrade
* Fix duplicate const from merge
* Add some changes from review
* Don't make path-match strict
* add default custom route values
* Update routes-manifest
* Update options for path-match
* Remove todo
* Add test for rewrite with params
* Only use strict mode for custom routes
* Update dynamic-routing test
* Move getCustomRoutes to prepare
* Remove extra change
* Update handling for error-in-error test
* Apply suggestions from code review
Co-Authored-By: Joe Haddad <joe.haddad@zeit.co>
* Apply suggestions from review
* Update slice change
* Apply suggestions from code review
Co-Authored-By: Joe Haddad <joe.haddad@zeit.co>
* Apply suggestions from review
* Fix TypeScript error
* Fix getCustomRoutes in dev mode
* Apply suggestions from code review
* Update slice
* Apply suggestions from code review
Co-Authored-By: Joe Haddad <joe.haddad@zeit.co>
* Delete un-used test page
* Add test for param overwriting
* Apply suggestions from code review
Co-Authored-By: Joe Haddad <joe.haddad@zeit.co>
* Add extra check to param test
As long as node does not ship with fill-icu this will do the trick making FormattedRelativeTime work on nodejs.
Other polyfill like @formatjs/intl-relativetimeformat/polyfill did not work on nodejs and thus giving an error that client did not match server.