Skip to content
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

Merged
merged 3 commits into from
Jun 23, 2023

Conversation

julianrubisch
Copy link
Contributor

Enhancement

Description

Furnishes cable-ready-updates-for-element with instance variables for element logs, so they can displayed in the devtools like this:

CleanShot 2023-05-08 at 12 22 44@2x

@julianrubisch julianrubisch requested a review from hopsoft May 8, 2023 10:25
@netlify
Copy link

netlify bot commented May 8, 2023

Deploy Preview for cableready ready!

Name Link
🔨 Latest commit 46ea1aa
🔍 Latest deploy log https://app.netlify.com/sites/cableready/deploys/64885995e1159d00082df5a3
😎 Deploy Preview https://deploy-preview-276--cableready.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

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 = []
Copy link
Contributor

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?

Copy link
Contributor Author

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?

Copy link
Contributor Author

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

@julianrubisch julianrubisch merged commit d4b8364 into main Jun 23, 2023
@julianrubisch julianrubisch deleted the devtools-changes branch June 23, 2023 04:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants