Skip to content

[plugin-code-exporter/plugin-explorer]: exclude peer dependencies and dependencies from bundle - #3229

Merged
dimaMachina merged 1 commit into
mainfrom
explorer-code-exporter-vite
Jun 17, 2023
Merged

dimaMachina merged 1 commit into
mainfrom
explorer-code-exporter-vite

Conversation

@dimaMachina

Copy link
Copy Markdown
Collaborator

@graphiql/plugin-explorer

before after
image image

@graphiql/plugin-code-exporter

before after
image image

@changeset-bot

changeset-bot Bot commented Jun 14, 2023

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: b63bb23

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@graphiql/plugin-code-exporter Patch
@graphiql/plugin-explorer Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions

Copy link
Copy Markdown
Contributor

The latest changes of this PR are not available as canary, since there are no linked changesets for this PR.

@acao

acao commented Jun 15, 2023

Copy link
Copy Markdown
Contributor

@B2o5T one issue here is - how do users use this plugin if they are using the CDN version of react?

@dimaMachina

Copy link
Copy Markdown
Collaborator Author

@acao how this was changed with the previous implementation?

@acao

acao commented Jun 16, 2023

Copy link
Copy Markdown
Contributor

@B2o5T there are a few examples where users were able to use the bundled CDN build of this plugin with the CDN graphiql. Each plugin should provide an unbundled module version and a bundled cdn version, as with GraphiQL, @graphiql/toolkit and @graphiql/react. We don't have to solve this problem now, but it will lead to a regression until we fix it

@dimaMachina

Copy link
Copy Markdown
Collaborator Author

@acao Since a new major is coming, we can go back to this problem in case of reporting it

@dimaMachina
dimaMachina merged commit 0a65e72 into main Jun 17, 2023
@dimaMachina
dimaMachina deleted the explorer-code-exporter-vite branch June 17, 2023 09:28
@acao acao mentioned this pull request Jun 17, 2023
@thomasheyenbrock

Copy link
Copy Markdown
Collaborator

@B2o5T Too late with my review, sorry 🙇 @acao has a good point, and I don't think the new major will solve this. Removing the bundling of dependencies breaks the CDN examples, in particular this one: https://github.com/graphql/graphiql/blob/main/packages/graphiql-plugin-explorer/examples/index.html

At least the UMD build has to bundle up all dependencies, with the exception of the ones where we define globals: https://github.com/graphql/graphiql/blob/main/packages/graphiql-plugin-explorer/vite.config.ts#L23-L28

@dimaMachina

Copy link
Copy Markdown
Collaborator Author

@thomasheyenbrock ok! I'll fix it

@acao acao mentioned this pull request Jun 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants