Skip to content

Commit

Permalink
[4] update graphql to 16.9.0 and use vite define configuration to…
Browse files Browse the repository at this point in the history
… remove development code from cdn bundle (#3683)

* vite

more

more

more

* fix demo

* fix cspell

* fix dev

* update cypress to v13

* upd cache key

* remove webpack deps

* fix `yarn jest --coverage`

* upd graphql

* aa

* yarn.lock

* fix tests
  • Loading branch information
dimaMachina authored Aug 7, 2024
1 parent 955573a commit 8efb873
Show file tree
Hide file tree
Showing 25 changed files with 34 additions and 27 deletions.
5 changes: 5 additions & 0 deletions .changeset/metal-glasses-bow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'graphiql': patch
---

update graphql to `16.9.0` and use vite `define` configuration to remove development code from cdn bundle
2 changes: 1 addition & 1 deletion examples/cm6-graphql-legacy-parcel/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion examples/cm6-graphql-parcel/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion examples/graphiql-create-react-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion examples/graphiql-parcel/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand Down
2 changes: 1 addition & 1 deletion examples/graphiql-webpack/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion examples/monaco-graphql-nextjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion examples/monaco-graphql-react-vite/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion examples/monaco-graphql-webpack/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion packages/cm6-graphql/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion packages/codemirror-graphql/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
Expand Down
2 changes: 1 addition & 1 deletion packages/graphiql-plugin-code-exporter/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion packages/graphiql-plugin-explorer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion packages/graphiql-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion packages/graphiql-toolkit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion packages/graphiql/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 3 additions & 1 deletion packages/graphiql/vite.config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -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()],
Expand Down
2 changes: 1 addition & 1 deletion packages/graphql-language-service-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,6 @@
"yargs": "^16.2.0"
},
"devDependencies": {
"graphql": "^16.8.1"
"graphql": "^16.9.0"
}
}
2 changes: 1 addition & 1 deletion packages/graphql-language-service-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
2 changes: 1 addition & 1 deletion packages/graphql-language-service/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion packages/monaco-graphql/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion packages/monaco-graphql/test/monaco-editor.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
2 changes: 1 addition & 1 deletion packages/vscode-graphql-execution/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion packages/vscode-graphql/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 8efb873

Please sign in to comment.