- 20 8月, 2020 2 次提交
-
-
由 JJ Kasper 提交于
This fixes page checking failing due to the trailing slash being present which causes pages to proxied by a rewrite when they shouldn't be. This also adds additional tests to ensure rewriting to an external resource is working correctly with `trailingSlash: true` Fixes: https://github.com/vercel/next.js/issues/15700
-
由 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
-
- 19 8月, 2020 1 次提交
-
-
由 Alex Castle 提交于
Fixes a small error in the image preload post-processor. Adds a needed 'as' attribute to the link.
-
- 18 8月, 2020 3 次提交
-
-
由 Joe Haddad 提交于
Fixes #16260
-
由 Tim Neutkens 提交于
Don't use this yet as it's still being developed. This is a first iteration that enables the webpack cache. There's still more to do here, for example if css modules are used there's currently a bug where webpack does not save the cache for browser compilation (impacting build performance). @sokra is going to look into that issue.
-
由 Joe Haddad 提交于
This pull request adds a test case for the reproduction provided in #12445. This bug is specifically caused when loading the next page before navigation has actually occurred. --- Fixes #12445
-
- 17 8月, 2020 1 次提交
-
-
由 JJ Kasper 提交于
This fixes the incorrect `/_next/data` URL being generated on client transition due to the `as` value passed to `getRouteInfo` having the `basePath` which is used while interpolating the values for dynamic routes, specifically root catch-all routes. A regression test has also been added to ensure this is working Closes: https://github.com/vercel/next.js/issues/15747
-
- 15 8月, 2020 1 次提交
-
-
由 JJ Kasper 提交于
This updates to not automatically append params to the query for rewrites if one or more of the params are already used in the destination's path. No other behavior is being changed and if the user still wants the params in the query after using them in the destination's path they can manually add them like with redirects. Closes: https://github.com/vercel/next.js/issues/15626
-
- 14 8月, 2020 4 次提交
-
-
由 Joe Haddad 提交于
Instead of reading the `BuildManifest` and passing it to `/_document`, it should be able to read it for itself. --- Fixes #16182
-
由 Joe Haddad 提交于
This pull request edits the `BuildManifest` that is sent to `/_document` instead of modifying a single input array to decouple its implementation details. Optimally, we'd eliminate the `files` key all together. --- Related to #16182
-
由 Joe Haddad 提交于
-
由 Joe Haddad 提交于
Fixes #16166
-
- 13 8月, 2020 4 次提交
-
-
由 Joe Haddad 提交于
This reduces the code as suggested: https://github.com/vercel/next.js/pull/15231#discussion_r469691649. Removes these bloated Babel helpers: ```diff @@ -678,80 +678,6 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI var _createClass = __webpack_require__("W8MJ"); - function _createForOfIteratorHelper(o, allowArrayLike) { - var it; - if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { - if ( - Array.isArray(o) || - (it = _unsupportedIterableToArray(o)) || - (allowArrayLike && o && typeof o.length === "number") - ) { - if (it) o = it; - var i = 0; - var F = function F() {}; - return { - s: F, - n: function n() { - if (i >= o.length) return { done: true }; - return { done: false, value: o[i++] }; - }, - e: function e(_e) { - throw _e; - }, - f: F - }; - } - throw new TypeError( - "Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method." - ); - } - var normalCompletion = true, - didErr = false, - err; - return { - s: function s() { - it = o[Symbol.iterator](); - }, - n: function n() { - var step = it.next(); - normalCompletion = step.done; - return step; - }, - e: function e(_e2) { - didErr = true; - err = _e2; - }, - f: function f() { - try { - if (!normalCompletion && it["return"] != null) it["return"](); - } finally { - if (didErr) throw err; - } - } - }; - } - - function _unsupportedIterableToArray(o, minLen) { - if (!o) return; - if (typeof o === "string") return _arrayLikeToArray(o, minLen); - var n = Object.prototype.toString.call(o).slice(8, -1); - if (n === "Object" && o.constructor) n = o.constructor.name; - if (n === "Map" || n === "Set") return Array.from(o); - if ( - n === "Arguments" || - /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) - ) - return _arrayLikeToArray(o, minLen); - } - - function _arrayLikeToArray(arr, len) { - if (len == null || len > arr.length) len = arr.length; - for (var i = 0, arr2 = new Array(len); i < len; i++) { - arr2[i] = arr[i]; - } - return arr2; - } - exports.__esModule = true; exports.hasBasePath = hasBasePath; exports.addBasePath = addBasePath; @@ -1864,28 +1790,16 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI } // handle resolving href for dynamic routes if (!pages.includes(cleanPathname)) { - var _iterator = _createForOfIteratorHelper(pages), - _step; - - try { - for (_iterator.s(); !(_step = _iterator.n()).done; ) { - var page = _step.value; - - if ( - (0, _isDynamic.isDynamicRoute)(page) && - (0, _routeRegex.getRouteRegex)(page).re.test( - cleanPathname - ) - ) { - parsedHref.pathname = addBasePath(page); - break; - } + // eslint-disable-next-line array-callback-return + pages.some(function(page) { + if ( + (0, _isDynamic.isDynamicRoute)(page) && + (0, _routeRegex.getRouteRegex)(page).re.test(cleanPathname) + ) { + parsedHref.pathname = addBasePath(page); + return true; } - } catch (err) { - _iterator.e(err); - } finally { - _iterator.f(); - } + }); } return parsedHref; @@ -2069,10 +1983,9 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI } if (cancelled) { - var _err = new Error("Loading initial props cancelled"); - - _err.cancelled = true; - throw _err; + var err = new Error("Loading initial props cancelled"); + err.cancelled = true; + throw err; } return data; ```
-
由 JJ Kasper 提交于
Co-authored-by: NTim Neutkens <timneutkens@me.com>
-
由 Joe Haddad 提交于
This PR removes a legacy router method that was used for old-style HMR, now replaced by Fast Refresh. This method was not public: ```tsx export type NextRouter = BaseRouter & Pick< Router, | 'push' | 'replace' | 'reload' | 'back' | 'prefetch' | 'beforePopState' | 'events' | 'isFallback' > ``` Even if someone found this method, it's highly unlikely they could use it successfully—it required the full module object.
-
由 Joe Haddad 提交于
This PR dedupes the `ComponentRes` type to now align with the `loadPage` return type.
-
- 12 8月, 2020 1 次提交
-
-
由 Tim Neutkens 提交于
We no longer use tslint so these comments don't do anything.
-
- 11 8月, 2020 2 次提交
-
-
由 Prateek Bhatnagar 提交于
Co-authored-by: NTim Neutkens <tim@timneutkens.nl> Co-authored-by: NJoe Haddad <joe.haddad@zeit.co>
-
由 Joe Haddad 提交于
-
- 10 8月, 2020 1 次提交
-
-
由 Tim Neutkens 提交于
-
- 08 8月, 2020 2 次提交
-
-
由 Amirali Esmaeili 提交于
Co-authored-by: Nkodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
-
由 Prateek Bhatnagar 提交于
Bug fix - Do not remove spaces as it might mangle font names
-
- 07 8月, 2020 3 次提交
-
-
由 Markoz Peña 提交于
## Which solves this PR Displaying a friendly error, when the user is only passing `statusOrUrl`(type number) and the second argument `url` is ignored. **Example** `res.redirect(307);` // Show friendly error Closes: https://github.com/vercel/next.js/issues/15594 x-ref: https://github.com/vercel/next.js/pull/15603
-
由 Tom Dohnal 提交于
This resolves https://github.com/vercel/next.js/issues/13659
-
由 Jan Potoms 提交于
-
- 06 8月, 2020 2 次提交
-
-
由 Jan Potoms 提交于
Fixes https://github.com/vercel/next.js/issues/15639 Fixes https://github.com/vercel/next.js/issues/15820 To Do: - [x] Doesn't work with `basePath` yet
-
由 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 2 次提交
-
-
由 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
-
由 Jonathan G 提交于
Co-authored-by: NTim Neutkens <timneutkens@me.com> Co-authored-by: NJJ Kasper <jj@jjsweb.site>
-
- 03 8月, 2020 2 次提交
-
-
由 Tim Neutkens 提交于
Same as #15483 but couldn't push to it --- Closes #15483 Fixes #15828
-
由 Jan Potoms 提交于
In terms of url rewriting, `trailingSlash` supports everything `exportTrailingSlash` does. We can just share all other code paths and deprecate `exportTrailingSlash`. This PR shows a deprecation warning when `exportTrailingSlash` is used. Also fixes https://github.com/vercel/next.js/issues/15774 We can update the tests now or later. (I kept them the same to prove it's non-breaking) To do: - [x] Do we want to keep this? => nope https://github.com/vercel/next.js/blob/841d4efc517a379d8947f491e3c6a1c4784bbccf/packages/next/next-server/lib/router/router.ts#L329 - [x] I kept `exportTrailingSlash` here. Do we want to rename that as well? => nope https://github.com/vercel/next.js/blob/2d9d649d492b77adeddea0242ab6b7fe73d18079/packages/next/build/index.ts#L959
-
- 02 8月, 2020 1 次提交
-
-
由 Jan Potoms 提交于
-
- 01 8月, 2020 2 次提交
-
-
-
由 Jan Potoms 提交于
Irrelevant since https://github.com/vercel/next.js/pull/15379
-
- 29 7月, 2020 3 次提交
-
-
由 JJ Kasper 提交于
This updates collecting dynamic route params on Vercel to make sure that missing optional dynamic routes are undefined. Additional tests for this mode have also been added to ensure the params are being collected properly Closes: https://github.com/vercel/next.js/issues/15579
-
由 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
-
由 Robert van Steen 提交于
-
- 28 7月, 2020 3 次提交
-
-
由 Prateek Bhatnagar 提交于
Co-authored-by: Natcastle <atcastle@gmail.com>
-
由 Jan Potoms 提交于
Co-authored-by: Nkodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
-
由 Gerald Monaco 提交于
-