Commit Graph

21375 Commits

Author SHA1 Message Date
lauren efad075d05 Merge a9c4ab8859 into sapling-pr-archive-poteto 2025-04-16 17:22:51 -04:00
Lauren Tan a9c4ab8859 [ci] Fix check_access output
the joy of yml
2025-04-16 17:22:41 -04:00
lauren afad5075ed Merge 0115e0c450 into sapling-pr-archive-poteto 2025-04-16 17:17:50 -04:00
Lauren Tan 0115e0c450 [mcp] Iterate on prompt
v2
2025-04-16 17:17:32 -04:00
Lauren Tan 16b038a89a [mcp] Fix bailout loc
Use the correct loc line numbers and not [Object:object]
2025-04-16 17:17:32 -04:00
Lauren Tan 5d65b4d67f [mcp] Refine passes returned
Adds some new options to request the HIR, ReactiveFunction passes
2025-04-16 16:31:09 -04:00
Lauren Tan 545dbfdf63 [mcp] Dedupe docs
Previously the resource would return a bunch of dupes because the algolia results would return multiple hashes (headings) for the same url.
2025-04-16 16:00:21 -04:00
Lauren Tan 185592e3f6 [mcp] Add inspect script
Uses https://github.com/modelcontextprotocol/inspector to inspect and debug the mcp server.

`yarn workspace react-mcp-server dev` will build the server in watch mode and launch the inspector. Default address is http://127.0.0.1:6274.
2025-04-16 15:33:52 -04:00
Sebastian Markbåge b04254fdce Don't try to hydrate a hidden Offscreen tree (#32862)
I found a bug even before the Activity hydration stuff.

If we're hydrating an Offscreen boundary in its "hidden" state it won't
have any content to hydrate so will trigger hydration errors (which are
then eaten by the Offscreen boundary itself). Leaving it not prewarmed.

This doesn't happen in the simple case because we'd be hydrating at a
higher priority than Offscreen at the root, and those are deferred to
Offscreen by not having higher priority. However, we've hydrating at the
Offscreen priority, which we do inside Suspense boundaries, then it
tries to hydrate against an empty set.

I ended up moving this to the Activity boundary in a future PR since
it's the SSR side that decided where to not render something and it only
has a concept of Activity, no Offscreen.


https://github.com/facebook/react/pull/32863/commits/1dc05a5e2222e18fc3a2062ee1bd957109e21344#diff-d5166797ebbc5b646a49e6a06a049330ca617985d7a6edf3ad1641b43fde1ddfR1111
2025-04-15 17:43:42 -04:00
Sebastian Markbåge 539bbdbd86 Warn if you pass a hidden prop to Activity (#32916)
Since `hidden` is a prop on arbitrary DOM elements it's a common mistake
to think that it would also work that way on `<Activity>` but it
doesn't. In fact, we even had this mistakes in our own tests.

Maybe there's an argument that we should actually just support it but we
also have more modes planned.

So this adds a warning. It should also already be covered by TypeScript.
2025-04-15 17:17:22 -04:00
lauren e71d4205ae [ci] Don't run some checks for non-members/collaborators (#32918)
There's really no need to even run the workflow for non-members or
collaborators for the labeling and discord notification workflows. We
can exit early.
2025-04-15 13:02:16 -04:00
lauren 572f754b84 Merge 8eef76fc79 into sapling-pr-archive-poteto 2025-04-15 12:57:34 -04:00
Lauren Tan 8eef76fc79 [ci] Don't run some checks for non-members/collaborators
There's really no need to even run the workflow for non-members or collaborators for the labeling and discord notification workflows. We can exit early.
2025-04-15 12:57:28 -04:00
lauren 2ed34eba0d Update @playwright/test (#32917)
Routine update.
---
[//]: # (BEGIN SAPLING FOOTER)
Stack created with [Sapling](https://sapling-scm.com). Best reviewed
with [ReviewStack](https://reviewstack.dev/facebook/react/pull/32917).
* #32918
* __->__ #32917
2025-04-15 12:52:43 -04:00
lauren 75831dc557 Merge 0f35206cb4 into sapling-pr-archive-poteto 2025-04-15 12:52:12 -04:00
Lauren Tan 0f35206cb4 [ci] Don't run some checks for non-members/collaborators
There's really no need to even run the workflow for non-members or collaborators for the labeling and discord notification workflows. We can exit early.
2025-04-15 12:52:04 -04:00
lauren 5769b62700 Merge 4cc7c75613 into sapling-pr-archive-poteto 2025-04-15 12:40:47 -04:00
Lauren Tan 4cc7c75613 Update @playwright/test
Routine update.
2025-04-15 12:40:41 -04:00
Jorge (Hezi) Cohen 707b3fc6b2 [DevTools] Make Toggle hover state more visible (#32914)
This change adds a background color to Toggles to make them easier to
see. This is especially important when DevTools are not in focus, and
it's harder to see.

Test plan:
1. `yarn build:chrome:local`
2. Inspect components 
3. Hover over "Select an Element in page to inspect it"
4. Observe background change
2025-04-15 11:20:29 +01:00
Piotr Tomczewski 7ff4d057b6 [DevTools] feat: show changed hooks names in the Profiler tab (#31398)
<!--
  Thanks for submitting a pull request!
We appreciate you spending the time to work on these changes. Please
provide enough information so that others can review your pull request.
The three fields below are mandatory.

Before submitting a pull request, please make sure the following is
done:

1. Fork [the repository](https://github.com/facebook/react) and create
your branch from `main`.
  2. Run `yarn` in the repository root.
3. If you've fixed a bug or added code that should be tested, add tests!
4. Ensure the test suite passes (`yarn test`). Tip: `yarn test --watch
TestName` is helpful in development.
5. Run `yarn test --prod` to test in the production environment. It
supports the same options as `yarn test`.
6. If you need a debugger, run `yarn test --debug --watch TestName`,
open `chrome://inspect`, and press "Inspect".
7. Format your code with
[prettier](https://github.com/prettier/prettier) (`yarn prettier`).
8. Make sure your code lints (`yarn lint`). Tip: `yarn linc` to only
check changed files.
  9. Run the [Flow](https://flowtype.org/) type checks (`yarn flow`).
  10. If you haven't already, complete the CLA.

Learn more about contributing:
https://reactjs.org/docs/how-to-contribute.html
-->

## Summary

This PR adds support for displaying the names of changed hooks directly
in the Profiler tab, making it easier to identify specific updates.

A `HookChangeSummary` component has been introduced to show these hook
names, with a `displayMode` prop that toggles between `“compact”` for
tooltips and `“detailed”` for more in-depth views. This keeps tooltip
summaries concise while allowing for a full breakdown where needed.

This functionality also respects the `“Always parse hook names from
source”` setting from the Component inspector, as it uses the same
caching mechanism already in place for the Components tab. Additionally,
even without hook names parsed, the Profiler will now display hook types
(like `State`, `Callback`, etc.) based on data from `inspectedElement`.

To enable this across the DevTools, `InspectedElementContext` has been
moved higher in the component tree, allowing it to be shared between the
Profiler and Components tabs. This update allows hook name data to be
reused across tabs without duplication.

Additionally, a `getAlreadyLoadedHookNames` helper function was added to
efficiently access cached hook names, reducing the need for repeated
fetching when displaying changes.

These changes improve the ability to track specific hook updates within
the Profiler tab, making it clearer to see what’s changed.

### Before
Previously, the Profiler tab displayed only the IDs of changed hooks, as
shown below:
<img width="350" alt="Screenshot 2024-11-01 at 12 02 21_cropped"
src="https://github.com/user-attachments/assets/7a5f5f67-f1c8-4261-9ba3-1c76c9a88af3">

### After (without hook names parsed)
When hook names aren’t parsed, custom hooks and hook types are displayed
based on the inspectedElement data:
<img width="350" alt="Screenshot 2024-11-01 at 12 03 09_cropped"
src="https://github.com/user-attachments/assets/ed857a6d-e6ef-4e5b-982c-bf30c2d8a7e2">

### After (with hook names parsed)
Once hook names are fully parsed, the Profiler tab provides a complete
breakdown of specific hooks that have changed:
<img width="350" alt="Screenshot 2024-11-01 at 12 03 14_cropped"
src="https://github.com/user-attachments/assets/1ddfcc35-7474-4f4d-a084-f4e9f993a5bf">

This should resolve #21856 🎉
2025-04-15 11:10:00 +01:00
lauren 08075929f2 [compiler] Init react-mcp-server (#32859)
Just trying this out as a small hack for fun. Nothing serious is
planned.

Inits an MCP server that has 1 assistant prompt and two capabilities.
2025-04-14 18:39:00 -04:00
Lauren Tan 61fd735208 merge commit for archive created by Sapling 2025-04-14 18:26:44 -04:00
Lauren Tan e285434c4a [compiler] Init react-mcp-server
Just trying this out as a small hack for fun. Nothing serious is planned.

Inits an MCP server that has 1 assistant prompt and two capabilities.
2025-04-14 18:26:21 -04:00
Lauren Tan 9cb030289f merge commit for archive created by Sapling 2025-04-14 18:04:15 -04:00
Lauren Tan 055afcde3e [compiler] Init react-mcp-server
Just trying this out as a small hack for fun. Nothing serious is planned.

Inits an MCP server that has 1 assistant prompt and two capabilities.
2025-04-14 18:04:09 -04:00
Lauren Tan b59b307eb9 merge commit for archive created by Sapling 2025-04-14 15:55:29 -04:00
Lauren Tan c2fb3176c4 [compiler] Init react-mcp-server
Just trying this out as a small hack for fun. Nothing serious is planned.

Inits an MCP server that has 1 assistant prompt and two capabilities.
2025-04-14 15:55:24 -04:00
Lauren Tan 515c6d2f0b merge commit for archive created by Sapling 2025-04-14 15:50:29 -04:00
Lauren Tan 3db20f2a6d [compiler] Init react-mcp-server
Just trying this out as a small hack for fun. Nothing serious is planned.

Inits an MCP server that has 1 assistant prompt and two capabilities.
2025-04-14 15:50:23 -04:00
lauren 2cae253462 Merge b5910faf8e into sapling-pr-archive-poteto 2025-04-14 15:15:46 -04:00
Lauren Tan b5910faf8e [compiler] Init react-mcp-server
Just trying this out as a small hack for fun. Nothing serious is planned.

Inits an MCP server that has 1 assistant prompt and two capabilities.
2025-04-14 15:15:39 -04:00
lauren 4eea4fcf41 [compiler] Update rimraf (#32868)
Just updating the compiler workspace package.
---
[//]: # (BEGIN SAPLING FOOTER)
Stack created with [Sapling](https://sapling-scm.com). Best reviewed
with [ReviewStack](https://reviewstack.dev/facebook/react/pull/32868).
* #32859
* __->__ #32868
2025-04-14 15:15:14 -04:00
Lauren Tan 437e8e8016 merge commit for archive created by Sapling 2025-04-14 15:15:09 -04:00
Lauren Tan 80240b5aa0 [compiler] Init react-mcp-server
Just trying this out as a small hack for fun. Nothing serious is planned.

Inits an MCP server that has 1 assistant prompt and two capabilities.
2025-04-14 15:15:02 -04:00
Lauren Tan c5293a557b merge commit for archive created by Sapling 2025-04-14 14:20:17 -04:00
Lauren Tan 683acd9cfe [compiler] Init react-mcp-server
Just trying this out as a small hack for fun. Nothing serious is planned.

Inits an MCP server that has 1 assistant prompt and two capabilities.
2025-04-14 14:20:11 -04:00
Lauren Tan c15a5e4e66 [compiler] Update rimraf
Just updating the compiler workspace package.
2025-04-14 14:19:33 -04:00
Lauren Tan 3d6826eb43 merge commit for archive created by Sapling 2025-04-14 14:12:40 -04:00
Lauren Tan 3753901e05 [compiler] Init react-mcp-server
Just trying this out as a small hack for fun. Nothing serious is planned.

Inits an MCP server that has 1 assistant prompt and two capabilities.
2025-04-14 14:12:29 -04:00
Lauren Tan 02571a1b25 [compiler] Update rimraf
Just updating the compiler workspace package.
2025-04-14 14:11:31 -04:00
Lauren Tan 9051d55621 merge commit for archive created by Sapling 2025-04-14 14:09:43 -04:00
Lauren Tan 4ff1c1f789 [compiler] Init react-mcp-server
Just trying this out as a small hack for fun. Nothing serious is planned.

Inits an MCP server that has 1 assistant prompt and two capabilities.
2025-04-14 14:09:37 -04:00
lauren b5fcd000be Merge 228b0c3c33 into sapling-pr-archive-poteto 2025-04-14 14:06:21 -04:00
Lauren Tan 228b0c3c33 [compiler] Init react-mcp-server
Just trying this out as a small hack for fun. Nothing serious is planned.

Inits an MCP server that has 1 assistant prompt and two capabilities.
2025-04-14 14:06:16 -04:00
Lauren Tan d9fdd732da merge commit for archive created by Sapling 2025-04-14 14:01:09 -04:00
Lauren Tan b7f9cf84dd [compiler] Init react-mcp-server
Just trying this out as a small hack for fun. Nothing serious is planned.

Inits an MCP server that has 1 assistant prompt and two capabilities.
2025-04-14 14:00:59 -04:00
Lauren Tan a6d03f0c21 merge commit for archive created by Sapling 2025-04-14 14:00:38 -04:00
Lauren Tan 98ce69200d [compiler] Init react-mcp-server
Just trying this out as a small hack for fun. Nothing serious is planned.

Inits an MCP server that has 1 assistant prompt and two capabilities.
2025-04-14 14:00:31 -04:00
Lauren Tan 270f9c0384 merge commit for archive created by Sapling 2025-04-14 13:57:50 -04:00
Lauren Tan 8c5294e569 [compiler] Init react-mcp-server
Just trying this out as a small hack for fun. Nothing serious is planned.

Inits an MCP server that has 1 assistant prompt and two capabilities.
2025-04-14 13:57:43 -04:00