rsnext/packages/next/package.json

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

324 lines
9.4 KiB
JSON
Raw Normal View History

{
"name": "next",
2024-01-27 00:22:18 +01:00
"version": "14.1.1-canary.15",
2019-01-21 13:46:01 +01:00
"description": "The React Framework",
"main": "./dist/server/next.js",
"license": "MIT",
"repository": "vercel/next.js",
"bugs": "https://github.com/vercel/next.js/issues",
2018-10-01 01:34:54 +02:00
"homepage": "https://nextjs.org",
"types": "index.d.ts",
"files": [
"dist",
"app.js",
"app.d.ts",
"babel.js",
"babel.d.ts",
"client.js",
"client.d.ts",
"compat",
"cache.js",
"cache.d.ts",
"config.js",
"config.d.ts",
"constants.js",
"constants.d.ts",
"document.js",
"document.d.ts",
"dynamic.js",
"dynamic.d.ts",
"error.js",
"error.d.ts",
"future",
"legacy",
"script.js",
"script.d.ts",
"server.js",
"server.d.ts",
"head.js",
"head.d.ts",
"image.js",
"image.d.ts",
"link.js",
"link.d.ts",
"router.js",
"router.d.ts",
"jest.js",
"jest.d.ts",
"amp.js",
"amp.d.ts",
"og.js",
"og.d.ts",
"index.d.ts",
"types/index.d.ts",
"types/global.d.ts",
"types/compiled.d.ts",
"image-types/global.d.ts",
"navigation-types/navigation.d.ts",
"navigation-types/compat/navigation.d.ts",
"font",
"navigation.js",
"navigation.d.ts",
"headers.js",
"headers.d.ts",
"navigation-types",
"web-vitals.js",
"web-vitals.d.ts",
"experimental/testmode/playwright.js",
"experimental/testmode/playwright.d.ts",
"experimental/testmode/playwright/msw.js",
"experimental/testmode/playwright/msw.d.ts",
"experimental/testmode/proxy.js",
"experimental/testmode/proxy.d.ts"
],
"bin": {
"next": "./dist/bin/next"
},
"scripts": {
"dev": "taskr",
"release": "taskr release",
"build": "pnpm release",
"prepublishOnly": "cd ../../ && turbo run build",
"types": "tsc --declaration --emitDeclarationOnly --stripInternal --declarationDir dist",
"typescript": "tsec --noEmit",
"ncc-compiled": "ncc cache clean && taskr ncc"
},
"taskr": {
"requires": [
"./taskfile-webpack.js",
"./taskfile-ncc.js",
"./taskfile-swc.js",
"./taskfile-watch.js"
]
},
"dependencies": {
2024-01-27 00:22:18 +01:00
"@next/env": "14.1.1-canary.15",
"@swc/helpers": "0.5.2",
"busboy": "1.6.0",
"caniuse-lite": "^1.0.30001579",
"graceful-fs": "^4.2.11",
"postcss": "8.4.31",
"styled-jsx": "5.1.1"
},
"peerDependencies": {
"@opentelemetry/api": "^1.1.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
2023-02-22 16:15:07 +01:00
"sass": "^1.3.0"
},
"peerDependenciesMeta": {
"sass": {
"optional": true
},
feat: add OTEL instrumentation for next-server + OTEL example (#46198) fixes NEXT-479 ## content This PR adds a `getTracer` API to Next.js that uses the `otel/api` under the hood to provide Next.js level instrumentation through Open Telemetry. This also adds an example `with-opentelemetry` to demonstrate how it can be used, assuming you have a collector. This allows most notably to have `getServerSideProps` and `fetch` calls inside Server Components traced. ## details - we hide most internals spans, if you want to see all of them, use the NEXT_OTEL_VERBOSE=1 env var - if you want to use this, you'll need to rely on the `config.experimental.instrumentationHook` config option to initialise OTEL, like in the example ## Bug - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Errors have a helpful link attached, see [`contributing.md`](https://github.com/vercel/next.js/blob/canary/contributing.md) ## Feature - [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. - [ ] Related issues linked using `fixes #number` - [ ] [e2e](https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs) tests added - [ ] Documentation added - [ ] Telemetry added. In case of a feature if it's used or not. - [ ] Errors have a helpful link attached, see [`contributing.md`](https://github.com/vercel/next.js/blob/canary/contributing.md) ## Documentation / Examples - [ ] Make sure the linting passes by running `pnpm build && pnpm lint` - [ ] The "examples guidelines" are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
2023-02-22 16:08:22 +01:00
"@opentelemetry/api": {
"optional": true
}
},
"devDependencies": {
"@ampproject/toolbox-optimizer": "2.8.3",
"@babel/code-frame": "7.22.5",
"@babel/core": "7.22.5",
"@babel/eslint-parser": "7.22.5",
"@babel/generator": "7.22.5",
"@babel/plugin-proposal-class-properties": "7.18.6",
"@babel/plugin-proposal-export-namespace-from": "7.18.9",
"@babel/plugin-proposal-numeric-separator": "7.18.6",
"@babel/plugin-proposal-object-rest-spread": "7.20.7",
"@babel/plugin-syntax-bigint": "7.8.3",
"@babel/plugin-syntax-dynamic-import": "7.8.3",
"@babel/plugin-syntax-import-assertions": "7.22.5",
"@babel/plugin-syntax-jsx": "7.22.5",
"@babel/plugin-transform-modules-commonjs": "7.22.5",
"@babel/plugin-transform-runtime": "7.22.5",
"@babel/preset-env": "7.22.5",
"@babel/preset-react": "7.22.5",
"@babel/preset-typescript": "7.22.5",
"@babel/runtime": "7.22.5",
"@babel/traverse": "7.22.5",
"@babel/types": "7.22.5",
Integrating capsize latest (#47428) Integrating capsize latest <!-- Thanks for opening a PR! Your contribution is much appreciated. To make sure your PR is handled as smoothly as possible we request that you follow the checklist sections below. Choose the right checklist for the change(s) that you're making: ## For Contributors ### Improving Documentation or adding/fixing Examples - The "examples guidelines" are followed from our contributing doc https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md - Make sure the linting passes by running `pnpm build && pnpm lint`. See https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md ### Fixing a bug - Related issues linked using `fixes #number` - Tests added. See: https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs - Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md ### Adding a feature - Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. (A discussion must be opened, see https://github.com/vercel/next.js/discussions/new?category=ideas) - Related issues/discussions are linked using `fixes #number` - e2e tests added (https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs - Documentation added - Telemetry added. In case of a feature if it's used or not. - Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md ## For Maintainers - Minimal description (aim for explaining to someone not on the team to understand the PR) - When linking to a Slack thread, you might want to share details of the conclusion - Link both the Linear (Fixes NEXT-xxx) and the GitHub issues - Add review comments if necessary to explain to the reviewer the logic behind a change ### What? ### Why? ### How? Closes NEXT- Fixes # --> --------- Co-authored-by: JJ Kasper <jj@jjsweb.site>
2023-03-27 05:29:28 +02:00
"@capsizecss/metrics": "1.1.0",
"@edge-runtime/cookies": "4.0.2",
"@edge-runtime/ponyfill": "2.4.1",
"@edge-runtime/primitives": "4.0.2",
"@hapi/accept": "5.0.2",
"@jest/transform": "29.5.0",
"@jest/types": "29.5.0",
"@mswjs/interceptors": "0.23.0",
"@napi-rs/cli": "2.16.2",
"@napi-rs/triples": "1.1.0",
2024-01-27 00:22:18 +01:00
"@next/polyfill-module": "14.1.1-canary.15",
"@next/polyfill-nomodule": "14.1.1-canary.15",
"@next/react-dev-overlay": "14.1.1-canary.15",
"@next/react-refresh-utils": "14.1.1-canary.15",
"@next/swc": "14.1.1-canary.15",
"@opentelemetry/api": "1.6.0",
"@playwright/test": "^1.35.1",
"@taskr/clear": "1.1.0",
"@taskr/esnext": "1.1.0",
"@types/amphtml-validator": "1.0.0",
"@types/babel__code-frame": "7.0.2",
"@types/babel__core": "7.1.12",
"@types/babel__generator": "7.6.2",
"@types/babel__template": "7.4.0",
"@types/babel__traverse": "7.11.0",
"@types/bytes": "3.1.1",
"@types/ci-info": "2.0.0",
"@types/compression": "0.0.36",
"@types/content-disposition": "0.5.4",
2019-09-05 16:11:08 +02:00
"@types/content-type": "1.1.3",
"@types/cookie": "0.3.3",
2019-07-30 23:35:15 +02:00
"@types/cross-spawn": "6.0.0",
"@types/debug": "4.1.5",
feat: add OTEL instrumentation for next-server + OTEL example (#46198) fixes NEXT-479 ## content This PR adds a `getTracer` API to Next.js that uses the `otel/api` under the hood to provide Next.js level instrumentation through Open Telemetry. This also adds an example `with-opentelemetry` to demonstrate how it can be used, assuming you have a collector. This allows most notably to have `getServerSideProps` and `fetch` calls inside Server Components traced. ## details - we hide most internals spans, if you want to see all of them, use the NEXT_OTEL_VERBOSE=1 env var - if you want to use this, you'll need to rely on the `config.experimental.instrumentationHook` config option to initialise OTEL, like in the example ## Bug - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Errors have a helpful link attached, see [`contributing.md`](https://github.com/vercel/next.js/blob/canary/contributing.md) ## Feature - [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. - [ ] Related issues linked using `fixes #number` - [ ] [e2e](https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs) tests added - [ ] Documentation added - [ ] Telemetry added. In case of a feature if it's used or not. - [ ] Errors have a helpful link attached, see [`contributing.md`](https://github.com/vercel/next.js/blob/canary/contributing.md) ## Documentation / Examples - [ ] Make sure the linting passes by running `pnpm build && pnpm lint` - [ ] The "examples guidelines" are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
2023-02-22 16:08:22 +01:00
"@types/express-serve-static-core": "4.17.33",
"@types/fresh": "0.5.0",
"@types/glob": "7.1.1",
"@types/graceful-fs": "4.1.9",
"@types/jsonwebtoken": "9.0.0",
"@types/lodash": "4.14.198",
"@types/lodash.curry": "4.1.6",
Add experimental SPR support (#8832) * initial commit for SPRv2 * Add initial SPR cache handling * update SPR handling * Implement SPR handling in render * Update tests, handle caching with serverless next start, add TODOs, and update manifest generating * Handle no prerender-manifest from not being used * Fix url.parse error * Apply suggestions from code review Co-Authored-By: Joe Haddad <joe.haddad@zeit.co> * Replace set with constants in next-page-config * simplify sprStatus.used * Add error if getStaticProps is used with getInitialProps * Remove stale TODO * Update revalidate values in SPR cache for non-seeded routes * Apply suggestions from code review * Remove concurrency type * Rename variable for clarity * Add copying prerender files during export * Add comment for clarity * Fix exporting * Update comment * Add additional note * Rename variable * Update to not re-export SPR pages from build * Hard navigate when fetching data fails * Remove default extension * Add brackets * Add checking output files to prerender tests * Adjust export move logic * Clarify behavior of export aggregation * Update variable names for clarity * Update tests * Add comment * s/an oxymoron/contradictory/ * rename * Extract error case * Add tests for exporting SPR pages and update /_next/data endpoint to end with .json * Relocate variable * Adjust route building * Rename to unstable * Rename unstable_getStaticParams * Fix linting * Only add this when a data request * Update prerender data tests * s/isServerless/isLikeServerless/ * Don't rely on query for `next start` in serverless mode * Rename var * Update renderedDuringBuild check * Add test for dynamic param with bracket * Fix serverless next start handling * remove todo * Adjust comment * Update calculateRevalidate * Remove cache logic from render.tsx * Remove extra imports * Move SPR cache logic to next-server * Remove old isDynamic prop * Add calling App getInitialProps for SPR pages * Update revalidate logic * Add isStale to SprCacheValue * Update headers for SPR * add awaiting pendingRevalidation * Dont return null for revalidation render * Adjust logic * Be sure to remove coalesced render * Fix data for serverless * Create a method coalescing utility * Remove TODO * Extract send payload helper * Wrap in-line * Move around some code * Add tests for de-duping and revalidating * Update prerender manifest test
2019-09-24 10:50:04 +02:00
"@types/lru-cache": "5.1.0",
2020-03-29 19:17:06 +02:00
"@types/path-to-regexp": "1.7.0",
"@types/picomatch": "2.3.3",
"@types/platform": "1.3.4",
"@types/react": "18.2.37",
"@types/react-dom": "18.2.15",
"@types/react-is": "17.0.3",
"@types/semver": "7.3.1",
2019-09-05 16:11:08 +02:00
"@types/send": "0.14.4",
"@types/shell-quote": "1.7.1",
"@types/tar": "6.1.5",
"@types/text-table": "0.2.1",
"@types/ua-parser-js": "0.7.36",
"@types/uuid": "8.3.1",
"@types/webpack-sources1": "npm:@types/webpack-sources@0.1.5",
"@types/ws": "8.2.0",
"@vercel/ncc": "0.34.0",
"@vercel/nft": "0.26.2",
"@vercel/turbopack-ecmascript-runtime": "https://gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-240127.2",
"acorn": "8.5.0",
"amphtml-validator": "1.0.35",
"anser": "1.4.9",
"arg": "4.1.0",
2021-12-20 16:28:17 +01:00
"assert": "2.0.0",
2020-03-29 00:27:09 +01:00
"async-retry": "1.2.3",
"async-sema": "3.0.0",
"babel-plugin-transform-define": "2.0.0",
"babel-plugin-transform-react-remove-prop-types": "0.4.24",
"browserify-zlib": "0.2.0",
"browserslist": "4.22.2",
"buffer": "5.6.0",
2022-02-25 11:15:18 +01:00
"bytes": "3.1.1",
"ci-info": "watson/ci-info#f43f6a1cefff47fb361c88cf4b943fdbcaafe540",
[ESLint] Introduce a new setup process when `next lint` is run for the first time (#26584) This PR introduces an improved developer experience when `next lint` is run for the first time. ### Current behavior `eslint-config-next` is a required package that must be installed before proceeding with `next lint` or `next build`: ![image](https://user-images.githubusercontent.com/12476932/123468791-43088100-d5c0-11eb-9ad0-5beb80b6c968.png) Although this has helped many developers start using the new ESLint config, this has also resulted in a few issues: - Users are required to install the full config (`eslint-config-next`) even if they do not use it or use the Next.js plugin directly (`eslint-plugin-next`). - #26348 - There's some confusion on why `eslint-config-next` needs to be installed or how it should be used instead of `eslint-plugin-next`. - #26574 - #26475 - #26438 ### New behavior Instead of enforcing `eslint-config-next` as a required package, this PR prompts the user by asking what config they would like to start. This happens when `next lint` is run for the first time **and** if no ESLint configuration is detected in the application. <img src="https://user-images.githubusercontent.com/12476932/124331177-e1668a80-db5c-11eb-8915-38d3dc20f5d4.gif" width="800" /> - The CLI will take care of installing `eslint` or `eslint-config-next` if either is not already installed - Users now have the option to choose between a strict configuration (`next/core-web-vitals`) or just the base configuration (`next`) - For users that decide to create their own ESLint configuration, or already have an existing one, **installing `eslint-config-next` will not be a requirement for `next lint` or `next build` to run**. A warning message will just show if the Next.js ESLint plugin is not detected in an ESLint config. <img width="682" alt="Screen Shot 2021-06-25 at 3 02 12 PM" src="https://user-images.githubusercontent.com/12476932/123473329-6cc4a680-d5c6-11eb-9a57-d5c0b89a2732.png"> --- In addition, this PR also: - Fixes #26348 - Updates documentation to make it more clear what approach to take for new and existing ESLint configurations
2021-08-04 23:53:15 +02:00
"cli-select": "1.1.2",
"client-only": "0.0.1",
"comment-json": "3.0.3",
2020-03-29 00:56:38 +01:00
"compression": "1.7.4",
2020-03-29 17:46:33 +02:00
"conf": "5.0.0",
"constants-browserify": "1.0.0",
"content-disposition": "0.5.3",
2020-03-29 00:56:38 +01:00
"content-type": "1.0.4",
2020-05-11 02:48:57 +02:00
"cookie": "0.4.1",
"cross-spawn": "7.0.3",
"crypto-browserify": "3.12.0",
"css.escape": "1.5.1",
"cssnano-preset-default": "5.2.14",
"data-uri-to-buffer": "3.0.1",
"debug": "4.1.1",
2020-03-29 01:18:22 +01:00
"devalue": "2.0.1",
"domain-browser": "4.19.0",
"edge-runtime": "2.5.4",
"events": "3.3.0",
2020-05-11 02:48:57 +02:00
"find-up": "4.1.0",
2020-03-29 01:27:13 +01:00
"fresh": "0.5.2",
"get-orientation": "1.1.2",
"glob": "7.1.7",
2020-03-29 01:29:14 +01:00
"gzip-size": "5.1.1",
"http-proxy": "1.18.1",
"http-proxy-agent": "5.0.0",
2021-12-20 16:28:17 +01:00
"https-browserify": "1.0.0",
"https-proxy-agent": "5.0.1",
"icss-utils": "5.1.0",
2020-03-30 03:37:41 +02:00
"ignore-loader": "0.1.2",
"image-size": "1.0.0",
2020-03-29 01:33:35 +01:00
"is-docker": "2.0.0",
2020-05-11 02:48:57 +02:00
"is-wsl": "2.2.0",
"jest-worker": "27.5.1",
"json5": "2.2.3",
"jsonwebtoken": "9.0.0",
Add `loader-runner` to compiled packages (#45962) This adds `loader-runner` to the compiled packages distributed with Next.js This is a dependency of Turbopack's webpack loader support. Currently, users have to manually install `loader-runner` in their application to use webpack loaders with Turbopack. This will allow Turbopack to require loader-runner from within the installed version of Next.js instead. Test Plan: `require('./packages/next/dist/compiled/loader-runner/')` <!-- Thanks for opening a PR! Your contribution is much appreciated. To make sure your PR is handled as smoothly as possible we request that you follow the checklist sections below. Choose the right checklist for the change(s) that you're making: --> ## Bug - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Errors have a helpful link attached, see [`contributing.md`](https://github.com/vercel/next.js/blob/canary/contributing.md) ## Feature - [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. - [ ] Related issues linked using `fixes #number` - [ ] [e2e](https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs) tests added - [ ] Documentation added - [ ] Telemetry added. In case of a feature if it's used or not. - [ ] Errors have a helpful link attached, see [`contributing.md`](https://github.com/vercel/next.js/blob/canary/contributing.md) ## Documentation / Examples - [ ] Make sure the linting passes by running `pnpm build && pnpm lint` - [ ] The "examples guidelines" are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md) --------- Co-authored-by: JJ Kasper <jj@jjsweb.site>
2023-02-18 07:24:40 +01:00
"loader-runner": "4.3.0",
"loader-utils2": "npm:loader-utils@2.0.0",
"loader-utils3": "npm:loader-utils@3.1.3",
2020-03-29 01:43:59 +01:00
"lodash.curry": "4.1.1",
2020-03-29 01:46:22 +01:00
"lru-cache": "5.1.1",
"mini-css-extract-plugin": "2.4.3",
"msw": "1.3.0",
"nanoid": "3.1.32",
"native-url": "0.3.4",
"neo-async": "2.6.1",
"node-html-parser": "5.3.3",
"ora": "4.0.4",
"os-browserify": "0.3.0",
"p-limit": "3.1.0",
"path-browserify": "1.0.1",
2020-03-29 19:17:06 +02:00
"path-to-regexp": "6.1.0",
"picomatch": "3.0.1",
"platform": "1.3.6",
"postcss-flexbugs-fixes": "5.0.2",
"postcss-modules-extract-imports": "3.0.0",
"postcss-modules-local-by-default": "4.0.0",
"postcss-modules-scope": "3.0.0",
"postcss-modules-values": "4.0.0",
"postcss-preset-env": "7.4.3",
"postcss-safe-parser": "6.0.0",
"postcss-scss": "4.0.3",
"postcss-value-parser": "4.2.0",
"process": "0.11.10",
2022-01-03 22:46:09 +01:00
"punycode": "2.1.1",
"querystring-es3": "0.2.1",
"raw-body": "2.4.1",
"react-is": "18.2.0",
"react-refresh": "0.12.0",
"regenerator-runtime": "0.13.4",
"sass-loader": "12.4.0",
"schema-utils2": "npm:schema-utils@2.7.1",
"schema-utils3": "npm:schema-utils@3.0.0",
"semver": "7.3.2",
2020-03-29 03:40:29 +02:00
"send": "0.17.1",
"server-only": "0.0.1",
2022-01-03 22:46:09 +01:00
"setimmediate": "1.0.5",
"shell-quote": "1.7.3",
2020-03-29 05:41:35 +02:00
"source-map": "0.6.1",
Use precompiled source-map in overlay middleware (#60932) ## What? Since #60889 is failing tests I'm narrowing the changes into some separate PRs that can be landed independently. This PR adds source-map@0.8.0-beta.0` to the precompiled dependencies. <!-- Thanks for opening a PR! Your contribution is much appreciated. To make sure your PR is handled as smoothly as possible we request that you follow the checklist sections below. Choose the right checklist for the change(s) that you're making: ## For Contributors ### Improving Documentation - Run `pnpm prettier-fix` to fix formatting issues before opening the PR. - Read the Docs Contribution Guide to ensure your contribution follows the docs guidelines: https://nextjs.org/docs/community/contribution-guide ### Adding or Updating Examples - The "examples guidelines" are followed from our contributing doc https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md - Make sure the linting passes by running `pnpm build && pnpm lint`. See https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md ### Fixing a bug - Related issues linked using `fixes #number` - Tests added. See: https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs - Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md ### Adding a feature - Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. (A discussion must be opened, see https://github.com/vercel/next.js/discussions/new?category=ideas) - Related issues/discussions are linked using `fixes #number` - e2e tests added (https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs) - Documentation added - Telemetry added. In case of a feature if it's used or not. - Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md ## For Maintainers - Minimal description (aim for explaining to someone not on the team to understand the PR) - When linking to a Slack thread, you might want to share details of the conclusion - Link both the Linear (Fixes NEXT-xxx) and the GitHub issues - Add review comments if necessary to explain to the reviewer the logic behind a change ### What? ### Why? ### How? Closes NEXT- Fixes # --> Closes NEXT-2177
2024-01-22 10:04:34 +01:00
"source-map08": "npm:source-map@0.8.0-beta.0",
"stacktrace-parser": "0.1.10",
"stream-browserify": "3.0.0",
"stream-http": "3.1.1",
"strict-event-emitter": "0.5.0",
2020-03-29 05:05:26 +02:00
"string-hash": "1.1.3",
2021-12-20 16:28:17 +01:00
"string_decoder": "1.3.0",
"strip-ansi": "6.0.0",
perf: replace zod with superstruct (#56083) This PR replaces the usage of Zod in the App Router in favour of a smaller validation library. We don't use much of zod's more advanced capabilities so it doesn't make sense to import all of it on the server at the moment. Also added some unit tests. This results in a 44kb win, which will impact cold boot Before: <img width="594" alt="CleanShot 2023-09-27 at 13 34 09@2x" src="https://github.com/vercel/next.js/assets/11064311/43cc7687-947d-40a1-9e1e-c2a60caf53c0"> After: <img width="564" alt="CleanShot 2023-09-27 at 13 34 48@2x" src="https://github.com/vercel/next.js/assets/11064311/c3d3f5d6-e1f6-4969-bd11-dcd191d34ce6"> <!-- Thanks for opening a PR! Your contribution is much appreciated. To make sure your PR is handled as smoothly as possible we request that you follow the checklist sections below. Choose the right checklist for the change(s) that you're making: ## For Contributors ### Improving Documentation - Run `pnpm prettier-fix` to fix formatting issues before opening the PR. - Read the Docs Contribution Guide to ensure your contribution follows the docs guidelines: https://nextjs.org/docs/community/contribution-guide ### Adding or Updating Examples - The "examples guidelines" are followed from our contributing doc https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md - Make sure the linting passes by running `pnpm build && pnpm lint`. See https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md ### Fixing a bug - Related issues linked using `fixes #number` - Tests added. See: https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs - Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md ### Adding a feature - Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. (A discussion must be opened, see https://github.com/vercel/next.js/discussions/new?category=ideas) - Related issues/discussions are linked using `fixes #number` - e2e tests added (https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs) - Documentation added - Telemetry added. In case of a feature if it's used or not. - Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md ## For Maintainers - Minimal description (aim for explaining to someone not on the team to understand the PR) - When linking to a Slack thread, you might want to share details of the conclusion - Link both the Linear (Fixes NEXT-xxx) and the GitHub issues - Add review comments if necessary to explain to the reviewer the logic behind a change ### What? ### Why? ### How? Closes NEXT- Fixes # -->
2023-09-28 11:05:36 +02:00
"superstruct": "1.0.3",
"tar": "6.1.15",
2019-03-24 14:34:44 +01:00
"taskr": "1.1.0",
"terser": "5.27.0",
"terser-webpack-plugin": "5.3.9",
"text-table": "0.2.0",
"timers-browserify": "2.0.12",
"tty-browserify": "0.0.1",
"ua-parser-js": "1.0.35",
"unistore": "3.4.1",
"util": "0.12.4",
2021-12-20 16:28:17 +01:00
"uuid": "8.3.2",
"vm-browserify": "1.1.2",
"watchpack": "2.4.0",
"web-vitals": "3.0.0",
"webpack": "5.86.0",
"webpack-sources1": "npm:webpack-sources@1.4.3",
"webpack-sources3": "npm:webpack-sources@3.2.3",
refactor: rewrite config schema in zod (#56383) The PR supersedes the https://github.com/vercel/next.js/pull/53150, which is way too outdated, has way too many conflicts, and also heavily relies on GitHub Copilot (which makes the progress slow and tedious). The PR uses [`json-schema-to-zod`](https://github.com/StefanTerdell/json-schema-to-zod) (instead of the GitHub Copilot) to generate the zod schema, and manually replaces all generated `z.customRefine` with my hand-written zod schema. TODO: - [x] Convert schema - [x] Reduce `z.any()` usage - [x] Create human-readable errors from the `ZodError` - [x] Update test cases to reflect the latest error message ----- The benefit of using zod over ajv: - Easier maintenance: zod schema is straightforward to compose. - Better typescript support: config schema now strictly reflects the `NextConfig` type. - Smaller installation size: by replacing `ajv` and `@segment/ajv-human-errors` w/ `zod`, I am able to reduce installation size by 114 KiB. - Better Extension: the zod error message is easy to customize. ----- In the previous PR https://github.com/vercel/next.js/pull/56083, @feedthejim replaces `zod` w/ `superstruct`. `superstruct` is lightweight and fast, which makes it perfect for creating simple schemas for RSC payload. But, this also means `superstruct` has its limitations compared to `zod`: - `superstruct`'s syntax is different, and some utilities's usage is counter-intuitive: - `z.array(z.string()).gt(1)` vs `s.size(s.array(s.string()), 1)` - `z.numer().gt(1)` vs `s.size(s.number(), 1)`, `s.min(s.number(), 1)` - `z.boolean().optional().nullable()` vs `s.nullable(s.optional(z.boolean()))` - `superstruct` has weaker TypeScript support and worse DX compared to `zod` when composing huge schema: - `zod.ZodType + z.object()` can provide a more detailed type mismatch message on which specific property is the culprit, while `Describe + s.object()` provides almost no information at all. - `zod`'s schema is more powerful - `z.function()` supports `z.args()` and `z.returns()`, while `superstruct` only has `s.func()` - zod also has Promise type `z.promise()` and intersection type `z.and()` - `superstruct`'s error is harder to parse compared to `zod`'s `ZodError` So in the PR, I re-introduced `zod` for `next.config.js` validation.
2023-10-05 17:46:53 +02:00
"ws": "8.2.3",
"zod": "3.22.3"
},
"engines": {
"node": ">=18.17.0"
}
}