-
Notifications
You must be signed in to change notification settings - Fork 227
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
feat: notifications #273
base: main
Are you sure you want to change the base?
feat: notifications #273
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
.vscode/settings.json
Outdated
@@ -7,7 +7,7 @@ | |||
}, | |||
"css.lint.unknownAtRules": "ignore", | |||
"[typescript]": { | |||
"editor.defaultFormatter": "biomejs.biome" | |||
"editor.defaultFormatter": "esbenp.prettier-vscode" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh boy
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't worry i turned linting off entirely :)
commit: |
}; | ||
handleResizeListener = handleResize; | ||
|
||
window.addEventListener("resize", handleResize); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no debounce/throttle?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will do
packages/scan/src/core/index.ts
Outdated
const isUsedInBrowserExtension = typeof window !== 'undefined'; | ||
initReactScanInstrumentation({ | ||
onActive: () => { | ||
const rdtHook = getRDTHook(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if my assumption here is correct (I haven't seen the implementation), this might not be compatible with React 18 sync SSR (not Remix-based since they cheat). Basically, the issue is that React 18 SSR is strict with the markup during hydration so any tampering would cause it throw error (in our case, inserting the toolbar and the canvas). React 19 doesn't have this issue thanks to the new SSR architecture.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This also throws an error for the CLI since the auto script runs before the document exists.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do u know how we solved this on current main?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
react-scan/packages/scan/src/new-outlines/index.ts
Lines 439 to 454 in 97b9de6
const scheduleSetup = () => { | |
if (mounted) { | |
return; | |
} | |
if (schedule) { | |
clearTimeout(schedule); | |
} | |
schedule = requestAnimationFrame(() => { | |
mounted = true; | |
const host = getCanvasEl(); | |
if (host) { | |
document.documentElement.appendChild(host); | |
} | |
setupToolbar(); | |
}); // TODO(Alexis): perhaps a better timing | |
}; |
debounce until no commit is done to the fiber tree, which is basically two birds hit with one stone.
) => { | ||
toolbarEventStore.getState().actions.addEvent({ | ||
kind: "interaction", | ||
id: crypto.randomUUID(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
future fix: needs compat check
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oops missed this, should use the generateId fn we have
const isProduction: boolean = process.env.NODE_ENV === "production"; | ||
const prefix: string = "Invariant failed"; | ||
|
||
// FIX ME THIS IS PRODUCTION INVARIANT LOL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's fine, I do this as well LOL
skipBoundaries: true, | ||
}; | ||
|
||
const FILTER_PATTERNS = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
realistically this may not be 100% (nor 50%) accurate, unless this is intentional, of course.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh yeah that was from monitoring a while ago. I think i had o1 think for a while and create a ton of test cases that filtered bad components, and that was the implementation that passed the most cases. Not really necessary to do this for notifications
@popover.tsx
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
empty file ;)
Release: /~https://github.com/aidenybai/react-scan/releases/tag/v0.2.0
Why is this PR not merged into main yet?
Main contains issues that we didn't have time to patch. We hope to have this branch in main very soon. In the meantime all new work should branch of "precise" until this is completed