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: fix for calls on builtin jsx/function types #29624

Merged
merged 3 commits into from
May 28, 2024

Conversation

josephsavona
Copy link
Contributor

@josephsavona josephsavona commented May 28, 2024

Stack from ghstack (oldest at bottom):

When I added new builtin types for jsx and functions, i forget to add a shape definition. This meant that attempting to accesss a property or method on these types would cause an internal error with an unresolved shape. That wasn't obvious because we rarely call methods on these types.

I confirmed that the new fixtures here fail without the fix.

Copy link

vercel bot commented May 28, 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 May 28, 2024 10:15pm

josephsavona added a commit that referenced this pull request May 28, 2024
ghstack-source-id: ea79636a34dea8d488bfb9a106c0135f057f6c23
Pull Request resolved: #29624
@facebook-github-bot facebook-github-bot added the React Core Team Opened by a member of the React Core Team label May 28, 2024
Hello <fbt:param name="user name">{props.name}</fbt:param>
</fbt>
);
return element.toString();
Copy link
Contributor Author

Choose a reason for hiding this comment

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

failed previously because element has the inferred type BuiltInJsx, which didn't have a shape definition

const f = function () {
return <div>{props.name}</div>;
};
return f.call();
Copy link
Contributor Author

Choose a reason for hiding this comment

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

failed previously because f had the inferred type BuiltInFunction which didn't have a shape defined

@react-sizebot
Copy link

react-sizebot commented May 28, 2024

Comparing: 4633972...ae45671

Critical size changes

Includes critical production bundles, as well as any change greater than 2%:

Name +/- Base Current +/- gzip Base gzip Current gzip
oss-stable/react-dom/cjs/react-dom.production.js = 6.66 kB 6.66 kB = 1.82 kB 1.82 kB
oss-stable/react-dom/cjs/react-dom-client.production.js = 496.38 kB 496.38 kB = 88.84 kB 88.84 kB
oss-experimental/react-dom/cjs/react-dom.production.js = 6.67 kB 6.67 kB = 1.83 kB 1.83 kB
oss-experimental/react-dom/cjs/react-dom-client.production.js = 501.20 kB 501.20 kB = 89.53 kB 89.53 kB
facebook-www/ReactDOM-prod.classic.js = 593.81 kB 593.81 kB = 104.45 kB 104.45 kB
facebook-www/ReactDOM-prod.modern.js = 570.20 kB 570.20 kB = 100.85 kB 100.85 kB
test_utils/ReactAllWarnings.js Deleted 63.65 kB 0.00 kB Deleted 15.90 kB 0.00 kB

Significant size changes

Includes any change greater than 0.2%:

Expand to show
Name +/- Base Current +/- gzip Base gzip Current gzip
test_utils/ReactAllWarnings.js Deleted 63.65 kB 0.00 kB Deleted 15.90 kB 0.00 kB

Generated by 🚫 dangerJS against ae45671

josephsavona added a commit that referenced this pull request May 28, 2024
ghstack-source-id: aa8f8d75a302bb5bac126d3e963594545e71ec74
Pull Request resolved: #29624
When I added new builtin types for jsx and functions, i forget to add a shape definition. This meant that attempting to accesss a property or method on these types would cause an internal error with an unresolved shape. That wasn't obvious because we rarely call methods on these types.

I confirmed that the new fixtures here fail without the fix.

[ghstack-poisoned]
josephsavona added a commit that referenced this pull request May 28, 2024
When I added new builtin types for jsx and functions, i forget to add a shape definition. This meant that attempting to accesss a property or method on these types would cause an internal error with an unresolved shape. That wasn't obvious because we rarely call methods on these types.

I confirmed that the new fixtures here fail without the fix.

ghstack-source-id: aa8f8d75a302bb5bac126d3e963594545e71ec74
Pull Request resolved: #29624
@josephsavona josephsavona merged commit ae45671 into gh/josephsavona/19/base May 28, 2024
50 checks passed
josephsavona added a commit that referenced this pull request May 28, 2024
When I added new builtin types for jsx and functions, i forget to add a shape definition. This meant that attempting to accesss a property or method on these types would cause an internal error with an unresolved shape. That wasn't obvious because we rarely call methods on these types.

I confirmed that the new fixtures here fail without the fix.

ghstack-source-id: aa8f8d75a302bb5bac126d3e963594545e71ec74
Pull Request resolved: #29624
@josephsavona josephsavona deleted the gh/josephsavona/19/head branch May 28, 2024 22:18
nikeee pushed a commit to nikeee/react that referenced this pull request May 28, 2024
When I added new builtin types for jsx and functions, i forget to add a shape definition. This meant that attempting to accesss a property or method on these types would cause an internal error with an unresolved shape. That wasn't obvious because we rarely call methods on these types.

I confirmed that the new fixtures here fail without the fix.

ghstack-source-id: aa8f8d75a302bb5bac126d3e963594545e71ec74
Pull Request resolved: facebook#29624
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants