- 20 8月, 2020 1 次提交
-
-
由 JJ Kasper 提交于
This corrects the basePath being required check for filesystem routes to not consider the public folder catch-all route since it always matches even if the public file isn't present and instead moves the basePath check inside of the public-folder catch-all. Tests already exist that catch this by adding a public folder to the existing `basepath` test suite Fixes: https://github.com/vercel/next.js/issues/16332 Closes: https://github.com/vercel/next.js/pull/16350
-
- 13 8月, 2020 1 次提交
-
-
由 JJ Kasper 提交于
Co-authored-by: NTim Neutkens <timneutkens@me.com>
-
- 12 8月, 2020 1 次提交
-
-
由 Tim Neutkens 提交于
We no longer use tslint so these comments don't do anything.
-
- 11 8月, 2020 1 次提交
-
-
由 Prateek Bhatnagar 提交于
Co-authored-by: NTim Neutkens <tim@timneutkens.nl> Co-authored-by: NJoe Haddad <joe.haddad@zeit.co>
-
- 06 8月, 2020 1 次提交
-
-
由 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.
-
- 04 8月, 2020 1 次提交
-
-
由 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
-
- 29 7月, 2020 1 次提交
-
-
由 JJ Kasper 提交于
Instead of trying to parse header values as URLs and then replace path segments in them this switches to escaping characters that can break `path-to-regexp` compiling Fixes: https://github.com/vercel/next.js/issues/15580 x-ref: https://github.com/vercel/vercel/pull/4942
-
- 28 7月, 2020 2 次提交
-
-
由 Prateek Bhatnagar 提交于
Co-authored-by: Natcastle <atcastle@gmail.com>
-
由 Gerald Monaco 提交于
-
- 13 7月, 2020 1 次提交
-
-
由 JJ Kasper 提交于
This adds handling for custom-routes with `basePath` to automatically add the `basePath` for custom-routes `source` and `destination` unless `basePath: false` is set for the route. Closes: https://github.com/vercel/next.js/issues/14782
-
- 01 7月, 2020 1 次提交
-
-
由 Tim Neutkens 提交于
Fixes #11711 Also cleaned up some extra code. This was already supported on the Vercel edge network.
-
- 30 6月, 2020 1 次提交
-
-
由 Jan Potoms 提交于
* avoid pulling code in the bundle for `trailingSlash` logic when it's not enabled * avoid cloning the url an extra time if normalizing the path doesn't change it
-
- 29 6月, 2020 1 次提交
-
-
由 Tim Neutkens 提交于
We've been meaning to change this code for a while
👍 - Changed the name from spr to incremental - Changed the code to be a class instead of using module scope variables
-
- 23 6月, 2020 3 次提交
-
-
由 Jan Potoms 提交于
Co-authored-by: NJoe Haddad <joe.haddad@zeit.co> Co-authored-by: NTim Neutkens <timneutkens@me.com>
-
由 Jan Potoms 提交于
Noticed this while reviewing https://github.com/vercel/next.js/pull/14376. After having done https://github.com/vercel/next.js/pull/13699, this code didn't feel right to me: ```js function prepareRoute(path: string) { path = delBasePath(path || '') // this /index rewrite is problematic, it makes pages/index.js // and pages/index/index.js point to the same thing: return toRoute(!path || path === '/' ? '/index' : path) } ``` Added a nested index page to the prerender tests and found it was rendering the `/` route on navigation. This uncovered 2 more places around the dataroute where the index path was not translated correctly. **edit:** Just to note that there was nothing wrong with https://github.com/vercel/next.js/pull/14376, the issue was already there, I just noticed it while reading that PR
-
由 Tim Neutkens 提交于
Gets rid of the custom function for naming files by removing buildId from the file paths.
-
- 21 6月, 2020 1 次提交
-
-
由 Tim Neutkens 提交于
Updates the way filenames are generated for browser compilation. Notably: - All entry bundles now have hashes in production, this includes pages (previously pages used a buildId in the path) - The AmpFiles no longer depends on hardcoded bundle names, it uses the buildManifest instead (internals) - All cases where we match the page name from the chunk/entrypoint name now use the same function `getRouteFromEntrypoint` (internals) - In development we no longer include the "faked" `buildId` set to `development` for page files, instead we just use the `/_next/static/pages` path (was `/_next/static/development/pages`). This was changed as it caused unneeded complexity and makes generating the bundles easier (internals) - Updated tons of tests to be more resilient to these changes by relying on the buildManifest instead of hardcoded paths (internals) Follow up of these PRs: https://github.com/vercel/next.js/pull/13759 https://github.com/vercel/next.js/pull/13870 https://github.com/vercel/next.js/pull/13937 https://github.com/vercel/next.js/pull/14130 https://github.com/vercel/next.js/pull/14176 https://github.com/vercel/next.js/pull/14268 Fixes #6303 Fixes #12087 Fixes #1948 Fixes #4368 Fixes #4255 Fixes #2548
-
- 18 6月, 2020 1 次提交
-
-
由 JJ Kasper 提交于
This moves the experimental `basePath` config out of the `experimental` section to prepare it for being stable
-
- 15 6月, 2020 1 次提交
-
-
由 Tim Neutkens 提交于
-
- 11 6月, 2020 1 次提交
-
-
由 Tim Neutkens 提交于
Co-authored-by: NJJ Kasper <jj@jjsweb.site> Co-authored-by: Nkodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
-
- 10 6月, 2020 1 次提交
-
-
由 Jan Potoms 提交于
Extracted from https://github.com/vercel/next.js/pull/13333, the same exact code lives in that PR as well, but we can merge this separately if it makes reviewing https://github.com/vercel/next.js/pull/13333 easier This PR does 3 things - deduplicate code from build and next-dev-server that loads custom routes from next.config.js (`loadCustomRoutes`) - in `loadCustomRoutes`, load these rewrites, headers and redirects configs concurrently instead of sequentially. - in next-server, make `this.customRoutes` always defined, this allows us to remove the big `if` around its initialization code in `generateRoutes`, which in turn makes it possible to reuse this code for other routing than user defined routes, which is how https://github.com/vercel/next.js/pull/13333 adds its redirects.
-
- 07 6月, 2020 1 次提交
-
-
由 Tim Neutkens 提交于
Went through and removed a bunch of internal options which are just pass-through values of buildManifest Closes #13851
-
- 05 6月, 2020 1 次提交
-
-
由 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
-
- 03 6月, 2020 1 次提交
-
-
由 Tim Neutkens 提交于
Co-authored-by: NJoe Haddad <joe.haddad@zeit.co>
-
- 02 6月, 2020 3 次提交
-
-
由 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.
-
由 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.
-
由 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
-
- 01 6月, 2020 1 次提交
-
-
由 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
-
- 30 5月, 2020 1 次提交
-
-
由 JJ Kasper 提交于
Since non-fallback pages don't rely on the URL for hydration we can allow them to be rewritten to but pages with fallback still can't be rewritten to because we won't be able to parse the correct `/_next/data` path to request the page's data from. I added a test for this behavior and ensured it works correctly on Now. Example on with fallback false rewrite on Now: https://tst-rewrite-cp9vge4bg.now.sh/about
-
- 28 5月, 2020 1 次提交
-
-
由 Joe Haddad 提交于
-
- 27 5月, 2020 2 次提交
-
-
由 Maxi Gimenez 提交于
-
-
- 26 5月, 2020 1 次提交
-
-
由 Jan Potoms 提交于
Added a few extra types here and there while I was digging through the code
-
- 24 5月, 2020 1 次提交
-
-
由 JJ Kasper 提交于
This continues https://github.com/zeit/next.js/pull/12501 and resolves the merge conflicts since we aren't able to update that branch and would like to land this change Closes: https://github.com/zeit/next.js/pull/12501
-
- 20 5月, 2020 1 次提交
-
-
由 Jan Potoms 提交于
Failing test case for https://github.com/zeit/next.js/issues/10488#issuecomment-584500081 This used to give a 500 in dev environment
-
- 19 5月, 2020 3 次提交
-
-
由 Slawek Kolodziej 提交于
-
由 Joe Haddad 提交于
-
由 JJ Kasper 提交于
-
- 18 5月, 2020 1 次提交
-
-
由 Jan Potoms 提交于
-
- 13 5月, 2020 1 次提交
-
-
由 Tim Neutkens 提交于
-