Skip to content

Update React Compiler to 1.0.0#13004

Merged
phryneas merged 4 commits intorelease-4.1from
pr/react-compiler-1.0.0
Nov 14, 2025
Merged

Update React Compiler to 1.0.0#13004
phryneas merged 4 commits intorelease-4.1from
pr/react-compiler-1.0.0

Conversation

@phryneas
Copy link
Copy Markdown
Member

No description provided.

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Nov 11, 2025

⚠️ No Changeset found

Latest commit: 7a0c8c2

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@apollo-librarian
Copy link
Copy Markdown

apollo-librarian bot commented Nov 11, 2025

✅ Docs preview ready

The preview is ready to be viewed. View the preview

File Changes

0 new, 12 changed, 0 removed
* (developer-tools)/react/(latest)/caching/cache-configuration.mdx
* (developer-tools)/react/(latest)/data/fragments.mdx
* (developer-tools)/react/(latest)/data/mutations.mdx
* (developer-tools)/react/(latest)/data/persisted-queries.mdx
* (developer-tools)/react/(latest)/data/queries.mdx
* (developer-tools)/react/(latest)/development-testing/testing.mdx
* (developer-tools)/react/(latest)/integrations/react-native.mdx
* (developer-tools)/react/(latest)/local-state/local-state-management.mdx
* (developer-tools)/react/(latest)/migrating/apollo-client-4-migration.mdx
* (developer-tools)/react/(latest)/performance/server-side-rendering.mdx
* (developer-tools)/react/(latest)/VERSIONING_POLICY.md
* (developer-tools)/react/(latest)/versioning-policy.md

Build ID: d676c161cab68b3817558dfc
Build Logs: View logs

URL: https://www.apollographql.com/docs/deploy-preview/d676c161cab68b3817558dfc

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Nov 11, 2025

npm i https://pkg.pr.new/apollographql/apollo-client/@apollo/client@13004

commit: a435833

@phryneas phryneas requested a review from jerelmiller November 11, 2025 12:16
Copy link
Copy Markdown
Member

@jerelmiller jerelmiller left a comment

Choose a reason for hiding this comment

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

I'll approve once you've had a chance to look at my comments 🙂

observable?.restart();
}
}, [optionsRef, recreateRef, observable]);
}, [observable, setObservable, optionsRef, recreateRef]);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This change is curious to me. Isn't setObservable a function returned from useState? Why wouldn't it be considered stable?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I assumed so too, but the React compiler doesn't recognize it. It might have to do with the way we import React. Either way, if setObservable is missing it won't compile the whole function, so I just added it. It's stable anyways.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

facebook/react#35118 opened a React Compiler bug

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Oh dang good call! I didn't realize that. Thanks for explaining!

Comment thread eslint.config.mjs Outdated
// console.log(reactHooks.configs.flat);
// })() || {}),
...reactHooks.configs.flat.recommended.rules,
// "react-hooks/unsupported-syntax": "warn",
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Are you planning on adding these additional configs? Or is it ok that we just accept the recommended rules and remove the rules key?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Good call. At some point I thought I'd have to change something there and then I didn't. Removing.

Comment thread eslint.config.mjs Outdated
),
{
...reactHooks.configs.flat.recommended,
files: ["**/*.ts", "**/*.tsx"],
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I know this file list came from the previous config, but any chance we could update this to just look at the /react folder? No reason we need to use these rules outside of the React code.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Good call, restricted it.

@phryneas phryneas requested a review from jerelmiller November 12, 2025 10:08
@github-actions github-actions bot added the auto-cleanup 🤖 label Nov 13, 2025
@phryneas
Copy link
Copy Markdown
Member Author

Again, some CI parts are failing with what looks like an npm outage, but nothing relevant impacted.

@phryneas phryneas merged commit 49f25bf into release-4.1 Nov 14, 2025
38 of 41 checks passed
jerelmiller pushed a commit that referenced this pull request Nov 17, 2025
* update react compiler to 1.0.0

* update test

* cleanup
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 15, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants