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

[compiler] Handle member expr as computed property #31344

Merged
merged 1 commit into from
Oct 28, 2024

Conversation

gsathya
Copy link
Member

@gsathya gsathya commented Oct 24, 2024

This PR loosens the restriction on the types of computed properties we can handle.

Previously, we would disallow anything that is not an identifier because non-identifiers could be mutating. But member expressions are not mutating so we can treat them similar to identifiers.

This PR loosens the restriction on the types of computed properties we
can handle.

Previously, we would disallow anything that is not an identifier because
non-identifiers could be mutating. But member expressions are not
mutating so we can treat them similar to identifiers.
@facebook-github-bot facebook-github-bot added CLA Signed React Core Team Opened by a member of the React Core Team labels Oct 24, 2024
Copy link

vercel bot commented Oct 24, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
react-compiler-playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 24, 2024 5:30pm

@gsathya
Copy link
Member Author

gsathya commented Oct 24, 2024

Fixing this based on feedback heard at React India

Copy link
Contributor

@mofeiZ mofeiZ left a comment

Choose a reason for hiding this comment

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

Nice! On a related note, I just added #31348 which shows that this bailout is unrelated to the underlying bug

@gsathya gsathya merged commit aded0ef into facebook:main Oct 28, 2024
19 checks passed
@gsathya gsathya deleted the member-expr branch October 28, 2024 13:10
mofeiZ added a commit that referenced this pull request Nov 5, 2024
We were bailing out on complex computed-key syntax (prior to #31344) as we assumed that this caused bugs (due to inferring computed key rvalues to have `freeze` effects).

This fixture shows that this bailout is unrelated to the underlying bug
mofeiZ added a commit that referenced this pull request Nov 5, 2024
We were bailing out on complex computed-key syntax (prior to #31344) as
we assumed that this caused bugs (due to inferring computed key rvalues
to have `freeze` effects).

This fixture shows that this bailout is unrelated to the underlying bug
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed React Core Team Opened by a member of the React Core Team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants