Skip to content

extract history plugin from @graphiql/react and publish as @graphiql/plugin-history package #3911

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 35 commits into from
May 4, 2025

Conversation

dimaMachina
Copy link
Collaborator

@dimaMachina dimaMachina commented May 3, 2025

related #2904
part of #3874

can be published as @graphiql/react 0.31.0 since according semver 0.x treated as major changes

Copy link

changeset-bot bot commented May 3, 2025

🦋 Changeset detected

Latest commit: 17a2f37

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

This PR includes changesets to release 5 packages
Name Type
@graphiql/plugin-history Patch
@graphiql/react Minor
graphiql Patch
@graphiql/plugin-code-exporter Major
@graphiql/plugin-explorer Major

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

@dimaMachina dimaMachina requested a review from Copilot May 3, 2025 14:08
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR extracts the history plugin from @graphiql/react and publishes it as a separate package (@graphiql/plugin-history), while also removing related exports and type definitions from @graphiql/react.

  • Removed several exports and types (e.g. ExplorerContextProviderProps, HistoryContextProviderProps) from @graphiql/react.
  • Commented out history integration within the execution context pending new plugin usage.
  • Added configuration and build setups for the new @graphiql/plugin-history package.

Reviewed Changes

Copilot reviewed 27 out of 31 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
packages/graphiql-react/src/explorer/index.ts Removed export for ExplorerContextProviderProps as part of the extraction.
packages/graphiql-react/src/execution.tsx Updated fetcher type-check and commented out history integration with a TODO note.
packages/graphiql-react/src/editor/index.ts & context.tsx Removed export/type for EditorContextProviderProps and streamlined context component type usage.
packages/graphiql-plugin-history/* Introduced new configuration files, exports, and updated context to support the new history plugin.
examples/monaco-graphql-react-vite/* Minor adjustments in config and updated loading UI.
.changeset/*.md Updated changeset to reflect the removal and extraction of history-related code.
Files not reviewed (4)
  • examples/monaco-graphql-react-vite/package.json: Language not supported
  • package.json: Language not supported
  • packages/graphiql-plugin-history/package.json: Language not supported
  • packages/graphiql-plugin-history/tsconfig.json: Language not supported
Comments suppressed due to low confidence (1)

packages/graphiql-react/src/explorer/index.ts:20

  • The removal of the ExplorerContextProviderProps export is intentional as part of the plugin extraction. Ensure that downstream consumers update their type references accordingly.
ExplorerContextProviderProps,

@dimaMachina dimaMachina marked this pull request as ready for review May 3, 2025 15:34
@dimaMachina dimaMachina requested a review from Copilot May 3, 2025 15:48
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR extracts the history functionality from the @graphiql/react package into a standalone @graphiql/plugin-history package. Key changes include:

  • Removal of history-related exports and types from the graphiql-react package.
  • Adjustments in components and context files to remove direct history dependencies.
  • Addition of new configuration, source, and test files for the plugin-history package.

Reviewed Changes

Copilot reviewed 27 out of 31 changed files in this pull request and generated no comments.

Show a summary per file
File Description
packages/graphiql-react/src/history/index.ts Removed history exports in preparation for extraction
packages/graphiql-react/src/explorer/index.ts Removed export of ExplorerContextProviderProps
packages/graphiql-react/src/execution.tsx Commented out usage of useHistoryContext and improved fetcher check
packages/graphiql-react/src/editor/* Adjusted export types and context implementations
packages/graphiql-plugin-history/* Added new plugin code with corresponding configs, tests, and docs
examples/monaco-graphql-react-vite/* Minor improvements in styling and configuration
.changeset/*.md Updated changeset to reflect the extraction and type removals
Files not reviewed (4)
  • examples/monaco-graphql-react-vite/package.json: Language not supported
  • package.json: Language not supported
  • packages/graphiql-plugin-history/package.json: Language not supported
  • packages/graphiql-plugin-history/tsconfig.json: Language not supported
Comments suppressed due to low confidence (1)

packages/graphiql-plugin-history/src/components.tsx:173

  • The same ref (buttonRef) is used on both the 'Save' and 'Close' buttons, which may lead to unexpected behavior. Consider using separate refs or removing the ref if it is not needed for both elements.
<UnStyledButton type="button" ref={buttonRef} onClick={handleSave}>

Copy link
Contributor

github-actions bot commented May 4, 2025

The latest changes of this PR are available as canary in npm (based on the declared changesets):

@dimaMachina dimaMachina merged commit e7c436b into main May 4, 2025
14 checks passed
@dimaMachina dimaMachina deleted the history branch May 4, 2025 12:24
@acao acao mentioned this pull request May 4, 2025
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.

1 participant