diff --git a/.changeset/chatty-spoons-accept.md b/.changeset/chatty-spoons-accept.md new file mode 100644 index 00000000000..64f5e3bab15 --- /dev/null +++ b/.changeset/chatty-spoons-accept.md @@ -0,0 +1,8 @@ +--- +'@graphiql/plugin-code-exporter': minor +'@graphiql/plugin-explorer': minor +'@graphiql/react': minor +'graphiql': minor +--- + +Update GraphiQL CDN example using ESM-based CDN esm.sh diff --git a/docs/migration/graphiql-4.0.0.md b/docs/migration/graphiql-4.0.0.md index 4819b812658..09439975d21 100644 --- a/docs/migration/graphiql-4.0.0.md +++ b/docs/migration/graphiql-4.0.0.md @@ -5,6 +5,7 @@ - Drop CommonJS build output - Drop support React 16/17 - Support React 19 +- ⚠️ UMD CDN build `index.umd.js` is deprecated. Migrate to ESM-based CDN. ## `@graphiql/react` changes @@ -18,9 +19,13 @@ - Drop CommonJS build output - Drop support React 16/17 - Support React 19 +- ⚠️ UMD CDN build `index.umd.js` is deprecated. Migrate to ESM-based CDN. +- [Updated CDN ESM-based example](../../packages/graphiql-plugin-code-exporter/example/index.html) ## `@graphiql/plugin-explorer` changes - Drop CommonJS build output - Drop support React 16/17 - Support React 19 +- ⚠️ UMD CDN build `index.umd.js` is deprecated. Migrate to ESM-based CDN. +- [Updated CDN ESM-based example](../../packages/graphiql-plugin-explorer/example/index.html) diff --git a/examples/graphiql-cdn/README.md b/examples/graphiql-cdn/README.md index 51573e9581b..62e87a67b35 100644 --- a/examples/graphiql-cdn/README.md +++ b/examples/graphiql-cdn/README.md @@ -1,11 +1,23 @@ # GraphiQL CDN Example -This example uses the CDN bundles to show a simple graphiql example, with explorer plugin. +This is a simple example of using **GraphiQL** directly from a CDN, including the [GraphiQL Explorer plugin](../../packages/graphiql-plugin-explorer/README.md). -It uses the latest version published on npm, via unpkg +It loads the latest GraphiQL version from [esm.sh](https://esm.sh), an ESM-based CDN that serves npm packages as ES modules. -### Setup +## Setup -none required, just open the index.html! +No installation or build step is required — just open the `index.html` file in your browser: -`open index.html` in osx `firefox index.html` or `chromium index.html` in linux +- macOS: + + ```sh + open index.html + ``` + +- Linux: + + ```sh + firefox index.html + # or + chromium index.html + ``` diff --git a/examples/graphiql-cdn/index.html b/examples/graphiql-cdn/index.html index 13bad1a3a3d..cb760ed24e8 100644 --- a/examples/graphiql-cdn/index.html +++ b/examples/graphiql-cdn/index.html @@ -8,74 +8,83 @@
-