1. 22 10月, 2020 1 次提交
    • J
      Update fallback 404 handling to prevent reload loop (#18119) · 81e667bf
      JJ Kasper 提交于
      This updates the fallback 404 handling to render the correct 404 page on the client when a 404 is returned from fetching the data route on a fallback page on the client. This prevents us from having to rely on a cache to be updated by the time we reload the page to prevent non-stop reloading. 
      
      This also adds handling in serverless mode to ensure the correct 404 page is rendered when leveraging fallback: 'blocking' mode. 
      
      Additional tests for the fallback: 'blocking' 404 handling will be added in a follow-up where returning notFound from `getServerSideProps` is also added. 
      81e667bf
  2. 21 10月, 2020 1 次提交
  3. 20 10月, 2020 1 次提交
    • J
      Ensure correct default locale is detected for domain locale (#18046) · 8be3562c
      JJ Kasper 提交于
      This makes sure that we detect the correct default locale for domain specific locales since a domain can have a different default locale residing at the root and we need to check this on the client for prerendered/auto-static pages. This also makes sure we disable the built-in redirect handling when on Vercel since it's handled already. 
      
      Tests for this are tricky since we need to load the browser with a custom domain which requires editing the host file. Existing tests should ensure this doesn't break non-domain specific locale behavior though. This was also tested manually while testing https://github.com/vercel/vercel/pull/5298
      
      
      
      x-ref: https://github.com/vercel/next.js/pull/17370
      8be3562c
  4. 16 10月, 2020 2 次提交
  5. 15 10月, 2020 2 次提交
  6. 14 10月, 2020 3 次提交
  7. 12 10月, 2020 1 次提交
  8. 10 10月, 2020 1 次提交
    • J
      Add handling for domain to locale mapping (#17771) · 5cab03fe
      JJ Kasper 提交于
      Follow-up to https://github.com/vercel/next.js/pull/17370 this adds mapping of locales to domains and handles default locales for specific domains also allowing specifying which locales can be visited for each domain. 
      
      This PR also updates to output all statically generated pages under the locale prefix to make it easier to locate/lookup and to not redirect to the default locale prefixed path when no `accept-language` header is provided. 
      5cab03fe
  9. 09 10月, 2020 1 次提交
  10. 08 10月, 2020 2 次提交
    • J
      Update to have default locale matched on root (#17669) · bbc1a21c
      JJ Kasper 提交于
      Follow-up PR to https://github.com/vercel/next.js/pull/17370 when the path is not prefixed with a locale and the default locale is the detected locale it doesn't redirect to locale prefixed variant. If the default locale path is visited and the default locale is visited this also redirects to the root removing the un-necessary locale in the URL. 
      
      This also exposes the `defaultLocale` on the router since the RFC mentions `Setting a defaultLocale is required in every i18n library so it'd be useful for Next.js to provide it to the application.` although doesn't explicitly spec where we want to expose it. If we want to expose it differently this can be updated. 
      bbc1a21c
    • J
      Add initial changes for i18n support (#17370) · b2d1d87e
      JJ Kasper 提交于
      This adds the initial changes outlined in the [i18n routing RFC](https://github.com/vercel/next.js/discussions/17078). This currently treats the locale prefix on routes similar to how the basePath is treated in that the config doesn't require any changes to your pages directory and is automatically stripped/added based on the detected locale that should be used. 
      
      Currently redirecting occurs on the `/` route if a locale is detected regardless of if an optional catch-all route would match the `/` route or not we may want to investigate whether we want to disable this redirection automatically if an `/index.js` file isn't present at root of the pages directory. 
      
      TODO: 
      
      - [x] ensure locale detection/populating works in serverless mode correctly
      - [x] add tests for locale handling in different modes, fallback/getStaticProps/getServerSideProps
      
      To be continued in fall-up PRs
      
      - [ ] add tests for revalidate, auto-export, basePath + i18n
      - [ ] add mapping of domains with locales
      - [ ] investigate detecting locale against non-index routes and populating the locale in a cookie
      
      x-ref: https://github.com/vercel/next.js/issues/17110
      b2d1d87e
  11. 05 10月, 2020 1 次提交
  12. 26 9月, 2020 1 次提交
  13. 16 9月, 2020 1 次提交
  14. 15 9月, 2020 2 次提交
  15. 23 8月, 2020 1 次提交
  16. 22 8月, 2020 2 次提交
  17. 19 8月, 2020 1 次提交
  18. 15 8月, 2020 1 次提交
  19. 13 8月, 2020 1 次提交
  20. 07 8月, 2020 1 次提交
  21. 06 8月, 2020 1 次提交
  22. 04 8月, 2020 1 次提交
  23. 29 7月, 2020 1 次提交
  24. 28 7月, 2020 2 次提交
  25. 15 7月, 2020 1 次提交
  26. 13 7月, 2020 1 次提交
  27. 07 7月, 2020 1 次提交
    • J
      Fix basepath browser back/forward issue (#14861) · 3623d444
      Jan Potoms 提交于
      Discovered while working on https://github.com/vercel/next.js/pull/14848
      
      when asPath is the same but href is different it should use `replaceState` instead of `pushState`, so that browser back/forward behavior is preserved. Currently it's comparing a path that includes basepath with one that excludes  it, so `pushState` is always used. This makes sure the behavior is the same as when running next.js without a basepath
      3623d444
  28. 01 7月, 2020 2 次提交
  29. 23 6月, 2020 1 次提交
  30. 11 6月, 2020 1 次提交
  31. 02 6月, 2020 1 次提交