-
-
Notifications
You must be signed in to change notification settings - Fork 70
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
Add trigger and target element logs for devtools #276
Conversation
✅ Deploy Preview for cableready ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
@@ -32,6 +32,9 @@ export default class UpdatesForElement extends SubscribingElement { | |||
super() | |||
const shadowRoot = this.attachShadow({ mode: 'open' }) | |||
shadowRoot.innerHTML = template | |||
|
|||
this.triggerElementLog = [] | |||
this.targetElementLog = [] |
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 we need to clear these logs or perhaps have a log stack that we move them to when cable-ready:after-update
is dispatched?
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.
🤔
You are probably correct, though in my tests it didn't really matter because they are cleared with every browser refresh.
I think the easiest would be to limit them to a small number (10?) and do a kind of FIFO thing so they get cleared automatically?
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.
I added a BoundedQueue
class, let me know if you like the implementation.
Also, added datetime strings to the log lines
Enhancement
Description
Furnishes cable-ready-updates-for-element with instance variables for element logs, so they can displayed in the devtools like this: