use enableDevMode() or development condition instead of NODE_ENV#4464
Merged
yaacovCR merged 11 commits intographql:nextfrom Aug 21, 2025
Merged
use enableDevMode() or development condition instead of NODE_ENV#4464yaacovCR merged 11 commits intographql:nextfrom
enableDevMode() or development condition instead of NODE_ENV#4464yaacovCR merged 11 commits intographql:nextfrom
Conversation
thanks @JoviDeCroock! (not sure what I did wrong before)
yaacovCR
added a commit
to yaacovCR/apollo-server
that referenced
this pull request
Aug 18, 2025
use latest dev mode with dual build (see graphql/graphql-js#4464) removes need for babel or swc
yaacovCR
added a commit
to yaacovCR/apollo-server
that referenced
this pull request
Aug 18, 2025
use just config setting: testEnvironment / customExportConditions use latest dev mode with dual build (see graphql/graphql-js#4464) no need for additional transformer
yaacovCR
added a commit
to yaacovCR/apollo-server
that referenced
this pull request
Aug 18, 2025
use just config setting: testEnvironment / customExportConditions use latest dev mode with dual build (see graphql/graphql-js#4464) no need for additional transformer
yaacovCR
added a commit
to yaacovCR/apollo-server
that referenced
this pull request
Aug 18, 2025
use just config setting: testEnvironment / customExportConditions use latest dev mode with dual build (see graphql/graphql-js#4464) no need for additional transformer
yaacovCR
added a commit
to yaacovCR/apollo-server
that referenced
this pull request
Aug 18, 2025
- use jest config setting: testEnvironment / customExportConditions - use latest dev mode with dual build (see graphql/graphql-js#4464) - no need for additional transformer
Contributor
Author
|
updated integration tests thanks to @JoviDeCroock offline help, jest test working (demonstrated also at: apollographql/apollo-server#8137) in terms of allowing switching back to prod mode, I still cannot reverse performance degradation in offline benchmarking even after 100,000 invocations of prod function, so will leave this simply as |
yaacovCR
added a commit
to yaacovCR/graphql-js
that referenced
this pull request
Dec 17, 2025
…graphql#4464) Motivation: This PR makes our build product cross-platform by dropping all Node.js specific code. In development mode, GraphQL.JS can provide an additional runtime check appropriate for development-time errors: the erroneous inclusion of multiple GraphQL.JS modules. Unlike earlier versions of GraphQL.JS, by default, development mode is disabled. This is to best ensure that production builds do not incur the performance and bundle size penalties associated with the additional checks. Also, unlike earlier versions, development mode is not configured by use of environment variables, which are accessed in disparate ways on the various platforms. In particular, the `NODE_ENV` environment variable now has no effect on triggering development mode. Rather, development mode is either enabled: 1. by setting a 'development' condition, which is possible only on platforms that support `package.json` conditional exports and custom conditions, or 2. by calling `enableDevMode()` within user code. Conditional exports with custom conditions are supported by: Node.js, Deno, Bun, Webpack 5, Rspack, Rollup (via the `node-resolve` plugin), esbuild, Vite, and Rsbuild. create-react-app and Next.js support conditional exports when using Webpack 5 as their bundler. Conditional exports with custom conditions are not supported by Webpack 4, Rollup (without the `node-resolve` plugin), older versions of Deno or transpilers such as swc. create-react-app and Next.js do not support conditional exports with custom conditions when using Webpack 4 as their bundler, nor does Next.js yet support conditional exports with custom conditions when using Turbopack (see vercel/next.js#78912). Testing frameworks such as Mocha, Jest, and Vitest support conditional exports with custom conditions, Integration tests within the repository demonstrate how to enable development mode using the `development` condition on various platforms that support this, as well as enabling development mode by calling `enableDevMode()` within user code. We encourage enabling development mode in a development environment. This facilitates the additional check to ensure that only a single GraphQL.JS module is used. Additional development-time checks may also be added in the future.
yaacovCR
added a commit
to yaacovCR/graphql-js
that referenced
this pull request
Dec 17, 2025
…graphql#4464) Motivation: This PR makes our build product cross-platform by dropping all Node.js specific code. In development mode, GraphQL.JS can provide an additional runtime check appropriate for development-time errors: the erroneous inclusion of multiple GraphQL.JS modules. Unlike earlier versions of GraphQL.JS, by default, development mode is disabled. This is to best ensure that production builds do not incur the performance and bundle size penalties associated with the additional checks. Also, unlike earlier versions, development mode is not configured by use of environment variables, which are accessed in disparate ways on the various platforms. In particular, the `NODE_ENV` environment variable now has no effect on triggering development mode. Rather, development mode is either enabled: 1. by setting a 'development' condition, which is possible only on platforms that support `package.json` conditional exports and custom conditions, or 2. by calling `enableDevMode()` within user code. Conditional exports with custom conditions are supported by: Node.js, Deno, Bun, Webpack 5, Rspack, Rollup (via the `node-resolve` plugin), esbuild, Vite, and Rsbuild. create-react-app and Next.js support conditional exports when using Webpack 5 as their bundler. Conditional exports with custom conditions are not supported by Webpack 4, Rollup (without the `node-resolve` plugin), older versions of Deno or transpilers such as swc. create-react-app and Next.js do not support conditional exports with custom conditions when using Webpack 4 as their bundler, nor does Next.js yet support conditional exports with custom conditions when using Turbopack (see vercel/next.js#78912). Testing frameworks such as Mocha, Jest, and Vitest support conditional exports with custom conditions, Integration tests within the repository demonstrate how to enable development mode using the `development` condition on various platforms that support this, as well as enabling development mode by calling `enableDevMode()` within user code. We encourage enabling development mode in a development environment. This facilitates the additional check to ensure that only a single GraphQL.JS module is used. Additional development-time checks may also be added in the future.
yaacovCR
added a commit
to yaacovCR/graphql-js
that referenced
this pull request
Dec 17, 2025
…graphql#4464) Motivation: This PR makes our build product cross-platform by dropping all Node.js specific code. In development mode, GraphQL.JS can provide an additional runtime check appropriate for development-time errors: the erroneous inclusion of multiple GraphQL.JS modules. Unlike earlier versions of GraphQL.JS, by default, development mode is disabled. This is to best ensure that production builds do not incur the performance and bundle size penalties associated with the additional checks. Also, unlike earlier versions, development mode is not configured by use of environment variables, which are accessed in disparate ways on the various platforms. In particular, the `NODE_ENV` environment variable now has no effect on triggering development mode. Rather, development mode is either enabled: 1. by setting a 'development' condition, which is possible only on platforms that support `package.json` conditional exports and custom conditions, or 2. by calling `enableDevMode()` within user code. Conditional exports with custom conditions are supported by: Node.js, Deno, Bun, Webpack 5, Rspack, Rollup (via the `node-resolve` plugin), esbuild, Vite, and Rsbuild. create-react-app and Next.js support conditional exports when using Webpack 5 as their bundler. Conditional exports with custom conditions are not supported by Webpack 4, Rollup (without the `node-resolve` plugin), older versions of Deno or transpilers such as swc. create-react-app and Next.js do not support conditional exports with custom conditions when using Webpack 4 as their bundler, nor does Next.js yet support conditional exports with custom conditions when using Turbopack (see vercel/next.js#78912). Testing frameworks such as Mocha, Jest, and Vitest support conditional exports with custom conditions, Integration tests within the repository demonstrate how to enable development mode using the `development` condition on various platforms that support this, as well as enabling development mode by calling `enableDevMode()` within user code. We encourage enabling development mode in a development environment. This facilitates the additional check to ensure that only a single GraphQL.JS module is used. Additional development-time checks may also be added in the future.
yaacovCR
added a commit
to yaacovCR/graphql-js
that referenced
this pull request
Dec 18, 2025
…graphql#4464) Motivation: This PR makes our build product cross-platform by dropping all Node.js specific code. In development mode, GraphQL.JS can provide an additional runtime check appropriate for development-time errors: the erroneous inclusion of multiple GraphQL.JS modules. Unlike earlier versions of GraphQL.JS, by default, development mode is disabled. This is to best ensure that production builds do not incur the performance and bundle size penalties associated with the additional checks. Also, unlike earlier versions, development mode is not configured by use of environment variables, which are accessed in disparate ways on the various platforms. In particular, the `NODE_ENV` environment variable now has no effect on triggering development mode. Rather, development mode is either enabled: 1. by setting a 'development' condition, which is possible only on platforms that support `package.json` conditional exports and custom conditions, or 2. by calling `enableDevMode()` within user code. Conditional exports with custom conditions are supported by: Node.js, Deno, Bun, Webpack 5, Rspack, Rollup (via the `node-resolve` plugin), esbuild, Vite, and Rsbuild. create-react-app and Next.js support conditional exports when using Webpack 5 as their bundler. Conditional exports with custom conditions are not supported by Webpack 4, Rollup (without the `node-resolve` plugin), older versions of Deno or transpilers such as swc. create-react-app and Next.js do not support conditional exports with custom conditions when using Webpack 4 as their bundler, nor does Next.js yet support conditional exports with custom conditions when using Turbopack (see vercel/next.js#78912). Testing frameworks such as Mocha, Jest, and Vitest support conditional exports with custom conditions, Integration tests within the repository demonstrate how to enable development mode using the `development` condition on various platforms that support this, as well as enabling development mode by calling `enableDevMode()` within user code. We encourage enabling development mode in a development environment. This facilitates the additional check to ensure that only a single GraphQL.JS module is used. Additional development-time checks may also be added in the future.
yaacovCR
added a commit
to yaacovCR/graphql-js
that referenced
this pull request
Dec 19, 2025
…graphql#4464) Motivation: This PR makes our build product cross-platform by dropping all Node.js specific code. In development mode, GraphQL.JS can provide an additional runtime check appropriate for development-time errors: the erroneous inclusion of multiple GraphQL.JS modules. Unlike earlier versions of GraphQL.JS, by default, development mode is disabled. This is to best ensure that production builds do not incur the performance and bundle size penalties associated with the additional checks. Also, unlike earlier versions, development mode is not configured by use of environment variables, which are accessed in disparate ways on the various platforms. In particular, the `NODE_ENV` environment variable now has no effect on triggering development mode. Rather, development mode is either enabled: 1. by setting a 'development' condition, which is possible only on platforms that support `package.json` conditional exports and custom conditions, or 2. by calling `enableDevMode()` within user code. Conditional exports with custom conditions are supported by: Node.js, Deno, Bun, Webpack 5, Rspack, Rollup (via the `node-resolve` plugin), esbuild, Vite, and Rsbuild. create-react-app and Next.js support conditional exports when using Webpack 5 as their bundler. Conditional exports with custom conditions are not supported by Webpack 4, Rollup (without the `node-resolve` plugin), older versions of Deno or transpilers such as swc. create-react-app and Next.js do not support conditional exports with custom conditions when using Webpack 4 as their bundler, nor does Next.js yet support conditional exports with custom conditions when using Turbopack (see vercel/next.js#78912). Testing frameworks such as Mocha, Jest, and Vitest support conditional exports with custom conditions, Integration tests within the repository demonstrate how to enable development mode using the `development` condition on various platforms that support this, as well as enabling development mode by calling `enableDevMode()` within user code. We encourage enabling development mode in a development environment. This facilitates the additional check to ensure that only a single GraphQL.JS module is used. Additional development-time checks may also be added in the future.
yaacovCR
added a commit
to yaacovCR/graphql-js
that referenced
this pull request
Dec 22, 2025
…graphql#4464) Motivation: This PR makes our build product cross-platform by dropping all Node.js specific code. In development mode, GraphQL.JS can provide an additional runtime check appropriate for development-time errors: the erroneous inclusion of multiple GraphQL.JS modules. Unlike earlier versions of GraphQL.JS, by default, development mode is disabled. This is to best ensure that production builds do not incur the performance and bundle size penalties associated with the additional checks. Also, unlike earlier versions, development mode is not configured by use of environment variables, which are accessed in disparate ways on the various platforms. In particular, the `NODE_ENV` environment variable now has no effect on triggering development mode. Rather, development mode is either enabled: 1. by setting a 'development' condition, which is possible only on platforms that support `package.json` conditional exports and custom conditions, or 2. by calling `enableDevMode()` within user code. Conditional exports with custom conditions are supported by: Node.js, Deno, Bun, Webpack 5, Rspack, Rollup (via the `node-resolve` plugin), esbuild, Vite, and Rsbuild. create-react-app and Next.js support conditional exports when using Webpack 5 as their bundler. Conditional exports with custom conditions are not supported by Webpack 4, Rollup (without the `node-resolve` plugin), older versions of Deno or transpilers such as swc. create-react-app and Next.js do not support conditional exports with custom conditions when using Webpack 4 as their bundler, nor does Next.js yet support conditional exports with custom conditions when using Turbopack (see vercel/next.js#78912). Testing frameworks such as Mocha, Jest, and Vitest support conditional exports with custom conditions, Integration tests within the repository demonstrate how to enable development mode using the `development` condition on various platforms that support this, as well as enabling development mode by calling `enableDevMode()` within user code. We encourage enabling development mode in a development environment. This facilitates the additional check to ensure that only a single GraphQL.JS module is used. Additional development-time checks may also be added in the future.
yaacovCR
added a commit
that referenced
this pull request
Dec 22, 2025
…#4464) Motivation: This PR makes our build product cross-platform by dropping all Node.js specific code. In development mode, GraphQL.JS can provide an additional runtime check appropriate for development-time errors: the erroneous inclusion of multiple GraphQL.JS modules. Unlike earlier versions of GraphQL.JS, by default, development mode is disabled. This is to best ensure that production builds do not incur the performance and bundle size penalties associated with the additional checks. Also, unlike earlier versions, development mode is not configured by use of environment variables, which are accessed in disparate ways on the various platforms. In particular, the `NODE_ENV` environment variable now has no effect on triggering development mode. Rather, development mode is either enabled: 1. by setting a 'development' condition, which is possible only on platforms that support `package.json` conditional exports and custom conditions, or 2. by calling `enableDevMode()` within user code. Conditional exports with custom conditions are supported by: Node.js, Deno, Bun, Webpack 5, Rspack, Rollup (via the `node-resolve` plugin), esbuild, Vite, and Rsbuild. create-react-app and Next.js support conditional exports when using Webpack 5 as their bundler. Conditional exports with custom conditions are not supported by Webpack 4, Rollup (without the `node-resolve` plugin), older versions of Deno or transpilers such as swc. create-react-app and Next.js do not support conditional exports with custom conditions when using Webpack 4 as their bundler, nor does Next.js yet support conditional exports with custom conditions when using Turbopack (see vercel/next.js#78912). Testing frameworks such as Mocha, Jest, and Vitest support conditional exports with custom conditions, Integration tests within the repository demonstrate how to enable development mode using the `development` condition on various platforms that support this, as well as enabling development mode by calling `enableDevMode()` within user code. We encourage enabling development mode in a development environment. This facilitates the additional check to ensure that only a single GraphQL.JS module is used. Additional development-time checks may also be added in the future.
yaacovCR
added a commit
that referenced
this pull request
Dec 22, 2025
…#4464) Motivation: This PR makes our build product cross-platform by dropping all Node.js specific code. In development mode, GraphQL.JS can provide an additional runtime check appropriate for development-time errors: the erroneous inclusion of multiple GraphQL.JS modules. Unlike earlier versions of GraphQL.JS, by default, development mode is disabled. This is to best ensure that production builds do not incur the performance and bundle size penalties associated with the additional checks. Also, unlike earlier versions, development mode is not configured by use of environment variables, which are accessed in disparate ways on the various platforms. In particular, the `NODE_ENV` environment variable now has no effect on triggering development mode. Rather, development mode is either enabled: 1. by setting a 'development' condition, which is possible only on platforms that support `package.json` conditional exports and custom conditions, or 2. by calling `enableDevMode()` within user code. Conditional exports with custom conditions are supported by: Node.js, Deno, Bun, Webpack 5, Rspack, Rollup (via the `node-resolve` plugin), esbuild, Vite, and Rsbuild. create-react-app and Next.js support conditional exports when using Webpack 5 as their bundler. Conditional exports with custom conditions are not supported by Webpack 4, Rollup (without the `node-resolve` plugin), older versions of Deno or transpilers such as swc. create-react-app and Next.js do not support conditional exports with custom conditions when using Webpack 4 as their bundler, nor does Next.js yet support conditional exports with custom conditions when using Turbopack (see vercel/next.js#78912). Testing frameworks such as Mocha, Jest, and Vitest support conditional exports with custom conditions, Integration tests within the repository demonstrate how to enable development mode using the `development` condition on various platforms that support this, as well as enabling development mode by calling `enableDevMode()` within user code. We encourage enabling development mode in a development environment. This facilitates the additional check to ensure that only a single GraphQL.JS module is used. Additional development-time checks may also be added in the future.
yaacovCR
added a commit
to yaacovCR/graphql-js
that referenced
this pull request
Jan 27, 2026
…graphql#4464) Motivation: This PR makes our build product cross-platform by dropping all Node.js specific code. In development mode, GraphQL.JS can provide an additional runtime check appropriate for development-time errors: the erroneous inclusion of multiple GraphQL.JS modules. Unlike earlier versions of GraphQL.JS, by default, development mode is disabled. This is to best ensure that production builds do not incur the performance and bundle size penalties associated with the additional checks. Also, unlike earlier versions, development mode is not configured by use of environment variables, which are accessed in disparate ways on the various platforms. In particular, the `NODE_ENV` environment variable now has no effect on triggering development mode. Rather, development mode is either enabled: 1. by setting a 'development' condition, which is possible only on platforms that support `package.json` conditional exports and custom conditions, or 2. by calling `enableDevMode()` within user code. Conditional exports with custom conditions are supported by: Node.js, Deno, Bun, Webpack 5, Rspack, Rollup (via the `node-resolve` plugin), esbuild, Vite, and Rsbuild. create-react-app and Next.js support conditional exports when using Webpack 5 as their bundler. Conditional exports with custom conditions are not supported by Webpack 4, Rollup (without the `node-resolve` plugin), older versions of Deno or transpilers such as swc. create-react-app and Next.js do not support conditional exports with custom conditions when using Webpack 4 as their bundler, nor does Next.js yet support conditional exports with custom conditions when using Turbopack (see vercel/next.js#78912). Testing frameworks such as Mocha, Jest, and Vitest support conditional exports with custom conditions, Integration tests within the repository demonstrate how to enable development mode using the `development` condition on various platforms that support this, as well as enabling development mode by calling `enableDevMode()` within user code. We encourage enabling development mode in a development environment. This facilitates the additional check to ensure that only a single GraphQL.JS module is used. Additional development-time checks may also be added in the future.
This was referenced Feb 4, 2026
Open
yaacovCR
added a commit
that referenced
this pull request
Feb 22, 2026
…#4464) Motivation: This PR makes our build product cross-platform by dropping all Node.js specific code. In development mode, GraphQL.JS can provide an additional runtime check appropriate for development-time errors: the erroneous inclusion of multiple GraphQL.JS modules. Unlike earlier versions of GraphQL.JS, by default, development mode is disabled. This is to best ensure that production builds do not incur the performance and bundle size penalties associated with the additional checks. Also, unlike earlier versions, development mode is not configured by use of environment variables, which are accessed in disparate ways on the various platforms. In particular, the `NODE_ENV` environment variable now has no effect on triggering development mode. Rather, development mode is either enabled: 1. by setting a 'development' condition, which is possible only on platforms that support `package.json` conditional exports and custom conditions, or 2. by calling `enableDevMode()` within user code. Conditional exports with custom conditions are supported by: Node.js, Deno, Bun, Webpack 5, Rspack, Rollup (via the `node-resolve` plugin), esbuild, Vite, and Rsbuild. create-react-app and Next.js support conditional exports when using Webpack 5 as their bundler. Conditional exports with custom conditions are not supported by Webpack 4, Rollup (without the `node-resolve` plugin), older versions of Deno or transpilers such as swc. create-react-app and Next.js do not support conditional exports with custom conditions when using Webpack 4 as their bundler, nor does Next.js yet support conditional exports with custom conditions when using Turbopack (see vercel/next.js#78912). Testing frameworks such as Mocha, Jest, and Vitest support conditional exports with custom conditions, Integration tests within the repository demonstrate how to enable development mode using the `development` condition on various platforms that support this, as well as enabling development mode by calling `enableDevMode()` within user code. We encourage enabling development mode in a development environment. This facilitates the additional check to ensure that only a single GraphQL.JS module is used. Additional development-time checks may also be added in the future.
yaacovCR
added a commit
to yaacovCR/graphql-js
that referenced
this pull request
Feb 22, 2026
NODE_ENV in v17 does not affect development mode, see changes in graphql#4464 => dev mode is off by default
yaacovCR
added a commit
that referenced
this pull request
Feb 22, 2026
NODE_ENV in v17 does not affect development mode, see changes in #4464 => dev mode is off by default
yaacovCR
added a commit
that referenced
this pull request
Feb 22, 2026
…#4464) Motivation: This PR makes our build product cross-platform by dropping all Node.js specific code. In development mode, GraphQL.JS can provide an additional runtime check appropriate for development-time errors: the erroneous inclusion of multiple GraphQL.JS modules. Unlike earlier versions of GraphQL.JS, by default, development mode is disabled. This is to best ensure that production builds do not incur the performance and bundle size penalties associated with the additional checks. Also, unlike earlier versions, development mode is not configured by use of environment variables, which are accessed in disparate ways on the various platforms. In particular, the `NODE_ENV` environment variable now has no effect on triggering development mode. Rather, development mode is either enabled: 1. by setting a 'development' condition, which is possible only on platforms that support `package.json` conditional exports and custom conditions, or 2. by calling `enableDevMode()` within user code. Conditional exports with custom conditions are supported by: Node.js, Deno, Bun, Webpack 5, Rspack, Rollup (via the `node-resolve` plugin), esbuild, Vite, and Rsbuild. create-react-app and Next.js support conditional exports when using Webpack 5 as their bundler. Conditional exports with custom conditions are not supported by Webpack 4, Rollup (without the `node-resolve` plugin), older versions of Deno or transpilers such as swc. create-react-app and Next.js do not support conditional exports with custom conditions when using Webpack 4 as their bundler, nor does Next.js yet support conditional exports with custom conditions when using Turbopack (see vercel/next.js#78912). Testing frameworks such as Mocha, Jest, and Vitest support conditional exports with custom conditions, Integration tests within the repository demonstrate how to enable development mode using the `development` condition on various platforms that support this, as well as enabling development mode by calling `enableDevMode()` within user code. We encourage enabling development mode in a development environment. This facilitates the additional check to ensure that only a single GraphQL.JS module is used. Additional development-time checks may also be added in the future.
yaacovCR
added a commit
that referenced
this pull request
Feb 23, 2026
…#4464) Motivation: This PR makes our build product cross-platform by dropping all Node.js specific code. In development mode, GraphQL.JS can provide an additional runtime check appropriate for development-time errors: the erroneous inclusion of multiple GraphQL.JS modules. Unlike earlier versions of GraphQL.JS, by default, development mode is disabled. This is to best ensure that production builds do not incur the performance and bundle size penalties associated with the additional checks. Also, unlike earlier versions, development mode is not configured by use of environment variables, which are accessed in disparate ways on the various platforms. In particular, the `NODE_ENV` environment variable now has no effect on triggering development mode. Rather, development mode is either enabled: 1. by setting a 'development' condition, which is possible only on platforms that support `package.json` conditional exports and custom conditions, or 2. by calling `enableDevMode()` within user code. Conditional exports with custom conditions are supported by: Node.js, Deno, Bun, Webpack 5, Rspack, Rollup (via the `node-resolve` plugin), esbuild, Vite, and Rsbuild. create-react-app and Next.js support conditional exports when using Webpack 5 as their bundler. Conditional exports with custom conditions are not supported by Webpack 4, Rollup (without the `node-resolve` plugin), older versions of Deno or transpilers such as swc. create-react-app and Next.js do not support conditional exports with custom conditions when using Webpack 4 as their bundler, nor does Next.js yet support conditional exports with custom conditions when using Turbopack (see vercel/next.js#78912). Testing frameworks such as Mocha, Jest, and Vitest support conditional exports with custom conditions, Integration tests within the repository demonstrate how to enable development mode using the `development` condition on various platforms that support this, as well as enabling development mode by calling `enableDevMode()` within user code. We encourage enabling development mode in a development environment. This facilitates the additional check to ensure that only a single GraphQL.JS module is used. Additional development-time checks may also be added in the future.
yaacovCR
added a commit
that referenced
this pull request
Feb 24, 2026
…#4464) Motivation: This PR makes our build product cross-platform by dropping all Node.js specific code. In development mode, GraphQL.JS can provide an additional runtime check appropriate for development-time errors: the erroneous inclusion of multiple GraphQL.JS modules. Unlike earlier versions of GraphQL.JS, by default, development mode is disabled. This is to best ensure that production builds do not incur the performance and bundle size penalties associated with the additional checks. Also, unlike earlier versions, development mode is not configured by use of environment variables, which are accessed in disparate ways on the various platforms. In particular, the `NODE_ENV` environment variable now has no effect on triggering development mode. Rather, development mode is either enabled: 1. by setting a 'development' condition, which is possible only on platforms that support `package.json` conditional exports and custom conditions, or 2. by calling `enableDevMode()` within user code. Conditional exports with custom conditions are supported by: Node.js, Deno, Bun, Webpack 5, Rspack, Rollup (via the `node-resolve` plugin), esbuild, Vite, and Rsbuild. create-react-app and Next.js support conditional exports when using Webpack 5 as their bundler. Conditional exports with custom conditions are not supported by Webpack 4, Rollup (without the `node-resolve` plugin), older versions of Deno or transpilers such as swc. create-react-app and Next.js do not support conditional exports with custom conditions when using Webpack 4 as their bundler, nor does Next.js yet support conditional exports with custom conditions when using Turbopack (see vercel/next.js#78912). Testing frameworks such as Mocha, Jest, and Vitest support conditional exports with custom conditions, Integration tests within the repository demonstrate how to enable development mode using the `development` condition on various platforms that support this, as well as enabling development mode by calling `enableDevMode()` within user code. We encourage enabling development mode in a development environment. This facilitates the additional check to ensure that only a single GraphQL.JS module is used. Additional development-time checks may also be added in the future.
yaacovCR
added a commit
that referenced
this pull request
Feb 24, 2026
…#4464) Motivation: This PR makes our build product cross-platform by dropping all Node.js specific code. In development mode, GraphQL.JS can provide an additional runtime check appropriate for development-time errors: the erroneous inclusion of multiple GraphQL.JS modules. Unlike earlier versions of GraphQL.JS, by default, development mode is disabled. This is to best ensure that production builds do not incur the performance and bundle size penalties associated with the additional checks. Also, unlike earlier versions, development mode is not configured by use of environment variables, which are accessed in disparate ways on the various platforms. In particular, the `NODE_ENV` environment variable now has no effect on triggering development mode. Rather, development mode is either enabled: 1. by setting a 'development' condition, which is possible only on platforms that support `package.json` conditional exports and custom conditions, or 2. by calling `enableDevMode()` within user code. Conditional exports with custom conditions are supported by: Node.js, Deno, Bun, Webpack 5, Rspack, Rollup (via the `node-resolve` plugin), esbuild, Vite, and Rsbuild. create-react-app and Next.js support conditional exports when using Webpack 5 as their bundler. Conditional exports with custom conditions are not supported by Webpack 4, Rollup (without the `node-resolve` plugin), older versions of Deno or transpilers such as swc. create-react-app and Next.js do not support conditional exports with custom conditions when using Webpack 4 as their bundler, nor does Next.js yet support conditional exports with custom conditions when using Turbopack (see vercel/next.js#78912). Testing frameworks such as Mocha, Jest, and Vitest support conditional exports with custom conditions, Integration tests within the repository demonstrate how to enable development mode using the `development` condition on various platforms that support this, as well as enabling development mode by calling `enableDevMode()` within user code. We encourage enabling development mode in a development environment. This facilitates the additional check to ensure that only a single GraphQL.JS module is used. Additional development-time checks may also be added in the future.
yaacovCR
added a commit
that referenced
this pull request
Feb 24, 2026
…#4464) Motivation: This PR makes our build product cross-platform by dropping all Node.js specific code. In development mode, GraphQL.JS can provide an additional runtime check appropriate for development-time errors: the erroneous inclusion of multiple GraphQL.JS modules. Unlike earlier versions of GraphQL.JS, by default, development mode is disabled. This is to best ensure that production builds do not incur the performance and bundle size penalties associated with the additional checks. Also, unlike earlier versions, development mode is not configured by use of environment variables, which are accessed in disparate ways on the various platforms. In particular, the `NODE_ENV` environment variable now has no effect on triggering development mode. Rather, development mode is either enabled: 1. by setting a 'development' condition, which is possible only on platforms that support `package.json` conditional exports and custom conditions, or 2. by calling `enableDevMode()` within user code. Conditional exports with custom conditions are supported by: Node.js, Deno, Bun, Webpack 5, Rspack, Rollup (via the `node-resolve` plugin), esbuild, Vite, and Rsbuild. create-react-app and Next.js support conditional exports when using Webpack 5 as their bundler. Conditional exports with custom conditions are not supported by Webpack 4, Rollup (without the `node-resolve` plugin), older versions of Deno or transpilers such as swc. create-react-app and Next.js do not support conditional exports with custom conditions when using Webpack 4 as their bundler, nor does Next.js yet support conditional exports with custom conditions when using Turbopack (see vercel/next.js#78912). Testing frameworks such as Mocha, Jest, and Vitest support conditional exports with custom conditions, Integration tests within the repository demonstrate how to enable development mode using the `development` condition on various platforms that support this, as well as enabling development mode by calling `enableDevMode()` within user code. We encourage enabling development mode in a development environment. This facilitates the additional check to ensure that only a single GraphQL.JS module is used. Additional development-time checks may also be added in the future.
yaacovCR
added a commit
that referenced
this pull request
Feb 24, 2026
…#4464) Motivation: This PR makes our build product cross-platform by dropping all Node.js specific code. In development mode, GraphQL.JS can provide an additional runtime check appropriate for development-time errors: the erroneous inclusion of multiple GraphQL.JS modules. Unlike earlier versions of GraphQL.JS, by default, development mode is disabled. This is to best ensure that production builds do not incur the performance and bundle size penalties associated with the additional checks. Also, unlike earlier versions, development mode is not configured by use of environment variables, which are accessed in disparate ways on the various platforms. In particular, the `NODE_ENV` environment variable now has no effect on triggering development mode. Rather, development mode is either enabled: 1. by setting a 'development' condition, which is possible only on platforms that support `package.json` conditional exports and custom conditions, or 2. by calling `enableDevMode()` within user code. Conditional exports with custom conditions are supported by: Node.js, Deno, Bun, Webpack 5, Rspack, Rollup (via the `node-resolve` plugin), esbuild, Vite, and Rsbuild. create-react-app and Next.js support conditional exports when using Webpack 5 as their bundler. Conditional exports with custom conditions are not supported by Webpack 4, Rollup (without the `node-resolve` plugin), older versions of Deno or transpilers such as swc. create-react-app and Next.js do not support conditional exports with custom conditions when using Webpack 4 as their bundler, nor does Next.js yet support conditional exports with custom conditions when using Turbopack (see vercel/next.js#78912). Testing frameworks such as Mocha, Jest, and Vitest support conditional exports with custom conditions, Integration tests within the repository demonstrate how to enable development mode using the `development` condition on various platforms that support this, as well as enabling development mode by calling `enableDevMode()` within user code. We encourage enabling development mode in a development environment. This facilitates the additional check to ensure that only a single GraphQL.JS module is used. Additional development-time checks may also be added in the future.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
extracted from / based on:
Motivation:
This makes our build product cross-platform by dropping all Node.js specific code.
Differences:
import 'graphql/dev'to enable development mode on platforms that do not support setting custom conditions, while this PR uses:import { enableDevMode } from 'graphql'; enableDevMode()From the docs included in this PR: