Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 28, 2025

  • Add useRef and useContext to REACT_CLIENT_APIS and sort alphabetically
  • Create a new set SERVER_COMPONENT_FORBIDDEN_APIS for APIs like useIsoLayoutEffect that should be banned in server components
  • Add detection for named imports of React APIs (e.g., import { useState } from 'react')
  • Add test file for the rule following existing test file structure (31 test cases)
Original prompt

In https://github.com/mui/mui-public/blob/master/packages/code-infra/src/eslint/material-ui/rules/disallow-react-api-in-server-components.mjs

  • add useRef and useContext as well, and sort alphabetically,
  • add a test file (look at similar rules for the structure)
  • also fail when useIsoLayoutEffect is used anywhere. create for this a new set of top level apis that are blacklisted under server components
  • also fail when any of the react apis are imported by their name (just imported is good enough, no need to check whether they're actually being called)

@mui-bot
Copy link

mui-bot commented Nov 28, 2025

Bundle size report

Bundle Parsed size Gzip size
@base-ui-components/react 0B(0.00%) 0B(0.00%)
@mui/x-charts-pro 0B(0.00%) 0B(0.00%)

Details of bundle changes


Check out the code infra dashboard for more information about this PR.

…lacklist, detect React API imports, add tests

Co-authored-by: Janpot <[email protected]>
Copilot AI changed the title [WIP] Update ESLint rule to disallow specific React APIs Extend disallow-react-api-in-server-components ESLint rule Nov 28, 2025
Copilot AI requested a review from Janpot November 28, 2025 08:31
Copilot finished work on behalf of Janpot November 28, 2025 08:31
Copy link
Contributor Author

Copilot AI commented Nov 28, 2025

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • iojs.org
    • Triggering command: /usr/bin/curl curl -q --fail --compressed -L -s REDACTED -o - (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI requested a review from Janpot November 28, 2025 09:53
Copilot finished work on behalf of Janpot November 28, 2025 09:53
Copy link
Contributor Author

Copilot AI commented Nov 28, 2025

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • iojs.org
    • Triggering command: /usr/bin/curl curl -q --fail --compressed -L -s REDACTED -o - (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI requested a review from Janpot November 28, 2025 10:00
Copilot finished work on behalf of Janpot November 28, 2025 10:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants