Skip to content

Commit 3d13e7d

Browse files
Bump babel-plugin-react-compiler from 19.1.0-rc.1 to 19.1.0-rc.3 (#4379)
Bumps [babel-plugin-react-compiler](https://github.com/facebook/react/tree/HEAD/compiler/packages/babel-plugin-react-compiler) from 19.1.0-rc.1 to 19.1.0-rc.3. <details> <summary>Commits</summary> <ul> <li>See full diff in <a href="https://github.com/facebook/react/commits/HEAD/compiler/packages/babel-plugin-react-compiler">compare view</a></li> </ul> </details> <br /> --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Trevor Scheer <trevor.scheer@gmail.com>
1 parent 6c8b21c commit 3d13e7d

7 files changed

Lines changed: 57 additions & 44 deletions

File tree

packages/graphiql-plugin-doc-explorer/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
"@testing-library/jest-dom": "^6.6.3",
5555
"@testing-library/react": "^16.3.0",
5656
"@vitejs/plugin-react": "^4.4.1",
57-
"babel-plugin-react-compiler": "19.1.0-rc.1",
57+
"babel-plugin-react-compiler": "19.1.0-rc.3",
5858
"graphql": "^16.9.0",
5959
"react": "^19.1.0",
6060
"react-dom": "^19.1.0",

packages/graphiql-plugin-doc-explorer/src/components/search.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,10 @@ export const Search: FC = () => {
3333
const getSearchResults = useSearchResults();
3434
const [searchValue, setSearchValue] = useState('');
3535
const [results, setResults] = useState(() => getSearchResults(searchValue));
36+
const [isFocused, setIsFocused] = useState(false);
3637
const debouncedGetSearchResults = debounce(200, (search: string) => {
3738
setResults(getSearchResults(search));
3839
});
39-
// Workaround to fix React compiler error:
40-
// Ref values (the `current` property) may not be accessed during render.
41-
const [ref] = useState(inputRef);
42-
const isFocused = ref.current === document.activeElement;
4340

4441
useEffect(() => {
4542
debouncedGetSearchResults(searchValue);
@@ -85,6 +82,8 @@ export const Search: FC = () => {
8582
<ComboboxInput
8683
autoComplete="off"
8784
onChange={event => setSearchValue(event.target.value)}
85+
onFocus={() => setIsFocused(true)}
86+
onBlur={() => setIsFocused(false)}
8887
placeholder={formatShortcutForOS(
8988
formatShortcutForOS(KEY_MAP.searchInDocs.key).replaceAll('-', ' '),
9089
)}

packages/graphiql-plugin-history/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
"@graphiql/react": "^0.37.4",
5151
"@testing-library/react": "^16.1.0",
5252
"@vitejs/plugin-react": "^4.4.1",
53-
"babel-plugin-react-compiler": "19.1.0-rc.1",
53+
"babel-plugin-react-compiler": "19.1.0-rc.3",
5454
"react": "^19.1.0",
5555
"react-dom": "^19.1.0",
5656
"vite": "^6.4.3",

packages/graphiql-react/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@
7575
"@types/react-dom": "^19.1.2",
7676
"@types/set-value": "^4.0.1",
7777
"@vitejs/plugin-react": "^4.4.1",
78-
"babel-plugin-react-compiler": "19.1.0-rc.1",
78+
"babel-plugin-react-compiler": "19.1.0-rc.3",
7979
"graphql": "^16.9.0",
8080
"react": "^19.1.0",
8181
"react-dom": "^19.1.0",

packages/graphiql/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
"@testing-library/react": "^16.3.0",
6868
"@vitejs/plugin-react": "^4.4.1",
6969
"@vitest/web-worker": "^4.1.6",
70-
"babel-plugin-react-compiler": "19.1.0-rc.1",
70+
"babel-plugin-react-compiler": "19.1.0-rc.3",
7171
"concurrently": "^7.0.0",
7272
"cross-env": "^7.0.2",
7373
"cypress": "^13.13.2",

packages/graphiql/src/GraphiQL.tsx

Lines changed: 42 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ const LABEL = {
192192
newTab: 'New tab',
193193
};
194194

195-
export const GraphiQLInterface: FC<GraphiQLInterfaceProps> = ({
195+
export function GraphiQLInterface({
196196
forcedTheme,
197197
isHeadersEditorEnabled = true,
198198
defaultEditorToolsVisibility,
@@ -204,7 +204,7 @@ export const GraphiQLInterface: FC<GraphiQLInterfaceProps> = ({
204204
onEditHeaders,
205205
responseTooltip,
206206
showPersistHeadersSettings,
207-
}) => {
207+
}: GraphiQLInterfaceProps) {
208208
const { addTab, moveTab, closeTab, changeTab, setVisiblePlugin } =
209209
useGraphiQLActions();
210210
const {
@@ -228,7 +228,13 @@ export const GraphiQLInterface: FC<GraphiQLInterfaceProps> = ({
228228

229229
const PluginContent = visiblePlugin?.content;
230230

231-
const pluginResize = useDragResize({
231+
const {
232+
hiddenElement: pluginHiddenElement,
233+
setHiddenElement: setPluginHiddenElement,
234+
firstRef: pluginFirstRef,
235+
dragBarRef: pluginDragBarRef,
236+
secondRef: pluginSecondRef,
237+
} = useDragResize({
232238
defaultSizeRelation: 1 / 3,
233239
direction: 'horizontal',
234240
initiallyHidden: visiblePlugin ? undefined : 'first',
@@ -240,11 +246,21 @@ export const GraphiQLInterface: FC<GraphiQLInterfaceProps> = ({
240246
sizeThresholdSecond: 200,
241247
storageKey: 'docExplorerFlex',
242248
});
243-
const editorResize = useDragResize({
249+
const {
250+
firstRef: editorFirstRef,
251+
dragBarRef: editorDragBarRef,
252+
secondRef: editorSecondRef,
253+
} = useDragResize({
244254
direction: 'horizontal',
245255
storageKey: 'editorFlex',
246256
});
247-
const editorToolsResize = useDragResize({
257+
const {
258+
hiddenElement: editorToolsHiddenElement,
259+
setHiddenElement: setEditorToolsHiddenElement,
260+
firstRef: editorToolsFirstRef,
261+
dragBarRef: editorToolsDragBarRef,
262+
secondRef: editorToolsSecondRef,
263+
} = useDragResize({
248264
defaultSizeRelation: 3,
249265
direction: 'vertical',
250266
initiallyHidden: ((d: typeof defaultEditorToolsVisibility) => {
@@ -306,22 +322,22 @@ export const GraphiQLInterface: FC<GraphiQLInterfaceProps> = ({
306322
);
307323

308324
function onClickReference() {
309-
if (pluginResize.hiddenElement === 'first') {
310-
pluginResize.setHiddenElement(null);
325+
if (pluginHiddenElement === 'first') {
326+
setPluginHiddenElement(null);
311327
}
312328
}
313329

314330
const handleToolsTabClick: ButtonHandler = event => {
315-
if (editorToolsResize.hiddenElement === 'second') {
316-
editorToolsResize.setHiddenElement(null);
331+
if (editorToolsHiddenElement === 'second') {
332+
setEditorToolsHiddenElement(null);
317333
}
318334
const tabName = event.currentTarget.dataset.name as 'variables' | 'headers';
319335
setActiveSecondaryEditor(tabName);
320336
};
321337

322338
const toggleEditorTools: ButtonHandler = () => {
323-
editorToolsResize.setHiddenElement(
324-
editorToolsResize.hiddenElement === 'second' ? null : 'second',
339+
setEditorToolsHiddenElement(
340+
editorToolsHiddenElement === 'second' ? null : 'second',
325341
);
326342
};
327343

@@ -343,19 +359,17 @@ export const GraphiQLInterface: FC<GraphiQLInterfaceProps> = ({
343359
changeTab(index);
344360
};
345361

346-
const editorToolsText = `${editorToolsResize.hiddenElement === 'second' ? 'Show' : 'Hide'} editor tools`;
362+
const editorToolsText = `${editorToolsHiddenElement === 'second' ? 'Show' : 'Hide'} editor tools`;
347363

348364
const EditorToolsIcon =
349-
editorToolsResize.hiddenElement === 'second'
350-
? ChevronUpIcon
351-
: ChevronDownIcon;
365+
editorToolsHiddenElement === 'second' ? ChevronUpIcon : ChevronDownIcon;
352366

353367
const editors = (
354-
<div className="graphiql-editors" ref={editorResize.firstRef}>
368+
<div className="graphiql-editors" ref={editorFirstRef}>
355369
<section
356370
className="graphiql-query-editor"
357371
aria-label="Operation Editor"
358-
ref={editorToolsResize.firstRef}
372+
ref={editorToolsFirstRef}
359373
>
360374
{hasMonaco ? (
361375
<QueryEditor
@@ -376,12 +390,12 @@ export const GraphiQLInterface: FC<GraphiQLInterfaceProps> = ({
376390
</div>
377391
</section>
378392

379-
<div ref={editorToolsResize.dragBarRef} className="graphiql-editor-tools">
393+
<div ref={editorToolsDragBarRef} className="graphiql-editor-tools">
380394
<UnStyledButton
381395
type="button"
382396
className={cn(
383397
activeSecondaryEditor === 'variables' &&
384-
editorToolsResize.hiddenElement !== 'second' &&
398+
editorToolsHiddenElement !== 'second' &&
385399
'active',
386400
)}
387401
onClick={handleToolsTabClick}
@@ -394,7 +408,7 @@ export const GraphiQLInterface: FC<GraphiQLInterfaceProps> = ({
394408
type="button"
395409
className={cn(
396410
activeSecondaryEditor === 'headers' &&
397-
editorToolsResize.hiddenElement !== 'second' &&
411+
editorToolsHiddenElement !== 'second' &&
398412
'active',
399413
)}
400414
onClick={handleToolsTabClick}
@@ -424,7 +438,7 @@ export const GraphiQLInterface: FC<GraphiQLInterfaceProps> = ({
424438
aria-label={
425439
activeSecondaryEditor === 'variables' ? 'Variables' : 'Headers'
426440
}
427-
ref={editorToolsResize.secondRef}
441+
ref={editorToolsSecondRef}
428442
>
429443
<VariableEditor
430444
className={activeSecondaryEditor === 'variables' ? '' : 'hidden'}
@@ -448,11 +462,11 @@ export const GraphiQLInterface: FC<GraphiQLInterfaceProps> = ({
448462
<Sidebar
449463
forcedTheme={forcedTheme}
450464
showPersistHeadersSettings={showPersistHeadersSettings}
451-
setHiddenElement={pluginResize.setHiddenElement}
465+
setHiddenElement={setPluginHiddenElement}
452466
/>
453467
<div className="graphiql-main">
454468
<div
455-
ref={pluginResize.firstRef}
469+
ref={pluginFirstRef}
456470
className="graphiql-plugin"
457471
style={{
458472
// Make sure the container shrinks when containing long
@@ -465,10 +479,10 @@ export const GraphiQLInterface: FC<GraphiQLInterfaceProps> = ({
465479
{visiblePlugin && (
466480
<div
467481
className="graphiql-horizontal-drag-bar"
468-
ref={pluginResize.dragBarRef}
482+
ref={pluginDragBarRef}
469483
/>
470484
)}
471-
<div ref={pluginResize.secondRef} className="graphiql-sessions">
485+
<div ref={pluginSecondRef} className="graphiql-sessions">
472486
<div className="graphiql-session-header">
473487
<Tabs
474488
ref={tabContainerRef}
@@ -517,9 +531,9 @@ export const GraphiQLInterface: FC<GraphiQLInterfaceProps> = ({
517531
{editors}
518532
<div
519533
className="graphiql-horizontal-drag-bar"
520-
ref={editorResize.dragBarRef}
534+
ref={editorDragBarRef}
521535
/>
522-
<div className="graphiql-response" ref={editorResize.secondRef}>
536+
<div className="graphiql-response" ref={editorSecondRef}>
523537
{isFetching && <Spinner />}
524538
<ResponseEditor responseTooltip={responseTooltip} />
525539
{footer}
@@ -531,7 +545,7 @@ export const GraphiQLInterface: FC<GraphiQLInterfaceProps> = ({
531545
{children}
532546
</Tooltip.Provider>
533547
);
534-
};
548+
}
535549

536550
function getChildComponentType(child: ReactNode) {
537551
if (

yarn.lock

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3494,7 +3494,7 @@ __metadata:
34943494
"@testing-library/jest-dom": "npm:^6.6.3"
34953495
"@testing-library/react": "npm:^16.3.0"
34963496
"@vitejs/plugin-react": "npm:^4.4.1"
3497-
babel-plugin-react-compiler: "npm:19.1.0-rc.1"
3497+
babel-plugin-react-compiler: "npm:19.1.0-rc.3"
34983498
graphql: "npm:^16.9.0"
34993499
react: "npm:^19.1.0"
35003500
react-compiler-runtime: "npm:19.1.0-rc.1"
@@ -3540,7 +3540,7 @@ __metadata:
35403540
"@graphiql/toolkit": "npm:^0.12.0"
35413541
"@testing-library/react": "npm:^16.1.0"
35423542
"@vitejs/plugin-react": "npm:^4.4.1"
3543-
babel-plugin-react-compiler: "npm:19.1.0-rc.1"
3543+
babel-plugin-react-compiler: "npm:19.1.0-rc.3"
35443544
react: "npm:^19.1.0"
35453545
react-compiler-runtime: "npm:19.1.0-rc.1"
35463546
react-dom: "npm:^19.1.0"
@@ -3569,7 +3569,7 @@ __metadata:
35693569
"@types/react-dom": "npm:^19.1.2"
35703570
"@types/set-value": "npm:^4.0.1"
35713571
"@vitejs/plugin-react": "npm:^4.4.1"
3572-
babel-plugin-react-compiler: "npm:19.1.0-rc.1"
3572+
babel-plugin-react-compiler: "npm:19.1.0-rc.3"
35733573
clsx: "npm:^1.2.1"
35743574
framer-motion: "npm:^12.12"
35753575
get-value: "npm:^3.0.1"
@@ -8851,12 +8851,12 @@ __metadata:
88518851
languageName: node
88528852
linkType: hard
88538853

8854-
"babel-plugin-react-compiler@npm:19.1.0-rc.1":
8855-
version: 19.1.0-rc.1
8856-
resolution: "babel-plugin-react-compiler@npm:19.1.0-rc.1"
8854+
"babel-plugin-react-compiler@npm:19.1.0-rc.3":
8855+
version: 19.1.0-rc.3
8856+
resolution: "babel-plugin-react-compiler@npm:19.1.0-rc.3"
88578857
dependencies:
88588858
"@babel/types": "npm:^7.26.0"
8859-
checksum: 10c0/51f086d94a51bdd0490da78283ec4b5f51e735365387004c740bdd1341379c5e686fc7300cf4461411f84e9ee7211a90d0199925dd39de52d9a61cdaa5c650e7
8859+
checksum: 10c0/6811500cf81a309f104ec1de3fa9336932a1105e3c0e747b81a1d12e80c2cd4f531f7c42ec4441f96527ee20e19342af58d958241061d47a02b0d8bee66fbe35
88608860
languageName: node
88618861
linkType: hard
88628862

@@ -13603,7 +13603,7 @@ __metadata:
1360313603
"@testing-library/react": "npm:^16.3.0"
1360413604
"@vitejs/plugin-react": "npm:^4.4.1"
1360513605
"@vitest/web-worker": "npm:^4.1.6"
13606-
babel-plugin-react-compiler: "npm:19.1.0-rc.1"
13606+
babel-plugin-react-compiler: "npm:19.1.0-rc.3"
1360713607
concurrently: "npm:^7.0.0"
1360813608
cross-env: "npm:^7.0.2"
1360913609
cypress: "npm:^13.13.2"

0 commit comments

Comments
 (0)