graphql / graphiql

GraphiQL & the GraphQL LSP Reference Ecosystem for building browser & IDE tools.
MIT License
16.11k stars 1.73k forks source link

[graphiql-react] create instance of `new HistoryStore` and `new StorageAPI` only on mount, use function with `useState` #3743

Closed dimaMachina closed 2 months ago

changeset-bot[bot] commented 2 months ago

🦋 Changeset detected

Latest commit: fb8967e98a0399aaf783cde4a1d1a84babda5400

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

This PR includes changesets to release 1 package | Name | Type | | --------------- | ----- | | @graphiql/react | 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[bot] commented 2 months ago

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

graphiql@3.7.1-canary-60c8954d.0
@graphiql/plugin-code-exporter@3.1.3-canary-60c8954d.0
@graphiql/plugin-explorer@3.2.3-canary-60c8954d.0
@graphiql/react@0.26.1-canary-60c8954d.0
codecov[bot] commented 2 months ago

Codecov Report

Attention: Patch coverage is 36.84211% with 12 lines in your changes missing coverage. Please review.

Project coverage is 67.25%. Comparing base (26cd829) to head (fb8967e). Report is 1 commits behind head on main.

Files Patch % Lines
packages/graphiql-react/src/history/context.tsx 33.33% 12 Missing :warning:
Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/graphql/graphiql/pull/3743/graphs/tree.svg?width=650&height=150&src=pr&token=XdBgmoWsyv&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=graphql)](https://app.codecov.io/gh/graphql/graphiql/pull/3743?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=graphql) ```diff @@ Coverage Diff @@ ## main #3743 +/- ## ========================================== - Coverage 67.29% 67.25% -0.04% ========================================== Files 121 121 Lines 7017 7012 -5 Branches 2269 2263 -6 ========================================== - Hits 4722 4716 -6 - Misses 2278 2279 +1 Partials 17 17 ``` | [Files](https://app.codecov.io/gh/graphql/graphiql/pull/3743?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=graphql) | Coverage Δ | | |---|---|---| | [packages/graphiql-react/src/storage.tsx](https://app.codecov.io/gh/graphql/graphiql/pull/3743?src=pr&el=tree&filepath=packages%2Fgraphiql-react%2Fsrc%2Fstorage.tsx&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=graphql#diff-cGFja2FnZXMvZ3JhcGhpcWwtcmVhY3Qvc3JjL3N0b3JhZ2UudHN4) | `81.81% <100.00%> (ø)` | | | [packages/graphiql-react/src/history/context.tsx](https://app.codecov.io/gh/graphql/graphiql/pull/3743?src=pr&el=tree&filepath=packages%2Fgraphiql-react%2Fsrc%2Fhistory%2Fcontext.tsx&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=graphql#diff-cGFja2FnZXMvZ3JhcGhpcWwtcmVhY3Qvc3JjL2hpc3RvcnkvY29udGV4dC50c3g=) | `52.00% <33.33%> (-11.34%)` | :arrow_down: |