Skip to content
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

Bring Explorer and CodeMirror in sync again #20

Merged
merged 4 commits into from
May 1, 2023
Merged

Bring Explorer and CodeMirror in sync again #20

merged 4 commits into from
May 1, 2023

Conversation

hasparus
Copy link
Contributor

Problem: Explorer tree and CodeMirror editor are currently out of sync.

I created this bug (mea culpa), when I moved the querySource state down in #15, because rerendering the whole thing on every keystroke resulted in the cursor jumping to the beginning of the text if you pressed backspace/delete fast multiple times.

We were already listening for queryEditor's "change" events in SavedQueriesToolbar, so I just gave the same treatment to the Explorer plugin.

(SavedQueriesToolbar is the top bar we use in Subgraph Studio and Graph Explorer so people can see example queries premade by Subgraph authors.)

The bug is solved, but we end up with a little bit more code, because I inlined @graphiql/plugin-explorer to do this.

@B2o5T Could you tell me if I'm being silly here? Is reading queryEditor from context and listening to query source sth worthwhile contributing upstream to @graphiql/plugin-explorer?

@netlify
Copy link

netlify bot commented Apr 28, 2023

Deploy Preview for enn-graphiql ready!

Name Link
🔨 Latest commit 6026ecd
🔍 Latest deploy log https://app.netlify.com/sites/enn-graphiql/deploys/644b9cc1dca74700084e93b0
😎 Deploy Preview https://deploy-preview-20--enn-graphiql.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@github-actions
Copy link

github-actions bot commented Apr 28, 2023

📊 Package size report   3%↑

File Before (Gzip) After (Gzip)
dist/index.cjs 6.0 kB 16%↑7.0 kB
dist/index.d.ts 653 B -3.22%↓632 B
dist/index.mjs 7.2 kB 20%↑8.7 kB
dist/plugins/explorer/useExplorerPlugin.d.ts 200 B
dist/style.css 82.9 kB 0.2%↑83.1 kB
dist/useQuerySource.d.ts 70 B
package.json 869 B -0.69%↓863 B
Total (Includes all files) 103.8 kB 3%↑106.5 kB
Tarball size 102.7 kB 2%↑104.9 kB
Unchanged files
File Size (Gzip)
dist/GraphiQLInterface.d.ts 1.3 kB
dist/SavedQueriesToolbar/ActionsMenu.d.ts 267 B
dist/SavedQueriesToolbar/DefaultQueryChip.d.ts 171 B
dist/SavedQueriesToolbar/index.d.ts 92 B
dist/SavedQueriesToolbar/messages.d.ts 316 B
dist/SavedQueriesToolbar/queryInSearchParams.d.ts 117 B
dist/SavedQueriesToolbar/SavedQueriesActionButtons.d.ts 451 B
dist/SavedQueriesToolbar/SavedQueriesContext.d.ts 281 B
dist/SavedQueriesToolbar/savedQueriesReducer.d.ts 317 B
dist/SavedQueriesToolbar/SavedQueriesToolbar.d.ts 459 B
dist/SavedQueriesToolbar/SavedQuerySelect.d.ts 272 B
dist/SavedQueriesToolbar/styles.d.ts 117 B
dist/SavedQueriesToolbar/types.d.ts 109 B
dist/SavedQueriesToolbar/validation.d.ts 303 B
dist/validations.d.ts 156 B
LICENSE 647 B
README.md 755 B

🤖 This report was automatically generated by pkg-size-action

@hasparus hasparus requested a review from benface April 30, 2023 14:59
@hasparus hasparus merged commit c86130c into main May 1, 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.

None yet

2 participants