From 81b37b2249bfb239d1f24bf7e4f97efefa8f8611 Mon Sep 17 00:00:00 2001 From: Valentin Cocaud Date: Thu, 12 Oct 2023 16:59:17 +0200 Subject: [PATCH 01/10] add v5 to docs --- .prettierignore | 2 + website/remote-files/v4.json | 111 ++++++++++++++++++ website/src/lib/v4-get-static-props.ts | 49 ++++++++ website/src/pages/_meta.json | 6 +- .../docs/migration/migration-from-yoga-v4.mdx | 37 ++++++ website/src/pages/v4/[[...slug]].mdx | 17 +++ website/src/pages/v4/_meta.js | 6 + 7 files changed, 227 insertions(+), 1 deletion(-) create mode 100644 website/remote-files/v4.json create mode 100644 website/src/lib/v4-get-static-props.ts create mode 100644 website/src/pages/docs/migration/migration-from-yoga-v4.mdx create mode 100644 website/src/pages/v4/[[...slug]].mdx create mode 100644 website/src/pages/v4/_meta.js diff --git a/.prettierignore b/.prettierignore index f699a8e90..503e7c832 100644 --- a/.prettierignore +++ b/.prettierignore @@ -23,3 +23,5 @@ website/src/pages/v2/_meta.js website/src/lib/v2-get-static-props.ts website/src/pages/v3/_meta.js website/src/lib/v3-get-static-props.ts +website/src/pages/v4/_meta.js +website/src/lib/v4-get-static-props.ts diff --git a/website/remote-files/v4.json b/website/remote-files/v4.json new file mode 100644 index 000000000..6d89665de --- /dev/null +++ b/website/remote-files/v4.json @@ -0,0 +1,111 @@ +{ + "user": "dotansimha", + "repo": "graphql-yoga", + "branch": "4cbba6d9daa7bb37dfcecd7ef1c5ed25443a906e", + "docsPath": "website/src/pages/docs/", + "filePaths": [ + "features/apollo-federation.mdx", + "features/automatic-persisted-queries.mdx", + "features/context.mdx", + "features/cookies.mdx", + "features/cors.mdx", + "features/csrf-prevention.mdx", + "features/defer-stream.mdx", + "features/envelop-plugins.mdx", + "features/error-masking.mdx", + "features/file-uploads.mdx", + "features/graphiql.mdx", + "features/health-check.mdx", + "features/introspection.mdx", + "features/jwt.mdx", + "features/logging-and-debugging.mdx", + "features/parsing-and-validation-caching.mdx", + "features/persisted-operations.mdx", + "features/request-batching.mdx", + "features/response-caching.mdx", + "features/schema.mdx", + "features/sofa-api.mdx", + "features/subscriptions.mdx", + "features/testing.mdx", + "index.mdx", + "integrations/integration-with-aws-lambda.mdx", + "integrations/integration-with-bun.mdx", + "integrations/integration-with-cloudflare-workers.mdx", + "integrations/integration-with-deno.mdx", + "integrations/integration-with-express.mdx", + "integrations/integration-with-fastify.mdx", + "integrations/integration-with-gcp.mdx", + "integrations/integration-with-hapi.mdx", + "integrations/integration-with-koa.mdx", + "integrations/integration-with-nestjs.mdx", + "integrations/integration-with-nextjs.mdx", + "integrations/integration-with-sveltekit.mdx", + "integrations/integration-with-uwebsockets.mdx", + "integrations/z-other-environments.mdx", + "migration/migration-from-apollo-server.mdx", + "migration/migration-from-express-graphql.mdx", + "migration/migration-from-yoga-v1.mdx", + "migration/migration-from-yoga-v2.mdx", + "migration/migration-from-yoga-v3.mdx" + ], + "nestedMeta": { + "index": "Quick Start", + "features": { + "type": "folder", + "items": { + "schema": "GraphQL Schema", + "graphiql": "GraphiQL", + "context": "GraphQL Context", + "error-masking": "Error Masking", + "introspection": "Introspection", + "subscriptions": "Subscriptions", + "file-uploads": "File Uploads", + "defer-stream": "Defer and Stream", + "request-batching": "Request Batching", + "cors": "CORS", + "csrf-prevention": "CSRF Prevention", + "parsing-and-validation-caching": "Parsing and Validation Caching", + "response-caching": "Response Caching", + "persisted-operations": "Persisted Operations", + "automatic-persisted-queries": "Automatic Persisted Queries", + "logging-and-debugging": "Logging and Debugging", + "health-check": "Health Check", + "sofa-api": "REST API", + "cookies": "Cookies", + "apollo-federation": "Apollo Federation", + "envelop-plugins": "Plugins", + "testing": "Testing", + "jwt": "JWT" + } + }, + "integrations": { + "type": "folder", + "items": { + "integration-with-aws-lambda": "AWS Lambda", + "integration-with-cloudflare-workers": "Cloudflare Workers", + "integration-with-gcp": "Google Cloud Platform", + "integration-with-deno": "Deno", + "integration-with-express": "Express", + "integration-with-fastify": "Fastify", + "integration-with-koa": "Koa", + "integration-with-nestjs": "NestJS", + "integration-with-nextjs": "Next.js", + "integration-with-sveltekit": "SvelteKit", + "integration-with-hapi": "Hapi", + "integration-with-bun": "Bun", + "integration-with-uwebsockets": "µWebSockets.js", + "z-other-environments": "Other Environments" + } + }, + "migration": { + "type": "folder", + "items": { + "migration-from-apollo-server": "Apollo Server", + "migration-from-express-graphql": "Express GraphQL", + "migration-from-yoga-v1": "Yoga v1", + "migration-from-yoga-v2": "Yoga v2", + "migration-from-yoga-v3": "Yoga v3" + } + } + } +} diff --git a/website/src/lib/v4-get-static-props.ts b/website/src/lib/v4-get-static-props.ts new file mode 100644 index 000000000..ebbbfd3b1 --- /dev/null +++ b/website/src/lib/v4-get-static-props.ts @@ -0,0 +1,49 @@ +import { GetStaticPaths, GetStaticProps } from 'next' +import { buildDynamicMDX, buildDynamicMeta } from 'nextra/remote' +import { defaultRemarkPlugins } from '@theguild/components/next.config' +import json from '../../remote-files/v4.json' assert { type: 'json' } +import { remarkLinkRewrite } from 'nextra/mdx-plugins' + +const { user, repo, branch, docsPath, filePaths } = json + +export const getStaticPaths: GetStaticPaths = async () => ({ + fallback: 'blocking', + paths: filePaths + // this fix `TOO MANY REDIRECTS` error in CF + .map((filePath) => filePath.replace(/\/?index\.mdx?$/, '')) + .map((filePath) => ({ + params: { slug: filePath.replace(/\.mdx?$/, '').split('/') }, + })), +}) + +export const getStaticProps: GetStaticProps< + { + __nextra_dynamic_mdx: string + __nextra_dynamic_opts: string + }, + { slug?: string[] } +> = async ({ params }) => { + const path = params?.slug?.join('/') ?? 'index' + const foundPath = filePaths.find((filePath) => filePath.startsWith(path)) + + const baseURL = `https://raw.githubusercontent.com/${user}/${repo}/${branch}/${docsPath}${foundPath}` + const response = await fetch(baseURL) + const data = await response.text() + + const mdx = await buildDynamicMDX(data, { + defaultShowCopyCode: true, + mdxOptions: { + remarkPlugins: [ + ...defaultRemarkPlugins, + [remarkLinkRewrite, { pattern: /^\/docs(\/.*)?$/, replace: '/v2$1' }], + ], + }, + }) + + return { + props: { + ...mdx, + ...(await buildDynamicMeta()), + }, + } +} diff --git a/website/src/pages/_meta.json b/website/src/pages/_meta.json index 8ab24bdf6..1c46a048c 100644 --- a/website/src/pages/_meta.json +++ b/website/src/pages/_meta.json @@ -8,7 +8,11 @@ } }, "docs": { - "title": "v4 (latest)", + "title": "v5 (latest)", + "type": "page" + }, + "v4": { + "title": "v4", "type": "page" }, "v3": { diff --git a/website/src/pages/docs/migration/migration-from-yoga-v4.mdx b/website/src/pages/docs/migration/migration-from-yoga-v4.mdx new file mode 100644 index 000000000..091628b44 --- /dev/null +++ b/website/src/pages/docs/migration/migration-from-yoga-v4.mdx @@ -0,0 +1,37 @@ +# Migration from Yoga V4 + +## Install the new NPM package + +```sh npm2yarn +npm i graphql-yoga +``` + +## 1. Drop support for Node.js v16 + +Node.js v16 is no longer supported by the Node.js team. +https://github.com/nodejs/Release/#end-of-life-releases + +## 2. Plugin execution order is now more predictable + +To allow more code reuse, plugins can automatically add other plugin on which they depend. For this, +they use `addPlugin` method of the `onPluginInit` hook. + +```ts +const plugin: Plugin = { + onPluginInit({ addPlugin }) { + addPlugin(useAnotherPlugin()) + } +} +``` + +However, `addPlugin` method behavior was not the one expected by most users. It was adding the +plugin at the end of the plugin list. This means that the added plugin hooks were executed last, +after all other plugins. + +In `v4`, the plugin is now added inplace in the plugin list. This means the added plugin hooks are +executed immediately after the plugin that added them. This leads for a more predictable behaviour +from an end user perspective, but can lead to unexpected results if a plugin relyed on the previous +behaviour. + +The best mitigation, if the plugin really need to execute some hooks last, is to split the plugin in +2 plugins and clearly state the dependency between them. diff --git a/website/src/pages/v4/[[...slug]].mdx b/website/src/pages/v4/[[...slug]].mdx new file mode 100644 index 000000000..ed3a49f28 --- /dev/null +++ b/website/src/pages/v4/[[...slug]].mdx @@ -0,0 +1,17 @@ +import { RemoteContent } from 'nextra/data' +import { Callout, LegacyPackageCmd, mdxComponents, Tab, Tabs } from '@theguild/components' + +export { getStaticPaths, getStaticProps } from '../../lib/v4-get-static-props' + +import CodegenCallout from '../../components/codegen-callout.mdx' + + diff --git a/website/src/pages/v4/_meta.js b/website/src/pages/v4/_meta.js new file mode 100644 index 000000000..8e208352d --- /dev/null +++ b/website/src/pages/v4/_meta.js @@ -0,0 +1,6 @@ +import { createCatchAllMeta } from 'nextra/catch-all' +import json from '../../../remote-files/v4.json' assert { type: 'json' } + +export default async () => { + return createCatchAllMeta(json.filePaths, json.nestedMeta) +} From 5421920c668ec937dff83f19fd6a963dfd4f2ee1 Mon Sep 17 00:00:00 2001 From: Valentin Cocaud Date: Thu, 12 Oct 2023 17:20:23 +0200 Subject: [PATCH 02/10] add warning on old v4 docs --- website/next.config.js | 8 ++++++++ website/src/pages/v4/[[...slug]].mdx | 2 ++ website/theme.config.tsx | 18 ++++++++++++++++-- 3 files changed, 26 insertions(+), 2 deletions(-) diff --git a/website/next.config.js b/website/next.config.js index f45769021..5208e5a01 100644 --- a/website/next.config.js +++ b/website/next.config.js @@ -19,6 +19,14 @@ export default withGuildDocs({ route: '/v3', frontMatter: {}, }); + pageOpts.pageMap + .find(o => o.kind === 'Folder' && o.name === 'v4') + .children.push({ + kind: 'MdxPage', + name: 'index', + route: '/v4', + frontMatter: {}, + }); return pageOpts; }, redirects: () => diff --git a/website/src/pages/v4/[[...slug]].mdx b/website/src/pages/v4/[[...slug]].mdx index ed3a49f28..92470fe23 100644 --- a/website/src/pages/v4/[[...slug]].mdx +++ b/website/src/pages/v4/[[...slug]].mdx @@ -12,6 +12,8 @@ import CodegenCallout from '../../components/codegen-callout.mdx' PackageCmd: LegacyPackageCmd, Tab, Tabs, + $Tab: Tab, + $Tabs: Tabs, CodegenCallout }} /> diff --git a/website/theme.config.tsx b/website/theme.config.tsx index f15caa270..c3ba2bcea 100644 --- a/website/theme.config.tsx +++ b/website/theme.config.tsx @@ -52,7 +52,7 @@ export default defineConfig({ {route.startsWith('/v2') && ( This is the documentation for the old GraphQL Yoga version 2. We recommend - upgrading to the latest GraphQL Yoga version 4. + upgrading to the latest GraphQL Yoga version 5.

This is the documentation for the old GraphQL Yoga version 3. We recommend - upgrading to the latest GraphQL Yoga version 4. + upgrading to the latest GraphQL Yoga version 5.

)} + {route.startsWith('/v4') && ( + + This is the documentation for the old GraphQL Yoga version 4. We recommend + upgrading to the latest GraphQL Yoga version 5. +
+
+ + Get started with GraphQL Yoga v5 + +
+ )} {children} {comments} From 7d178520eeb3a7bc41fb000e660a2ed02d24d858 Mon Sep 17 00:00:00 2001 From: Valentin Cocaud Date: Thu, 12 Oct 2023 17:23:30 +0200 Subject: [PATCH 03/10] fix migration callout message --- website/theme.config.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/website/theme.config.tsx b/website/theme.config.tsx index c3ba2bcea..61b6ecf5c 100644 --- a/website/theme.config.tsx +++ b/website/theme.config.tsx @@ -59,7 +59,7 @@ export default defineConfig({ href="/docs/migration/migration-from-yoga-v2" className="nx-text-primary-600 nx-underline nx-decoration-from-font [text-underline-position:from-font]" > - Get started with GraphQL Yoga v4 + Migrate to GraphQL Yoga v5 )} @@ -73,7 +73,7 @@ export default defineConfig({ href="/docs/migration/migration-from-yoga-v3" className="nx-text-primary-600 nx-underline nx-decoration-from-font [text-underline-position:from-font]" > - Get started with GraphQL Yoga v4 + Migrate to GraphQL Yoga v5 )} @@ -87,7 +87,7 @@ export default defineConfig({ href="/docs/migration/migration-from-yoga-v4" className="nx-text-primary-600 nx-underline nx-decoration-from-font [text-underline-position:from-font]" > - Get started with GraphQL Yoga v5 + Migrate to GraphQL Yoga v5 )} From 51dede6c51525a7bb4a2f71171d410e77bf69760 Mon Sep 17 00:00:00 2001 From: Valentin Cocaud Date: Thu, 12 Oct 2023 17:29:10 +0200 Subject: [PATCH 04/10] drop Node 16 --- packages/client/apollo-link/package.json | 2 +- packages/client/urql-exchange/package.json | 2 +- packages/event-target/redis-event-target/package.json | 2 +- packages/event-target/typed-event-target/package.json | 2 +- packages/graphql-yoga/package.json | 2 +- packages/logger/package.json | 2 +- packages/nestjs-federation/package.json | 2 +- packages/nestjs/package.json | 2 +- packages/plugins/apollo-inline-trace/package.json | 2 +- packages/plugins/apq/package.json | 2 +- packages/plugins/csrf-prevention/package.json | 2 +- packages/plugins/defer-stream/package.json | 2 +- packages/plugins/disable-introspection/package.json | 2 +- packages/plugins/graphql-sse/package.json | 2 +- packages/plugins/jwt/package.json | 2 +- packages/plugins/persisted-operations/package.json | 2 +- packages/plugins/prometheus/package.json | 2 +- packages/plugins/response-cache/package.json | 2 +- packages/plugins/sofa/package.json | 2 +- packages/render-graphiql/package.json | 2 +- packages/subscription/package.json | 2 +- 21 files changed, 21 insertions(+), 21 deletions(-) diff --git a/packages/client/apollo-link/package.json b/packages/client/apollo-link/package.json index f88ec75d6..dd0f9cbcc 100644 --- a/packages/client/apollo-link/package.json +++ b/packages/client/apollo-link/package.json @@ -11,7 +11,7 @@ "author": "Arda TANRIKULU ", "license": "MIT", "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" }, "main": "dist/cjs/index.js", "module": "dist/esm/index.js", diff --git a/packages/client/urql-exchange/package.json b/packages/client/urql-exchange/package.json index 83a1d7efd..0faea3083 100644 --- a/packages/client/urql-exchange/package.json +++ b/packages/client/urql-exchange/package.json @@ -11,7 +11,7 @@ "author": "Arda TANRIKULU ", "license": "MIT", "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" }, "main": "dist/cjs/index.js", "module": "dist/esm/index.js", diff --git a/packages/event-target/redis-event-target/package.json b/packages/event-target/redis-event-target/package.json index 2d78ead61..cfe383a67 100644 --- a/packages/event-target/redis-event-target/package.json +++ b/packages/event-target/redis-event-target/package.json @@ -11,7 +11,7 @@ "author": "Laurin Quast ", "license": "MIT", "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" }, "main": "dist/cjs/index.js", "module": "dist/esm/index.js", diff --git a/packages/event-target/typed-event-target/package.json b/packages/event-target/typed-event-target/package.json index 79e6d3b83..a9441813b 100644 --- a/packages/event-target/typed-event-target/package.json +++ b/packages/event-target/typed-event-target/package.json @@ -11,7 +11,7 @@ "author": "Laurin Quast ", "license": "MIT", "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" }, "main": "dist/cjs/index.js", "module": "dist/esm/index.js", diff --git a/packages/graphql-yoga/package.json b/packages/graphql-yoga/package.json index 7349846ea..5c29357ec 100644 --- a/packages/graphql-yoga/package.json +++ b/packages/graphql-yoga/package.json @@ -11,7 +11,7 @@ "author": "Saihajpreet Singh (https://saihaj.dev/)", "license": "MIT", "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" }, "main": "dist/cjs/index.js", "module": "dist/esm/index.js", diff --git a/packages/logger/package.json b/packages/logger/package.json index e564db234..5e7d7437c 100644 --- a/packages/logger/package.json +++ b/packages/logger/package.json @@ -10,7 +10,7 @@ }, "license": "MIT", "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" }, "main": "dist/cjs/index.js", "module": "dist/esm/index.js", diff --git a/packages/nestjs-federation/package.json b/packages/nestjs-federation/package.json index b65320330..83cbc2488 100644 --- a/packages/nestjs-federation/package.json +++ b/packages/nestjs-federation/package.json @@ -11,7 +11,7 @@ "author": "Denis Badurina ", "license": "MIT", "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" }, "main": "dist/cjs/index.js", "module": "dist/esm/index.js", diff --git a/packages/nestjs/package.json b/packages/nestjs/package.json index 11443ad63..d15e896af 100644 --- a/packages/nestjs/package.json +++ b/packages/nestjs/package.json @@ -11,7 +11,7 @@ "author": "Denis Badurina ", "license": "MIT", "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" }, "main": "dist/cjs/index.js", "module": "dist/esm/index.js", diff --git a/packages/plugins/apollo-inline-trace/package.json b/packages/plugins/apollo-inline-trace/package.json index ce0d87726..f24b6f82b 100644 --- a/packages/plugins/apollo-inline-trace/package.json +++ b/packages/plugins/apollo-inline-trace/package.json @@ -11,7 +11,7 @@ "author": "Denis Badurina ", "license": "MIT", "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" }, "main": "dist/cjs/index.js", "module": "dist/esm/index.js", diff --git a/packages/plugins/apq/package.json b/packages/plugins/apq/package.json index e1889875d..68aead9d0 100644 --- a/packages/plugins/apq/package.json +++ b/packages/plugins/apq/package.json @@ -11,7 +11,7 @@ "author": "Arda TANRIKULU ", "license": "MIT", "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" }, "main": "dist/cjs/index.js", "module": "dist/esm/index.js", diff --git a/packages/plugins/csrf-prevention/package.json b/packages/plugins/csrf-prevention/package.json index 694f5d230..900286a8e 100644 --- a/packages/plugins/csrf-prevention/package.json +++ b/packages/plugins/csrf-prevention/package.json @@ -11,7 +11,7 @@ "author": "Denis Badurina ", "license": "MIT", "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" }, "main": "dist/cjs/index.js", "module": "dist/esm/index.js", diff --git a/packages/plugins/defer-stream/package.json b/packages/plugins/defer-stream/package.json index a7a48b52e..df580001c 100644 --- a/packages/plugins/defer-stream/package.json +++ b/packages/plugins/defer-stream/package.json @@ -11,7 +11,7 @@ "author": "Saihajpreet Singh ", "license": "MIT", "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" }, "main": "dist/cjs/index.js", "module": "dist/esm/index.js", diff --git a/packages/plugins/disable-introspection/package.json b/packages/plugins/disable-introspection/package.json index dddb311eb..6b2b14fd1 100644 --- a/packages/plugins/disable-introspection/package.json +++ b/packages/plugins/disable-introspection/package.json @@ -11,7 +11,7 @@ "author": "Laurin Quast ", "license": "MIT", "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" }, "main": "dist/cjs/index.js", "module": "dist/esm/index.js", diff --git a/packages/plugins/graphql-sse/package.json b/packages/plugins/graphql-sse/package.json index cd636bca2..ea971f12b 100644 --- a/packages/plugins/graphql-sse/package.json +++ b/packages/plugins/graphql-sse/package.json @@ -11,7 +11,7 @@ "author": "Denis Badurina ", "license": "MIT", "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" }, "main": "dist/cjs/index.js", "module": "dist/esm/index.js", diff --git a/packages/plugins/jwt/package.json b/packages/plugins/jwt/package.json index ee7f1fb82..20cd177e1 100644 --- a/packages/plugins/jwt/package.json +++ b/packages/plugins/jwt/package.json @@ -11,7 +11,7 @@ "author": "Arda TANRIKULU ", "license": "MIT", "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" }, "main": "dist/cjs/index.js", "module": "dist/esm/index.js", diff --git a/packages/plugins/persisted-operations/package.json b/packages/plugins/persisted-operations/package.json index 38da5a68e..9ae510a9a 100644 --- a/packages/plugins/persisted-operations/package.json +++ b/packages/plugins/persisted-operations/package.json @@ -11,7 +11,7 @@ "author": "Arda TANRIKULU ", "license": "MIT", "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" }, "main": "dist/cjs/index.js", "module": "dist/esm/index.js", diff --git a/packages/plugins/prometheus/package.json b/packages/plugins/prometheus/package.json index 8ae1f1ec0..d1b7fc0ef 100644 --- a/packages/plugins/prometheus/package.json +++ b/packages/plugins/prometheus/package.json @@ -11,7 +11,7 @@ "author": "Arda TANRIKULU ", "license": "MIT", "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" }, "main": "dist/cjs/index.js", "module": "dist/esm/index.js", diff --git a/packages/plugins/response-cache/package.json b/packages/plugins/response-cache/package.json index 728c88c13..d4fac1943 100644 --- a/packages/plugins/response-cache/package.json +++ b/packages/plugins/response-cache/package.json @@ -11,7 +11,7 @@ "author": "Arda TANRIKULU ", "license": "MIT", "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" }, "main": "dist/cjs/index.js", "module": "dist/esm/index.js", diff --git a/packages/plugins/sofa/package.json b/packages/plugins/sofa/package.json index 87a0e1fc1..a59829eb3 100644 --- a/packages/plugins/sofa/package.json +++ b/packages/plugins/sofa/package.json @@ -11,7 +11,7 @@ "author": "Arda TANRIKULU ", "license": "MIT", "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" }, "main": "dist/cjs/index.js", "module": "dist/esm/index.js", diff --git a/packages/render-graphiql/package.json b/packages/render-graphiql/package.json index 6a1fea563..1fd0b96a6 100644 --- a/packages/render-graphiql/package.json +++ b/packages/render-graphiql/package.json @@ -11,7 +11,7 @@ "author": "Laurin Quast ", "license": "MIT", "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" }, "main": "dist/cjs/index.js", "module": "dist/esm/index.js", diff --git a/packages/subscription/package.json b/packages/subscription/package.json index 29b42c699..e2b3f50b3 100644 --- a/packages/subscription/package.json +++ b/packages/subscription/package.json @@ -11,7 +11,7 @@ "author": "Laurin Quast ", "license": "MIT", "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" }, "main": "dist/cjs/index.js", "module": "dist/esm/index.js", From 96bf16b953edf667f4068600be3f4cf32b73ff0c Mon Sep 17 00:00:00 2001 From: Valentin Cocaud Date: Thu, 12 Oct 2023 17:29:22 +0200 Subject: [PATCH 05/10] update CI --- .github/workflows/benchmark.yml | 2 +- .github/workflows/ci.yml | 10 +++++----- .github/workflows/deployment-e2e.yml | 2 +- .github/workflows/pr.yml | 6 +++--- .github/workflows/release.yml | 2 +- .github/workflows/website-integrity.yml | 2 +- .github/workflows/website.yml | 2 +- 7 files changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index 6b4837b73..0377823c9 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -17,7 +17,7 @@ jobs: - name: Setup env uses: the-guild-org/shared-config/setup@main with: - nodeVersion: 18 + nodeVersion: 20 packageManager: pnpm - name: Build Packages diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f744a110e..9c4b5c1a7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,7 +16,7 @@ jobs: strategy: fail-fast: false matrix: - node-version: [16, 18, 20] + node-version: [18, 20] graphql-version: ['15.8.0', '16.6.0'] steps: - name: Checkout Repository @@ -66,7 +66,7 @@ jobs: strategy: fail-fast: false matrix: - node-version: [16, 18] + node-version: [18, 20] graphql-version: ['15.8.0', '16.6.0'] steps: - name: Checkout Repository @@ -116,7 +116,7 @@ jobs: strategy: fail-fast: false matrix: - node-version: [16, 18] + node-version: [18, 20] graphql-version: ['15.8.0', '16.6.0'] steps: - name: Checkout Repository @@ -169,7 +169,7 @@ jobs: - name: Setup env uses: the-guild-org/shared-config/setup@main with: - nodeVersion: 18 + nodeVersion: 20 packageManager: pnpm - name: Build Packages @@ -187,7 +187,7 @@ jobs: - name: Setup env uses: the-guild-org/shared-config/setup@main with: - nodeVersion: 18 + nodeVersion: 20 packageManager: pnpm - name: Setup Bun Runtime diff --git a/.github/workflows/deployment-e2e.yml b/.github/workflows/deployment-e2e.yml index e088c33bf..13329d9f2 100644 --- a/.github/workflows/deployment-e2e.yml +++ b/.github/workflows/deployment-e2e.yml @@ -21,7 +21,7 @@ jobs: - name: Setup env uses: the-guild-org/shared-config/setup@main with: - nodeVersion: 18 + nodeVersion: 20 packageManager: pnpm - name: Build Packages diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 9db8eba12..40332b99c 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -12,7 +12,7 @@ jobs: with: npmTag: alpha buildScript: build - nodeVersion: 18 + nodeVersion: 20 packageManager: pnpm secrets: githubToken: ${{ secrets.GITHUB_TOKEN }} @@ -25,7 +25,7 @@ jobs: npmTag: rc restoreDeletedChangesets: true buildScript: build - nodeVersion: 18 + nodeVersion: 20 packageManager: pnpm secrets: githubToken: ${{ secrets.GITHUB_TOKEN }} @@ -39,4 +39,4 @@ jobs: with: installDependencies: true packageManager: pnpm - nodeVersion: 18 + nodeVersion: 20 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0c42e9998..954be7af1 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -10,7 +10,7 @@ jobs: if: ${{ github.event.pull_request.title != 'Upcoming Release Changes' }} with: releaseScript: release - nodeVersion: 18 + nodeVersion: 20 packageManager: pnpm secrets: githubToken: ${{ secrets.GUILD_BOT_TOKEN }} diff --git a/.github/workflows/website-integrity.yml b/.github/workflows/website-integrity.yml index ccad2ebfc..2ed8796dc 100644 --- a/.github/workflows/website-integrity.yml +++ b/.github/workflows/website-integrity.yml @@ -17,7 +17,7 @@ jobs: - name: Setup env uses: the-guild-org/shared-config/setup@main with: - nodeVersion: 18 + nodeVersion: 20 packageManager: pnpm - name: Build Packages diff --git a/.github/workflows/website.yml b/.github/workflows/website.yml index 9f73bac62..d787ced40 100644 --- a/.github/workflows/website.yml +++ b/.github/workflows/website.yml @@ -23,7 +23,7 @@ jobs: - uses: the-guild-org/shared-config/setup@main name: setup env with: - nodeVersion: 18 + nodeVersion: 20 packageManager: pnpm - uses: the-guild-org/shared-config/website-cf@main From 05db1fc5d92d36d499805c9a672d6462e69508df Mon Sep 17 00:00:00 2001 From: Valentin Cocaud Date: Fri, 13 Oct 2023 12:02:24 +0200 Subject: [PATCH 06/10] Node 20 http package is leaking, testing only against 18 --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9c4b5c1a7..fe4e64988 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -116,7 +116,7 @@ jobs: strategy: fail-fast: false matrix: - node-version: [18, 20] + node-version: [18] graphql-version: ['15.8.0', '16.6.0'] steps: - name: Checkout Repository From feca8bfab77cd509efe54af736c866d7e07d543e Mon Sep 17 00:00:00 2001 From: Valentin Cocaud Date: Fri, 13 Oct 2023 12:04:19 +0200 Subject: [PATCH 07/10] update tsconfig for Node 18 targe --- tsconfig.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tsconfig.json b/tsconfig.json index adc1d6a3e..677eddf4f 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -6,8 +6,8 @@ "allowSyntheticDefaultImports": true, "importHelpers": true, "experimentalDecorators": true, - "module": "node16", - "target": "es2021", + "module": "NodeNext", + "target": "es2022", "lib": ["esnext"], "moduleResolution": "node", "emitDecoratorMetadata": true, From 90b7d5f35688fb5d0a3897f61fb66e5ceabfb6f3 Mon Sep 17 00:00:00 2001 From: Valentin Cocaud Date: Fri, 13 Oct 2023 12:06:18 +0200 Subject: [PATCH 08/10] changeset --- .changeset/fifty-onions-impress.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .changeset/fifty-onions-impress.md diff --git a/.changeset/fifty-onions-impress.md b/.changeset/fifty-onions-impress.md new file mode 100644 index 000000000..7c2d3986f --- /dev/null +++ b/.changeset/fifty-onions-impress.md @@ -0,0 +1,25 @@ +--- +'@graphql-yoga/redis-event-target': major +'@graphql-yoga/typed-event-target': major +'@graphql-yoga/plugin-disable-introspection': major +'@graphql-yoga/plugin-persisted-operations': major +'@graphql-yoga/plugin-apollo-inline-trace': major +'@graphql-yoga/plugin-csrf-prevention': major +'@graphql-yoga/plugin-response-cache': major +'@graphql-yoga/urql-exchange': major +'@graphql-yoga/plugin-defer-stream': major +'@graphql-yoga/plugin-graphql-sse': major +'@graphql-yoga/apollo-link': major +'@graphql-yoga/plugin-prometheus': major +'@graphql-yoga/nestjs-federation': major +'@graphql-yoga/render-graphiql': major +'graphql-yoga': major +'@graphql-yoga/plugin-sofa': major +'@graphql-yoga/subscription': major +'@graphql-yoga/plugin-apq': major +'@graphql-yoga/plugin-jwt': major +'@graphql-yoga/logger': major +'@graphql-yoga/nestjs': major +--- + +**Breaking Change:** Drop support of Node.js 16 From ddd17f45474acbb66f2f6adf2e84cccc9680b8d9 Mon Sep 17 00:00:00 2001 From: Valentin Cocaud Date: Mon, 16 Oct 2023 15:10:31 +0200 Subject: [PATCH 09/10] forgot root package --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 6587f3fb8..77737c3dd 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,7 @@ "private": true, "packageManager": "pnpm@8.6.1", "engines": { - "node": ">=16.14", + "node": ">=18.0.0", "pnpm": ">=8.6.1" }, "keywords": [ From 021ff90e11348462da6834d67ee91ae7eab0c540 Mon Sep 17 00:00:00 2001 From: Valentin Cocaud Date: Mon, 16 Oct 2023 15:13:21 +0200 Subject: [PATCH 10/10] mark envelop update as a major bump --- .changeset/@graphql-yoga_nestjs-federation-3070-dependencies.md | 2 +- ...graphql-yoga_plugin-apollo-inline-trace-3070-dependencies.md | 2 +- .changeset/@graphql-yoga_plugin-prometheus-3050-dependencies.md | 2 +- .changeset/@graphql-yoga_plugin-prometheus-3070-dependencies.md | 2 +- .../@graphql-yoga_plugin-response-cache-3070-dependencies.md | 2 +- .changeset/graphql-yoga-3070-dependencies.md | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.changeset/@graphql-yoga_nestjs-federation-3070-dependencies.md b/.changeset/@graphql-yoga_nestjs-federation-3070-dependencies.md index 9da95368b..447376124 100644 --- a/.changeset/@graphql-yoga_nestjs-federation-3070-dependencies.md +++ b/.changeset/@graphql-yoga_nestjs-federation-3070-dependencies.md @@ -1,5 +1,5 @@ --- -'@graphql-yoga/nestjs-federation': patch +'@graphql-yoga/nestjs-federation': major --- dependencies updates: - Updated dependency [`@envelop/apollo-federation@^5.0.0` diff --git a/.changeset/@graphql-yoga_plugin-apollo-inline-trace-3070-dependencies.md b/.changeset/@graphql-yoga_plugin-apollo-inline-trace-3070-dependencies.md index 93b956ef9..f704abdfb 100644 --- a/.changeset/@graphql-yoga_plugin-apollo-inline-trace-3070-dependencies.md +++ b/.changeset/@graphql-yoga_plugin-apollo-inline-trace-3070-dependencies.md @@ -1,5 +1,5 @@ --- -'@graphql-yoga/plugin-apollo-inline-trace': patch +'@graphql-yoga/plugin-apollo-inline-trace': major --- dependencies updates: - Updated dependency [`@envelop/on-resolve@^4.0.0` diff --git a/.changeset/@graphql-yoga_plugin-prometheus-3050-dependencies.md b/.changeset/@graphql-yoga_plugin-prometheus-3050-dependencies.md index 8061c8e1b..d4da69d4c 100644 --- a/.changeset/@graphql-yoga_plugin-prometheus-3050-dependencies.md +++ b/.changeset/@graphql-yoga_plugin-prometheus-3050-dependencies.md @@ -1,5 +1,5 @@ --- -'@graphql-yoga/plugin-prometheus': patch +'@graphql-yoga/plugin-prometheus': major --- dependencies updates: - Updated dependency [`prom-client@^15.0.0` diff --git a/.changeset/@graphql-yoga_plugin-prometheus-3070-dependencies.md b/.changeset/@graphql-yoga_plugin-prometheus-3070-dependencies.md index a6084f67e..0c383b330 100644 --- a/.changeset/@graphql-yoga_plugin-prometheus-3070-dependencies.md +++ b/.changeset/@graphql-yoga_plugin-prometheus-3070-dependencies.md @@ -1,5 +1,5 @@ --- -'@graphql-yoga/plugin-prometheus': patch +'@graphql-yoga/plugin-prometheus': major --- dependencies updates: - Updated dependency [`@envelop/prometheus@9.0.0` diff --git a/.changeset/@graphql-yoga_plugin-response-cache-3070-dependencies.md b/.changeset/@graphql-yoga_plugin-response-cache-3070-dependencies.md index a2ac42cf3..2990fe73f 100644 --- a/.changeset/@graphql-yoga_plugin-response-cache-3070-dependencies.md +++ b/.changeset/@graphql-yoga_plugin-response-cache-3070-dependencies.md @@ -1,5 +1,5 @@ --- -'@graphql-yoga/plugin-response-cache': patch +'@graphql-yoga/plugin-response-cache': major --- dependencies updates: - Updated dependency [`@envelop/response-cache@^6.0.0` diff --git a/.changeset/graphql-yoga-3070-dependencies.md b/.changeset/graphql-yoga-3070-dependencies.md index 6be3cb9a5..af62204b4 100644 --- a/.changeset/graphql-yoga-3070-dependencies.md +++ b/.changeset/graphql-yoga-3070-dependencies.md @@ -1,5 +1,5 @@ --- -'graphql-yoga': patch +'graphql-yoga': major --- dependencies updates: - Updated dependency [`@envelop/core@^5.0.0`