react
react copied to clipboard
refactor[react-devtools]: move console patching to global hook
Stacked on https://github.com/facebook/react/pull/30566 and whats under it. See this commit.
It is mostly copying code from one place to another and updating tests. With these changes, for every console method that we patch, there is going to be a single applied patch:
- For
error,warn, andtracewe are patching when hook is installed. This guarantees that component stacks are going to be appended even if browser DevTools are not opened. We pay some price for it, though: if user has browser DevTools closed and if at this point some warning or error is emitted (logged), the next time user opens browser DevTools, they are going to seehook.jsas the source frame. Unfortunately, ignore listing from source maps is not applied retroactively, and I don't know if its a bug or just a design limitations. Once browser DevTools are opened, source maps will be loaded and ignore listing will be applied for all emitted logs in the future. - For
log,info,group,groupCollapsedwe are only patching when React notifies React DevTools about running in StrictMode. We unpatch the methods right after it.
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 | Sep 18, 2024 5:08pm |