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

[1/2] [@graphiql/react] compile source code with react-compiler, remove useMemo and useCallback usages #3821

Merged
merged 33 commits into from
Dec 14, 2024

Conversation

dimaMachina
Copy link
Collaborator

No description provided.

Copy link

changeset-bot bot commented Dec 11, 2024

🦋 Changeset detected

Latest commit: 24c8c1e

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
@graphiql/plugin-code-exporter Major
@graphiql/plugin-explorer Major
graphiql 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

@dimaMachina dimaMachina marked this pull request as draft December 11, 2024 03:49
Copy link

codecov bot commented Dec 11, 2024

Codecov Report

Attention: Patch coverage is 23.82671% with 211 lines in your changes missing coverage. Please review.

Project coverage is 58.58%. Comparing base (9f725b8) to head (24c8c1e).
Report is 6 commits behind head on main.

Files with missing lines Patch % Lines
packages/graphiql-react/src/schema.tsx 0.00% 64 Missing ⚠️
packages/graphiql-react/src/editor/query-editor.ts 3.03% 32 Missing ⚠️
packages/graphiql-react/src/editor/context.tsx 0.00% 30 Missing ⚠️
packages/graphiql-react/src/editor/hooks.ts 19.23% 21 Missing ⚠️
.../graphiql-react/src/explorer/components/search.tsx 70.00% 14 Missing and 1 partial ⚠️
packages/graphiql-react/src/history/context.tsx 14.28% 12 Missing ⚠️
packages/graphiql-react/src/execution.tsx 0.00% 11 Missing ⚠️
...kages/graphiql-react/src/editor/variable-editor.ts 12.50% 7 Missing ⚠️
...ackages/graphiql-react/src/editor/header-editor.ts 14.28% 6 Missing ⚠️
...ages/graphiql-react/src/editor/response-editor.tsx 16.66% 5 Missing ⚠️
... and 3 more
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3821      +/-   ##
==========================================
- Coverage   65.32%   58.58%   -6.74%     
==========================================
  Files         122      109      -13     
  Lines        7003     6112     -891     
  Branches     2260     1923     -337     
==========================================
- Hits         4575     3581     -994     
- Misses       2411     2515     +104     
+ Partials       17       16       -1     
Files with missing lines Coverage Δ
packages/graphiql-react/src/editor/common.ts 100.00% <ø> (ø)
packages/graphiql-react/src/editor/completion.ts 0.00% <ø> (ø)
packages/graphiql-react/src/editor/tabs.ts 26.82% <ø> (-34.15%) ⬇️
packages/graphiql-react/src/editor/whitespace.ts 100.00% <ø> (ø)
...ct/src/explorer/components/field-documentation.tsx 97.14% <100.00%> (ø)
...act/src/explorer/components/type-documentation.tsx 85.10% <100.00%> (ø)
...s/graphiql-react/src/explorer/components/utils.tsx 100.00% <ø> (ø)
packages/graphiql-react/src/markdown.ts 100.00% <ø> (ø)
...ages/graphiql-react/src/utility/component-group.ts 100.00% <ø> (ø)
packages/graphiql-react/src/utility/context.ts 84.61% <ø> (ø)
... and 15 more

... and 27 files with indirect coverage changes

Copy link
Contributor

github-actions bot commented Dec 11, 2024

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

graphiql@3.7.3-canary-2eca8599.0
@graphiql/plugin-code-exporter@3.1.4-canary-2eca8599.0
@graphiql/plugin-explorer@3.2.4-canary-2eca8599.0
@graphiql/react@0.28.0-canary-2eca8599.0

@acao
Copy link
Member

acao commented Dec 11, 2024

@dimaMachina any chance this can happen against the v4 branch? will it be hard to adopt these changes to the v4 branch?

@dimaMachina
Copy link
Collaborator Author

@acao I think folks can already benefit from this improvement even in v3? see how react-compiler improved Nextra 😅

Screen.Recording.2024-12-10.at.22.30.38.mov

@dimaMachina dimaMachina marked this pull request as ready for review December 13, 2024 19:56
@dimaMachina dimaMachina changed the title [@graphiql/react] compile source code with react-compiler, remove useMemo and useCallback usages [3/3] [@graphiql/react] compile source code with react-compiler, remove useMemo and useCallback usages Dec 13, 2024
@dimaMachina dimaMachina requested a review from acao December 13, 2024 19:57
@dimaMachina dimaMachina changed the title [3/3] [@graphiql/react] compile source code with react-compiler, remove useMemo and useCallback usages [1/2] [@graphiql/react] compile source code with react-compiler, remove useMemo and useCallback usages Dec 14, 2024
@dimaMachina dimaMachina merged commit 3633d61 into main Dec 14, 2024
14 checks passed
@dimaMachina dimaMachina deleted the react-compiler branch December 14, 2024 13:31
@acao acao mentioned this pull request Dec 14, 2024
@TallTed
Copy link
Contributor

TallTed commented Dec 16, 2024

So many commits with meaningless comments. upd? aa? fix? Might as well just leave the comment blank. Much better to put some hint about what the commit actually contains!

Comment on lines -73 to -76
const isFocused = useRef(false);
const handleFocus: FocusEventHandler = useCallback(e => {
isFocused.current = e.type === 'focus';
}, []);
Copy link

Choose a reason for hiding this comment

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

Hi 👋

Was there a reason to remove this? This might be related to the following regression: #3842

Copy link
Collaborator Author

@dimaMachina dimaMachina Dec 17, 2024

Choose a reason for hiding this comment

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

Hi, it's still present

const handleFocus: FocusEventHandler = e => {
setIsFocused(e.type === 'focus');
};

I will take a look at your issue soon!

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.

4 participants