- 21 11月, 2020 1 次提交
-
-
由 JJ Kasper 提交于
This updates the export progress to make sure we log out the final progress update when less pages than number of progress updates (segments). This also adds tests to ensure we are logging the progress out as expected. Fixes: https://github.com/vercel/next.js/issues/19122 Closes: https://github.com/vercel/next.js/pull/19123
-
- 19 11月, 2020 1 次提交
-
-
由 Joe Haddad 提交于
This PR removes the modern mode experiment because: - It does not yield meaningful bundle size wins when compared to other initiatives we've taken - It's not compatible with webpack 5 (which we're upgrading to) - It's currently broken and causes most apps to malfunction - There's no champion currently owning the experiment We can re-introduce this in the future when we'd like to make it a default for all Next.js apps. Note: **Next.js still supports Differential Loading (`nomodule`) and does it by default.** This PR strictly removes the experimental modern _syntax_, and does not disable our existing modern/legacy polyfilling. --- Fixes #19200 Fixes #18960 Fixes #14707 Fixes #14465
-
- 11 11月, 2020 1 次提交
-
-
由 Steven 提交于
Fixes #18356
-
- 06 11月, 2020 1 次提交
-
-
由 Guy Bedford 提交于
This upgrades to ncc@0.25.0 and fixes the previous bugs including: * ncc not referenced correctly in build * Babel type errors * node-fetch, etag, chalk and raw-body dependencies not building with ncc - these have been "un-ncc'd" for now. As they are relatively small dependencies, this doesn't seem too much of an issue and we can follow up in the tracking ncc issue at https://github.com/vercel/ncc/issues/612. * `yarn dev` issues Took a lot of bisecting, but the overall diff isn't too bad here in the end.
-
- 27 10月, 2020 1 次提交
-
-
由 Joe Haddad 提交于
-
- 16 10月, 2020 2 次提交
-
-
由 JJ Kasper 提交于
-
由 JJ Kasper 提交于
This adds the i18n config items to the routes-manifest so that they can accessed in the builder. This doesn't increment the routes-manifest version as existing value shapes haven't been modified and an additional non-breaking value is being added x-ref: https://github.com/vercel/next.js/pull/17370
-
- 08 10月, 2020 2 次提交
-
-
由 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.
-
由 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
-
- 05 10月, 2020 2 次提交
-
-
由 JJ Kasper 提交于
Follow-up to https://github.com/vercel/next.js/pull/17538 per https://github.com/vercel/next.js/pull/17538#discussion_r499647323 this updates the check to use the existing `hasNextSupport` export instead of checking the environment variable directly
-
由 JJ Kasper 提交于
This adds a warning when `next export` and custom routes are defined outside of a platform that supports them since they won't be applied anymore.
-
- 26 9月, 2020 1 次提交
-
-
由 JJ Kasper 提交于
* Expose dotenv loading under separate package * Update pre-compiled * Rename package to @next/env * Update lint ignores * Update package.json Co-authored-by: NJoe Haddad <joe.haddad@zeit.co>
-
- 22 9月, 2020 1 次提交
-
-
由 Yuji Sugiura 提交于
This PR fixes `info - undefined (N/N)` log for `export` cli. ![image](https://user-images.githubusercontent.com/6259812/93186247-5d801500-f779-11ea-89ec-e20939d7b7c1.png) Default parameter `label` for `createProgress()` was always ignored by `${Log.prefixes.info} undefined`
😅 .
-
- 07 9月, 2020 1 次提交
-
-
由 Tim Neutkens 提交于
-
- 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 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 1 次提交
-
-
由 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
-
- 28 7月, 2020 1 次提交
-
-
由 Prateek Bhatnagar 提交于
Co-authored-by: Natcastle <atcastle@gmail.com>
-
- 23 6月, 2020 1 次提交
-
-
由 Tim Neutkens 提交于
Gets rid of the custom function for naming files by removing buildId from the file paths.
-
- 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 提交于
-
- 10 6月, 2020 1 次提交
-
-
由 Joe Haddad 提交于
Fixes #13972
-
- 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
-
- 02 6月, 2020 1 次提交
-
-
由 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.
-
- 28 5月, 2020 1 次提交
-
-
由 Joe Haddad 提交于
-
- 27 5月, 2020 2 次提交
-
-
由 JJ Kasper 提交于
This makes sure we don't duplicate the `/` route or any others while exporting with `exportTrailingSlash` enabled. We do still output `404.html` with `exportTrailingSlash` enabled in case anyone was relying on this file being present. Fixes: https://github.com/zeit/next.js/issues/11008
-
由 Christian Stuff 提交于
Closes #9990 by collecting all paths with errors during `next export` and reporting them sorted in the error summary at the end. It will produce an output similar to: ``` Error: Export encountered errors on following paths: /nested/page /page /page-1 /page-10 /page-11 /page-12 /page-13 /page-2 /page-3 /page-4 /page-5 /page-6 /page-7 /page-8 /page-9 at _default (/app/next.js/packages/next/dist/export/index.js:19:788) at process._tickCallback (internal/process/next_tick.js:68:7) ``` I tested the output with the `handle-export-errors` integration test suite, but I'm not sure how to gracefully test this added output. I thought of collecting all page source files with [recursiveReaddirSync](https://github.com/zeit/next.js/blob/2ba352da39ee00b6595aecdc9ffb2f103e803a85/packages/next/next-server/server/lib/recursive-readdir-sync.ts) but it seems I can't import it in js test files: ``` SyntaxError: /app/next.js/packages/next/next-server/server/lib/recursive-readdir-sync.ts: Unexpected token, expected "," (11:5) 9 | */ 10 | export function recursiveReadDirSync( > 11 | dir: string, | ^ 12 | arr: string[] = [], 13 | rootDir = dir 14 | ): string[] { ``` The test itself could look like: ```js it('Reports failing paths', async () => { const { stderr } = await nextBuild(appDir, [], { stdout: true, stderr: true, }) const pages = [] // collect pages to be ['/page', '/page-1', ... etc.] pages.forEach(page => { expect(stderr).toContain(page) }) }) ```
-
- 26 5月, 2020 2 次提交
-
-
由 Jan Potoms 提交于
This is purely adding types except for the line: ```js params = getRouteMatcher(getRouteRegex(page))(path) || undefined ``` Also added a couple of `@ts-ignore` as to avoid having to make any more functional changes
-
由 Jan Potoms 提交于
Added a few extra types here and there while I was digging through the code
-
- 25 5月, 2020 1 次提交
-
-
由 Maxi Gimenez 提交于
-
- 21 5月, 2020 1 次提交
-
-
由 Lucio Villa 提交于
Fixes #13171
-
- 19 5月, 2020 2 次提交
-
-
由 JJ Kasper 提交于
-
由 Joe Haddad 提交于
-
- 02 5月, 2020 1 次提交
-
-
由 matamatanot 提交于
-
- 14 4月, 2020 1 次提交
-
-
由 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
-
- 31 3月, 2020 3 次提交
-
-
由 Tim Neutkens 提交于
* Remove req.env * Rename NEXT_APP_ to NEXT_PUBLIC_ * Remove key exposing env config * Update tests * Update NEXT_APP_ test to NEXT_PUBLIC_
-
由 Guy Bedford 提交于
-
由 Guy Bedford 提交于
-