1. 21 6月, 2020 1 次提交
  2. 18 6月, 2020 1 次提交
  3. 15 6月, 2020 1 次提交
  4. 11 6月, 2020 1 次提交
  5. 10 6月, 2020 1 次提交
  6. 07 6月, 2020 1 次提交
  7. 05 6月, 2020 1 次提交
    • J
      Fix pages/index.js and pages/index/index.js behavior (#13699) · 1b36f0c0
      Jan Potoms 提交于
      Disambiguate between pages/index.js and pages/index/index.js so that they resolve differently.
      It all started with a bug in pagesmanifest that propagated throughout the codebase. After fixing pagesmanifest I was able to remove a few hacks here and there and more logic is shared now. especially the logic that resolves an entrypoint back into a route path. To sum up what happened:
      
      - `getRouteFromEntrypoint` is the inverse operation of `getPageFile` that's under `pages/_document.tsx`
      - `denormalizePagePath` is the inverse operation of `normalizePagePath`.
      
      Everything is refactored in terms of these operations, that makes their behavior uniform and easier to update/patch in a central place. Before there were subtle differences between those that made `index/index.js` hard to handle.
      
      Some potential follow up on this PR:
      - [`hot-reloader`](https://github.com/vercel/next.js/pull/13699/files#diff-6161346d2c5f4b7abc87059d8768c44bR207) still has one place that does very similar behavior to `getRouteFromEntrypoint`. It can probably be rewritten in terms of `getRouteFromEntrypoint`.
      - There are a few places where `denormalizePagePath(normalizePagePath(...))` is happening. This is a sign that `normalizePagePath` is doing some validation that is independent of its rewriting logic. That should probably be factored out in its own function. after that I should probably investigate whether `normalizePagePath` is even still needed at all.
      - a lot of code is doing `.replace(/\\/g, '')`. If wanted, that could be replaced with `normalizePathSep`.
      - It looks to me like some logic that's spread across the project can be centralized in 4 functions 
        - `getRouteFromEntrypoint` (part of this PR)
        - its inverse `getEntrypointFromRoute` (already exists in `_document.tsx` as `getPageFile`)
        - `getRouteFromPageFile` 
        - its inverse `getPageFileFromRoute` (already exists as `findPageFile ` in `server/lib/find-page-file.ts`)
      
        It could be beneficial to structure the code to keep these fuctionalities close together and name them similarly.
       - revise `index.amp` handling in pagesmanifest. I left it alone in this PR to keep it scoped, but it may be broken wrt nested index files as well. It might even make sense to reshape the pagesmanifest altogether to handle html/json/amp/... better
      1b36f0c0
  8. 03 6月, 2020 1 次提交
  9. 02 6月, 2020 3 次提交
    • J
      Propagate Serverless Errors to Platform (#12841) · 15cdb4f4
      Joe Haddad 提交于
      In serverless mode, it's best practice to propagate an unhandled error so that the function is disposed instead of recycled. This helps fix the "bad state" problem.
      15cdb4f4
    • T
      Added no-shadow rule to eslint (#13645) · b124ed2e
      Tim Neutkens 提交于
      Was going through _document and noticed some variable shadowing going on. Added a rule for it to our eslint configuration and went through all warnings with @Timer.
      b124ed2e
    • J
      make getStaticPaths work with optional catch-all routes (#13559) · 8bac4128
      Jan Potoms 提交于
      Fixes https://github.com/vercel/next.js/issues/13524
      
      To do:
      - [x] fix dev mode
      - [x] there's a ~route ordering or~ trailing slash issue with top level catch-all (current tests reflect that)
      - [x] in this test `/get-static-paths/whatever` should fall back to `/[[...optionalName]].js` since `fallback` is `false` in its `getStaticPaths` method. ~Currently seems to 500~ must have been a glitch
      - [x] add tests for `null`, `undefined` ~and `false`~ behavior as well (if decided these are valid)
      - [x] ~add tests for string params as well~ this is not allowed for catch-all routes
      - [x] test behavior when fallback is enabled and a top level catch-all exists
      8bac4128
  10. 01 6月, 2020 1 次提交
    • J
      Handle encoding for data requests and fix fallback response (#13622) · c0368e1b
      JJ Kasper 提交于
      This addresses some errors for `/_next/data` requests where encoded `/` values in dynamic route param would cause invalid behavior, a headers already sent error would be shown when sending the fallback page in development, and when rendering the `_error` page for a data request the error response would still be treated as a data request. 
      
      This also adds test cases for these errors to prevent regression
      c0368e1b
  11. 30 5月, 2020 1 次提交
  12. 28 5月, 2020 1 次提交
  13. 27 5月, 2020 2 次提交
  14. 26 5月, 2020 1 次提交
  15. 24 5月, 2020 1 次提交
  16. 20 5月, 2020 1 次提交
  17. 19 5月, 2020 3 次提交
  18. 18 5月, 2020 1 次提交
  19. 13 5月, 2020 1 次提交
  20. 06 5月, 2020 1 次提交
  21. 05 5月, 2020 1 次提交
  22. 01 5月, 2020 1 次提交
  23. 30 4月, 2020 1 次提交
  24. 28 4月, 2020 1 次提交
  25. 26 4月, 2020 1 次提交
  26. 21 4月, 2020 1 次提交
  27. 15 4月, 2020 1 次提交
  28. 14 4月, 2020 1 次提交
    • J
      Add basePath in link component and add/remove it consistently (#9988) · d3e308a7
      JJ Kasper 提交于
      * Add basePath in link component and add/remove it consistently
      
      * Update to not use regex for delBasePath
      
      * Expose addBasePath as router method
      
      * Revert "Expose addBasePath as router method"
      
      This reverts commit 40fed596195c6affabf837e42d472452768e13a3.
      
      * Expose basePath as router field
      
      * Apply suggestion
      
      * Expose basePath as router field
      
      * remove un-used vars
      
      * Update externals
      
      * Apply lint fix
      
      * Update size-limit test
      
      * Update prefetch
      d3e308a7
  29. 11 4月, 2020 1 次提交
  30. 07 4月, 2020 2 次提交
  31. 05 4月, 2020 1 次提交
  32. 31 3月, 2020 3 次提交