Skip to content

Commit 069b53a

Browse files
committed
patch discord
1 parent fd1a539 commit 069b53a

File tree

3 files changed

+15
-5
lines changed

3 files changed

+15
-5
lines changed

README.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,9 @@ React Scan helps you identify these issues by automatically detecting and highli
195195

196196
**Q: Why this instead of React Devtools?**
197197

198-
React Devtools aims to be a general purpose tool for React. That's great and I think it can be useful. However, I deal with React performance issues every day, and React Devtools just doesn't fix my problems well. So, I built React Scan specifically to find performance issues. If this sounds like you, then React Scan may be a better choice. Also, some general issues about React Devtools' highlight feature:
198+
React Devtools aims to be a general purpose tool for React. However, I deal with React performance issues every day, and React Devtools doesn't fix my problems well. There's a lot of noise (no obvious distinction between unnecessary and necessary renders), and there's no programmatic API. If it sounds like you have the same problems, then React Scan may be a better choice.
199+
200+
Also, some personal complaints about React Devtools' highlight feature:
199201

200202
- React Devtools "batches" paints, so if a component renders too fast, it will lag behind and only show 1 every second or so
201203
- When you scroll/resize the boxes don't update position
@@ -242,9 +244,12 @@ We expect all contributors to abide by the terms of our [Code of Conduct](https:
242244
- [x] Don't show label if no reconciliation occurred ("client renders" in DevTools)
243245
- [x] "global" counter using `sessionStorage`, aggregate count stats instead of immediate replacement
244246
- [x] Give a general report of the app's performance
247+
- [ ] checkbox filtering API, leaderboard
248+
- [ ] Offscreen canvas on worker thread
249+
- [ ] heatmap decay (stacked renders will be more intense)
250+
- [ ] Investigate components (UI allowlist)
245251
- [ ] UI for turning on/off options
246252
- [ ] "PageSpeed insights" for React
247-
- [ ] Offscreen canvas on worker thread
248253
- [ ] React Native support
249254
- [ ] Name / explain the actual problem, docs
250255
- [ ] Simple FPS counter

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-scan",
3-
"version": "0.0.8",
3+
"version": "0.0.9",
44
"description": "Scan your React app for renders",
55
"keywords": [
66
"react",

src/core/web/toolbar.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@ export const createToolbar = () => {
77
`<div id="react-scan-toolbar" title="Number of unnecessary renders and time elapsed" style="position:fixed;bottom:3px;right:3px;background:rgba(0,0,0,0.5);padding:4px 8px;border-radius:4px;color:white;z-index:2147483647;font-family:${MONO_FONT}" aria-hidden="true">react-scan</div>`,
88
) as HTMLDivElement;
99

10-
let isHidden = localStorage.getItem('react-scan-hidden') === 'true';
10+
let isHidden =
11+
// discord doesn't support localStorage
12+
'localStorage' in globalThis &&
13+
localStorage.getItem('react-scan-hidden') === 'true';
1114

1215
const updateVisibility = () => {
1316
const overlay = document.getElementById('react-scan-overlay');
@@ -19,7 +22,9 @@ export const createToolbar = () => {
1922
ReactScanInternals.activeOutlines = [];
2023
ReactScanInternals.scheduledOutlines = [];
2124
}
22-
localStorage.setItem('react-scan-hidden', isHidden.toString());
25+
if ('localStorage' in globalThis) {
26+
localStorage.setItem('react-scan-hidden', isHidden.toString());
27+
}
2328
};
2429

2530
updateVisibility();

0 commit comments

Comments
 (0)