Skip to content

graphiql@2 #2523

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 38 commits into from
Aug 24, 2022
Merged

graphiql@2 #2523

merged 38 commits into from
Aug 24, 2022

Conversation

thomasheyenbrock
Copy link
Collaborator

@thomasheyenbrock thomasheyenbrock commented Jun 29, 2022

This branch collects all the breaking changes for the next major version of graphiql and will be merged once we're ready to release it.

For context, we decided on this approach because using changeset pre-releases would also block other packages from this repo (vscode-graphql etc.) from publishing non-prerelease versions (see here)

All the changes here have already been reviewed and approved individually:

@changeset-bot
Copy link

changeset-bot bot commented Jun 29, 2022

🦋 Changeset detected

Latest commit: 85218bd

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

This PR includes changesets to release 4 packages
Name Type
@graphiql/react Minor
codemirror-graphql Major
graphiql Major
@graphiql/toolkit Minor

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

@thomasheyenbrock thomasheyenbrock self-assigned this Jun 29, 2022
@codecov
Copy link

codecov bot commented Jun 29, 2022

Codecov Report

Merging #2523 (32566ab) into main (2d91916) will decrease coverage by 7.34%.
The diff coverage is 16.58%.

❗ Current head 32566ab differs from pull request most recent head 85218bd. Consider uploading reports for the commit 85218bd to get more accurate results

@@            Coverage Diff             @@
##             main    #2523      +/-   ##
==========================================
- Coverage   65.70%   58.36%   -7.35%     
==========================================
  Files          85       92       +7     
  Lines        5106     5313     +207     
  Branches     1631     1746     +115     
==========================================
- Hits         3355     3101     -254     
- Misses       1747     2191     +444     
- Partials        4       21      +17     
Impacted Files Coverage Δ
packages/codemirror-graphql/src/lint.ts 100.00% <ø> (ø)
packages/codemirror-graphql/src/results/mode.ts 47.05% <ø> (ø)
packages/codemirror-graphql/src/utils/hintList.ts 95.65% <ø> (ø)
...ckages/codemirror-graphql/src/utils/mode-indent.ts 0.00% <0.00%> (ø)
packages/codemirror-graphql/src/variables/mode.ts 79.48% <ø> (ø)
packages/graphiql-react/src/editor/completion.ts 0.00% <0.00%> (ø)
...hiql-react/src/editor/components/header-editor.tsx 0.00% <0.00%> (ø)
...phiql-react/src/editor/components/query-editor.tsx 0.00% <0.00%> (ø)
...hiql-react/src/editor/components/image-preview.tsx 2.56% <2.56%> (ø)
packages/codemirror-graphql/src/variables/lint.ts 47.61% <66.66%> (+0.63%) ⬆️
... and 145 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@github-actions
Copy link
Contributor

github-actions bot commented Jun 29, 2022

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

@thomasheyenbrock thomasheyenbrock force-pushed the graphiql-v2 branch 2 times, most recently from 6baf968 to c944c74 Compare July 14, 2022 20:02
@acao acao force-pushed the graphiql-v2 branch 3 times, most recently from 8f43129 to d4a602a Compare July 19, 2022 12:57
@thomasheyenbrock thomasheyenbrock force-pushed the graphiql-v2 branch 3 times, most recently from 8204ea3 to af500ec Compare July 27, 2022 11:43
@thomasheyenbrock thomasheyenbrock force-pushed the graphiql-v2 branch 2 times, most recently from cb8f3ef to dded854 Compare July 28, 2022 11:04
@acao
Copy link
Member

acao commented Jul 30, 2022

@thomasheyenbrock i had an idea for automating @next releases! This I think this will solve the problem completely.

in the canary script, we can just add conditional behavior for graphiql-v2 and non-forked branches with next/ branch, which skips the canary logic.

instead, it attempts a pre-release if a .changeset/pre.json is present. However in most cases when pushing commits, if the versions haven't been incremented since the last next release, nothing will happen.

so, when you're ready to publish another series of @next tags, just increment the versions where you need them and you're good to go! You may also want to increment in dependencies, though this can feel redundant with ^ resolution, it's more important when it's ready for a stable release to set a working baseline ofc.

for example, you won't need to make another codemirror-graphql pre-release again unless it changes, so you will be able to just push a commit that increments the next tag versions for graphiql and @graphiql/react and others as needed.

it's actually much simpler than the canary logic itself so it should be easier to implement.

@thomasheyenbrock
Copy link
Collaborator Author

@acao sounds like it should work. I'm just wondering how many next releases we actually need before having v2 ready, so not sure if it's worth the effort now. (At least for me who hasn't touched any of this canary logic it would take me some time to dig into it.)

For future major versions this would definitely be very nice to have!

thomasheyenbrock and others added 25 commits August 24, 2022 22:33
* move explorer context into folder

* move `TypeLink` component to `@graphiql/react`

* move `FieldLink` component to `@graphiql/react`

* move `DefaultValue` component to `@graphiql/react`

* move `Directive` component to `@graphiql/react`

* extract `MarkdownContent` component in `@gaphiql/react`

* move `Argument` component to `@graphiql/react`

* combine and extend changesets
* add icons

* add `Button` component to `@graphiql/react`

* add explorer section component

* redesign `SchemaDocumentation` component

* redesign `TypeDocumentation` component

* redesign `FieldDocumentation` component

* redesign `DocExplorer` component

* extend changeset message
* implement new design for tabs

* add back `tab` role
* add `Dialog` component to `@graphiql/react`

* add a `clear` method to the `Storage` type

* add success and failure states to `Button` component

* add settings dialog

* make sure to show dialog above editor scrollbars
* add `ButtonGroup` component to `@graphiql/react`

* dark mode
* add a dialog that shows all available shortkeys

* use table in short key dialog

* add shortkey for introspection

* add link to codemirror keymaps
* fix selector specificity for link styling

* leverage nesting

* fix hiding the headline on focus

* ensure correct focus outlines and remove visited styles
)

* adds styles to contain the result window above any footer content

* simplifies flex value
* implement toolbar menu in new design

* implement `ToolbarListbox` in new design

* better tooltips
* remove deprecated class methods

* remove utilities

* remove ref forwarding

* refactor inner class component to a function component

* merge main component with context consumer component

* remove component statics

* refactor outer component to be a class component

* remove comments

* add changeset

* remove legacy exports
)

* add `GraphiQLProvider` to `@graphiql/react` and include `StorageContextProvider`

* add `HistoryContextProvider` to `GraphiQLProvider`

* add `EditorContextProvider` to `GraphiQLProvider`

* add `SchemaContextProvider` to `GraphiQLProvider`

* add `ExecutionContextProvider` to `GraphiQLProvider`

* move `ExplorerContextProvider` to `GraphiQLProvider`

* declare props for `GraphiQLInterface`

* reuse prop definitions from editor components

* merge props for default state of editor tools

* rename prop for toggling headers editor

* re-export GraphiQL provider
* add JSDocs for component props and hooks

* add JSDocs for context types

* add README for `@graphiql/react`
* add plugin api for docs and history

* throw error when plugin has no title
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