1. 20 8月, 2020 1 次提交
  2. 13 8月, 2020 1 次提交
  3. 12 8月, 2020 1 次提交
  4. 11 8月, 2020 1 次提交
  5. 06 8月, 2020 1 次提交
    • A
      Add experimental image post-processing (#15875) · b6060fa4
      Alex Castle 提交于
      This PR adds a second experimental post-processing step for the framework introduced by @prateekbh in #14746. The image post-processing step scans the rendered document for the first few images and uses a simple heuristic to determine if the images should be automatically preloaded.
      
      Analysis of quite a few production Next apps has shown that a lot of sites are taking a substantial hit to their [LCP](https://web.dev/lcp/) score because an image that's part of the "hero" element on the page is not preloaded and is getting downloaded with lower priority than the JavaScript bundles. This post-processor should automatically fix that for a lot of sites, without causing any real performance effects in cases where it fails to identify the hero image.
      
      This feature is behind an experimental flag, and will be subject to quite a bit of experimentation and tweaking before it's ready to be made a default setting.
      b6060fa4
  6. 04 8月, 2020 1 次提交
    • J
      Add support for `fallback: 'blocking'` (#15672) · e8183899
      Joe Haddad 提交于
      By popular request, this pull request adds support for returning `fallback: 'blocking'` from `getStaticPaths`.
      
      This new mode will cause unknown paths to be rendered on-demand ("SSR") without the static (placeholder) fallback.
      
      This feature is **currently experimental and should not be used in production yet**. It's currently flagged behind `unstable_`:
      
      ```
      fallback: 'unstable_blocking'
      ```
      
      TODO:
      
      - [x] Next.js tests
      - [ ] Add Vercel support
      - [ ] Vercel tests
      
      ---
      
      Fixes #15637
      e8183899
  7. 29 7月, 2020 1 次提交
  8. 28 7月, 2020 2 次提交
  9. 13 7月, 2020 1 次提交
  10. 01 7月, 2020 1 次提交
  11. 30 6月, 2020 1 次提交
  12. 29 6月, 2020 1 次提交
  13. 23 6月, 2020 3 次提交
  14. 21 6月, 2020 1 次提交
  15. 18 6月, 2020 1 次提交
  16. 15 6月, 2020 1 次提交
  17. 11 6月, 2020 1 次提交
  18. 10 6月, 2020 1 次提交
  19. 07 6月, 2020 1 次提交
  20. 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
  21. 03 6月, 2020 1 次提交
  22. 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
  23. 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
  24. 30 5月, 2020 1 次提交
  25. 28 5月, 2020 1 次提交
  26. 27 5月, 2020 2 次提交
  27. 26 5月, 2020 1 次提交
  28. 24 5月, 2020 1 次提交
  29. 20 5月, 2020 1 次提交
  30. 19 5月, 2020 3 次提交
  31. 18 5月, 2020 1 次提交
  32. 13 5月, 2020 1 次提交