-
-
Notifications
You must be signed in to change notification settings - Fork 113
Chrome extension stuff #727
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
base: main
Are you sure you want to change the base?
Conversation
|
✅ Deploy Preview for preact-signals-demo ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Size Change: +3.09 kB (+3.54%) Total Size: 90.4 kB
ℹ️ View Unchanged
|
de2a6a8
to
58225ae
Compare
58225ae
to
0de9cfa
Compare
], | ||
"devtools_page": "devtools.html", | ||
"background": { | ||
"service_worker": "background.js" |
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.
doesn't make much difference but FYI these can be ES modules now:
"background": {
"service_worker": "background.js",
"type": "module"
},
you don't use anything module-specific but may still be good to know :D
|
||
if ( | ||
filteredUpdates.length > 0 && | ||
(window as any).__PREACT_SIGNALS_DEVTOOLS__ |
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.
can we strongly type this? might make maintenance easier
declare global {
interface Window {
__PREACT_SIGNALS_DEVTOOLS__?: SignalsDevToolsAPI;
}
}
This is the start of a chrome extension, currently it contains two views. An updates view where we'll stream in updates happening on the page and a second view which contains the signals graph that we can find on the page.
The thing that I'm trying to figure out is a way to display React & Preact components in a framework agnostic way. For instance in the Graph component it would be neat to show which signal is related to which component.
On second thought, maybe it's just worth adding adapters that can send a message of
ENTER_COMPONENT
andEXIT_COMPONENT
where in the Preact adapter we can useoptions._render
. For react I don't know yet what to use thoughAnother thing that needs to happen is adding a Babel plugin to automatically add names to every signal/computed/effect in user-code. We could use this to add fileName + lineNumber