diff --git a/.changeset/metal-glasses-bow.md b/.changeset/metal-glasses-bow.md new file mode 100644 index 00000000000..48c99bbf5c7 --- /dev/null +++ b/.changeset/metal-glasses-bow.md @@ -0,0 +1,5 @@ +--- +'graphiql': patch +--- + +update graphql to `16.9.0` and use vite `define` configuration to remove development code from cdn bundle diff --git a/examples/cm6-graphql-legacy-parcel/package.json b/examples/cm6-graphql-legacy-parcel/package.json index 320173bbe95..8a5077a186d 100644 --- a/examples/cm6-graphql-legacy-parcel/package.json +++ b/examples/cm6-graphql-legacy-parcel/package.json @@ -25,7 +25,7 @@ "@codemirror/basic-setup": "^0.20.0", "@codemirror/language": "^0.20.0", "codemirror-graphql": "^2.0.2", - "graphql": "^16.8.1" + "graphql": "^16.9.0" }, "devDependencies": { "parcel-bundler": "^1.12.4", diff --git a/examples/cm6-graphql-parcel/package.json b/examples/cm6-graphql-parcel/package.json index 890d04885d1..2b3770de34c 100644 --- a/examples/cm6-graphql-parcel/package.json +++ b/examples/cm6-graphql-parcel/package.json @@ -29,7 +29,7 @@ "@codemirror/theme-one-dark": "6.0.0", "@codemirror/view": "6.1.2", "cm6-graphql": "0.0.1", - "graphql": "^16.8.1" + "graphql": "^16.9.0" }, "devDependencies": { "parcel": "^2.6.2", diff --git a/examples/graphiql-create-react-app/package.json b/examples/graphiql-create-react-app/package.json index beac9385e65..1625bf662b2 100644 --- a/examples/graphiql-create-react-app/package.json +++ b/examples/graphiql-create-react-app/package.json @@ -4,7 +4,7 @@ "private": true, "dependencies": { "graphiql": "^2.2.0", - "graphql": "^16.8.1", + "graphql": "^16.9.0", "react": "^18.2.0", "react-dom": "^18.2.0", "react-scripts": "5.0.1" diff --git a/examples/graphiql-parcel/package.json b/examples/graphiql-parcel/package.json index 53b1c11d246..293bd6c9ba6 100644 --- a/examples/graphiql-parcel/package.json +++ b/examples/graphiql-parcel/package.json @@ -23,7 +23,7 @@ }, "dependencies": { "graphiql": "^2.2.0", - "graphql": "^16.8.1", + "graphql": "^16.9.0", "react": "^18.2.0", "react-dom": "^18.2.0" }, diff --git a/examples/graphiql-webpack/package.json b/examples/graphiql-webpack/package.json index f276c54542c..ecbc1338459 100644 --- a/examples/graphiql-webpack/package.json +++ b/examples/graphiql-webpack/package.json @@ -14,7 +14,7 @@ "@graphiql/toolkit": "^0.9.2", "@graphiql/react": "^0.23.0", "graphiql": "^3.4.0", - "graphql": "^16.8.1", + "graphql": "^16.9.0", "graphql-ws": "^5.5.5", "react": "^18.2.0", "regenerator-runtime": "^0.13.9" diff --git a/examples/monaco-graphql-nextjs/package.json b/examples/monaco-graphql-nextjs/package.json index 3d7c4dc95f3..6a952a96861 100644 --- a/examples/monaco-graphql-nextjs/package.json +++ b/examples/monaco-graphql-nextjs/package.json @@ -10,7 +10,7 @@ }, "dependencies": { "@graphiql/toolkit": "^0.9.2", - "graphql": "^16.8.1", + "graphql": "^16.9.0", "graphql-ws": "^5.5.5", "jsonc-parser": "^3.2.0", "marked": "^4.2.12", diff --git a/examples/monaco-graphql-react-vite/package.json b/examples/monaco-graphql-react-vite/package.json index fd4f8ce923a..465eed4cf8c 100644 --- a/examples/monaco-graphql-react-vite/package.json +++ b/examples/monaco-graphql-react-vite/package.json @@ -4,7 +4,7 @@ "version": "0.0.0", "dependencies": { "@graphiql/toolkit": "^0.9.2", - "graphql": "^16.8.1", + "graphql": "^16.9.0", "graphql-language-service": "^5.2.2", "jsonc-parser": "^3.2.0", "monaco-editor": "^0.39.0", diff --git a/examples/monaco-graphql-webpack/package.json b/examples/monaco-graphql-webpack/package.json index 093c7f662fe..44963c020ba 100644 --- a/examples/monaco-graphql-webpack/package.json +++ b/examples/monaco-graphql-webpack/package.json @@ -9,7 +9,7 @@ "start": "cross-env NODE_ENV=development webpack-cli serve" }, "dependencies": { - "graphql": "^16.8.1", + "graphql": "^16.9.0", "graphql-language-service": "^5.2.2", "json-schema": "^0.4.0", "jsonc-parser": "^3.2.0", diff --git a/packages/cm6-graphql/package.json b/packages/cm6-graphql/package.json index 74a3fb5832c..5a33799ce55 100644 --- a/packages/cm6-graphql/package.json +++ b/packages/cm6-graphql/package.json @@ -30,7 +30,7 @@ "@lezer/highlight": "^1.0.0", "@lezer/lr": "^1.1.0", "esbuild": "0.18.10", - "graphql": "^16.8.1", + "graphql": "^16.9.0", "rollup": "^2.60.2", "rollup-plugin-dts": "^4.0.1", "rollup-plugin-esbuild": "^4.9.1", diff --git a/packages/codemirror-graphql/package.json b/packages/codemirror-graphql/package.json index 23b29225446..9fcfa64eacb 100644 --- a/packages/codemirror-graphql/package.json +++ b/packages/codemirror-graphql/package.json @@ -51,7 +51,7 @@ "@codemirror/language": "^6.0.0", "codemirror": "^5.65.3", "cross-env": "^7.0.2", - "graphql": "^16.8.1", + "graphql": "^16.9.0", "rimraf": "^3.0.2", "sane": "2.0.0" } diff --git a/packages/graphiql-plugin-code-exporter/package.json b/packages/graphiql-plugin-code-exporter/package.json index 66ca389d957..bbac380204f 100644 --- a/packages/graphiql-plugin-code-exporter/package.json +++ b/packages/graphiql-plugin-code-exporter/package.json @@ -41,7 +41,7 @@ "devDependencies": { "@graphiql/react": "^0.23.0", "@vitejs/plugin-react": "^4.3.1", - "graphql": "^16.8.1", + "graphql": "^16.9.0", "postcss-nesting": "^10.1.7", "react": "^18.2.0", "react-dom": "^18.2.0", diff --git a/packages/graphiql-plugin-explorer/package.json b/packages/graphiql-plugin-explorer/package.json index ed4213f1c44..e6bf56bbcfc 100644 --- a/packages/graphiql-plugin-explorer/package.json +++ b/packages/graphiql-plugin-explorer/package.json @@ -40,7 +40,7 @@ "devDependencies": { "@graphiql/react": "^0.23.0", "@vitejs/plugin-react": "^4.3.1", - "graphql": "^16.8.1", + "graphql": "^16.9.0", "react": "^18.2.0", "react-dom": "^18.2.0", "typescript": "^4.6.3", diff --git a/packages/graphiql-react/package.json b/packages/graphiql-react/package.json index 77b14bb8b4f..8b210faa4c3 100644 --- a/packages/graphiql-react/package.json +++ b/packages/graphiql-react/package.json @@ -70,7 +70,7 @@ "@testing-library/react": "14.0.0", "@types/set-value": "^4.0.1", "@vitejs/plugin-react": "^4.3.1", - "graphql": "^16.8.1", + "graphql": "^16.9.0", "postcss-nesting": "^10.1.7", "react": "^18.2.0", "react-dom": "^18.2.0", diff --git a/packages/graphiql-toolkit/package.json b/packages/graphiql-toolkit/package.json index 20face9b64a..de12f431f79 100644 --- a/packages/graphiql-toolkit/package.json +++ b/packages/graphiql-toolkit/package.json @@ -24,7 +24,7 @@ "meros": "^1.1.4" }, "devDependencies": { - "graphql": "^16.8.1", + "graphql": "^16.9.0", "graphql-ws": "^5.5.5", "isomorphic-fetch": "^3.0.0", "subscriptions-transport-ws": "0.11.0" diff --git a/packages/graphiql/package.json b/packages/graphiql/package.json index 23d505ad8a5..765cbdd9a57 100644 --- a/packages/graphiql/package.json +++ b/packages/graphiql/package.json @@ -55,7 +55,7 @@ "cross-env": "^7.0.2", "cypress": "^13.13.2", "express": "^4.19.2", - "graphql": "^16.8.1", + "graphql": "^16.9.0", "graphql-http": "^1.19.0", "graphql-subscriptions": "^2.0.0", "postcss": "8.4.31", diff --git a/packages/graphiql/vite.config.mts b/packages/graphiql/vite.config.mts index 23959e9a1d9..e5709514b9a 100644 --- a/packages/graphiql/vite.config.mts +++ b/packages/graphiql/vite.config.mts @@ -5,7 +5,9 @@ import commonjs from 'vite-plugin-commonjs'; const umdConfig = defineConfig({ define: { - 'process.env.NODE_ENV': `"${process.env.NODE_ENV}"`, + // https://github.com/graphql/graphql-js/blob/16.x.x/website/docs/tutorials/going-to-production.md#vite + 'globalThis.process': 'true', + 'process.env.NODE_ENV': '"production"', }, // To bundle `const { createClient } = require('graphql-ws')` in `createWebsocketsFetcherFromUrl` function plugins: [commonjs()], diff --git a/packages/graphql-language-service-cli/package.json b/packages/graphql-language-service-cli/package.json index 5aa65f3e105..5bb897de2ac 100644 --- a/packages/graphql-language-service-cli/package.json +++ b/packages/graphql-language-service-cli/package.json @@ -42,6 +42,6 @@ "yargs": "^16.2.0" }, "devDependencies": { - "graphql": "^16.8.1" + "graphql": "^16.9.0" } } diff --git a/packages/graphql-language-service-server/package.json b/packages/graphql-language-service-server/package.json index 98d39128804..4eba4248937 100644 --- a/packages/graphql-language-service-server/package.json +++ b/packages/graphql-language-service-server/package.json @@ -68,7 +68,7 @@ "@types/mock-fs": "^4.13.4", "cross-env": "^7.0.2", "debounce-promise": "^3.1.2", - "graphql": "^16.8.1", + "graphql": "^16.9.0", "mock-fs": "^5.2.0" } } diff --git a/packages/graphql-language-service/package.json b/packages/graphql-language-service/package.json index ac6b50ff1d3..193d4ea226b 100644 --- a/packages/graphql-language-service/package.json +++ b/packages/graphql-language-service/package.json @@ -45,7 +45,7 @@ "@types/json-schema": "7.0.9", "@types/picomatch": "^2.3.0", "benchmark": "^2.1.4", - "graphql": "^16.8.1", + "graphql": "^16.9.0", "graphql-config": "5.0.3", "lodash": "^4.17.15", "platform": "^1.3.5", diff --git a/packages/monaco-graphql/package.json b/packages/monaco-graphql/package.json index 7a08cd9ee81..15b7e2bcc8b 100644 --- a/packages/monaco-graphql/package.json +++ b/packages/monaco-graphql/package.json @@ -71,7 +71,7 @@ }, "devDependencies": { "execa": "^7.1.1", - "graphql": "^16.8.1", + "graphql": "^16.9.0", "monaco-editor": "^0.39.0", "prettier": "3.3.2", "vscode-languageserver-types": "^3.17.1" diff --git a/packages/monaco-graphql/test/monaco-editor.test.ts b/packages/monaco-graphql/test/monaco-editor.test.ts index 018c5c05a52..d1a566717a9 100644 --- a/packages/monaco-graphql/test/monaco-editor.test.ts +++ b/packages/monaco-graphql/test/monaco-editor.test.ts @@ -13,7 +13,7 @@ describe('monaco-editor', () => { // expect(lines[0]).toBe('$ vite build'); // expect(lines[1]).toMatch(' building for production...'); // expect(lines[2]).toBe('transforming...'); - expect(lines[3]).toMatch('✓ 843 modules transformed.'); + expect(lines[3]).toMatch('✓ 844 modules transformed.'); // expect(lines[4]).toBe('rendering chunks...'); // expect(lines[5]).toBe('computing gzip size...'); // expect(lines[6]).toMatch('dist/index.html'); diff --git a/packages/vscode-graphql-execution/package.json b/packages/vscode-graphql-execution/package.json index 655e6dcd5f1..c7af7629bba 100644 --- a/packages/vscode-graphql-execution/package.json +++ b/packages/vscode-graphql-execution/package.json @@ -109,7 +109,7 @@ "cosmiconfig": "8.2.0", "cosmiconfig-toml-loader": "^1.0.0", "dotenv": "10.0.0", - "graphql": "^16.8.1", + "graphql": "^16.9.0", "graphql-config": "5.0.3", "graphql-tag": "2.12.6", "graphql-ws": "5.10.0", diff --git a/packages/vscode-graphql/package.json b/packages/vscode-graphql/package.json index 775e8ca17c9..6aa26d92c70 100644 --- a/packages/vscode-graphql/package.json +++ b/packages/vscode-graphql/package.json @@ -179,7 +179,7 @@ "ovsx": "0.8.3" }, "dependencies": { - "graphql": "^16.8.1", + "graphql": "^16.9.0", "graphql-language-service-server": "^2.13.2", "vscode-languageclient": "8.0.2", "typescript": "^5.3.3" diff --git a/yarn.lock b/yarn.lock index 475b56b132e..60998acc168 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9871,10 +9871,10 @@ graphql-ws@5.14.0, graphql-ws@^5.5.5: resolved "https://registry.yarnpkg.com/graphql-ws/-/graphql-ws-5.14.0.tgz#766f249f3974fc2c48fae0d1fb20c2c4c79cd591" integrity sha512-itrUTQZP/TgswR4GSSYuwWUzrE/w5GhbwM2GX3ic2U7aw33jgEsayfIlvaj7/GcIvZgNMzsPTrE5hqPuFUiE5g== -graphql@^16.8.1: - version "16.8.1" - resolved "https://registry.yarnpkg.com/graphql/-/graphql-16.8.1.tgz#1930a965bef1170603702acdb68aedd3f3cf6f07" - integrity sha512-59LZHPdGZVh695Ud9lRzPBVTtlX9ZCV150Er2W43ro37wVof0ctenSaskPPjN7lVTIN8mSZt8PHUNKZuNQUuxw== +graphql@^16.9.0: + version "16.9.0" + resolved "https://registry.yarnpkg.com/graphql/-/graphql-16.9.0.tgz#1c310e63f16a49ce1fbb230bd0a000e99f6f115f" + integrity sha512-GGTKBX4SD7Wdb8mqeDLni2oaRGYQWjWHGKPQ24ZMnUtKfcsVoiv4uX8+LJr1K6U5VW2Lu1BwJnj7uiori0YtRw== handle-thing@^2.0.0: version "2.0.1"