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

[code-infra] Remove rsc-builder #45079

Merged
merged 3 commits into from
Jan 21, 2025
Merged

[code-infra] Remove rsc-builder #45079

merged 3 commits into from
Jan 21, 2025

Conversation

Janpot
Copy link
Member

@Janpot Janpot commented Jan 21, 2025

We're doing this with eslint now. The rule is auto-fixable. Added some types to the eslint plugin as well and cleaned it up, functionally no difference.

@Janpot Janpot added the scope: code-infra Specific to the core-infra product label Jan 21, 2025
@mui-bot
Copy link

mui-bot commented Jan 21, 2025

Netlify deploy preview

https://deploy-preview-45079--material-ui.netlify.app/

Bundle size report

No bundle size changes (Toolpad)
No bundle size changes

Generated by 🚫 dangerJS against 65daf30

@Janpot Janpot marked this pull request as ready for review January 21, 2025 17:21
@Janpot Janpot requested a review from a team January 21, 2025 17:21
statement.expression.value === 'use client',
);
hasUseServerDirective = hasDirective(node, 'use server');
hasUseClientDirective = hasDirective(node, 'use client');
},
CallExpression(node) {
if (
!hasUseClientDirective &&
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't this check for !hasUseServerDirective as well? 🤔

Copy link
Member Author

@Janpot Janpot Jan 21, 2025

Choose a reason for hiding this comment

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

No, the marked APIs are not allowed in server components. i.e. the plugin should flag when 'use client' is missing while client APIs are used in the file. The hasUseServerDirective is only there to prevent adding a 'use client' when there already is a 'use server' while autofixing. This is a contradiction that the programmer must resolve manually.

@Janpot Janpot merged commit 180cf80 into mui:master Jan 21, 2025
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope: code-infra Specific to the core-infra product
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants