Skip to content

feat(extension): display first component parent in render info - #750

Merged
JoviDeCroock merged 4 commits into
preactjs:mainfrom
43081j:extension-paths
Aug 25, 2025
Merged

feat(extension): display first component parent in render info#750
JoviDeCroock merged 4 commits into
preactjs:mainfrom
43081j:extension-paths

Conversation

@43081j

@43081j 43081j commented Aug 22, 2025

Copy link
Copy Markdown
Contributor
image

draft for now since we're not sure if we want this yet

something along the lines of this could be useful though, to see what actually rendered. most signals end up in text nodes, so we don't really know the context of the component that actually rendered it. this could help w/ that

@changeset-bot

changeset-bot Bot commented Aug 22, 2025

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 2a130a0

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@netlify

netlify Bot commented Aug 22, 2025

Copy link
Copy Markdown

Deploy Preview for preact-signals-demo ready!

Name Link
🔨 Latest commit 2a130a0
🔍 Latest deploy log https://app.netlify.com/projects/preact-signals-demo/deploys/68a9e66b9d87100008bc4317
😎 Deploy Preview https://deploy-preview-750--preact-signals-demo.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 project configuration.

Comment thread packages/preact/src/index.ts Outdated
@43081j

43081j commented Aug 23, 2025

Copy link
Copy Markdown
Contributor Author

@JoviDeCroock this is how it looks now:

image

it shows the first non-text parent if the current node is a text node
in all other cases, it does what it did before (shows only the node that re-rendered)

@JoviDeCroock

JoviDeCroock commented Aug 23, 2025

Copy link
Copy Markdown
Member

@43081j The only issue is that it stopped working in React, in the babel plugin it will still pass the string. Generally though, this looks amazing to me!

@43081j

43081j commented Aug 23, 2025

Copy link
Copy Markdown
Contributor Author

do you mean it doesn't show the parent > child for react? because one of the types along the way is a string

i've just pushed a small change so if a parent of a text node is a string type, we will still show parent > child

maybe that helps

@JoviDeCroock

Copy link
Copy Markdown
Member

do you mean it doesn't show the parent > child for react? because one of the types along the way is a string

No, React is currently still passing in a string rather than a VNode which makes it crash for me

@JoviDeCroock JoviDeCroock left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is how I'd do this

Comment thread packages/debug/src/devtools.ts Outdated
Comment thread packages/debug/src/devtools.ts Outdated
Comment thread packages/debug/src/devtools.ts Outdated
@43081j

43081j commented Aug 23, 2025

Copy link
Copy Markdown
Contributor Author

for future reference - where does that live? the code which is calling enterComponent from the react side

@JoviDeCroock

Copy link
Copy Markdown
Member

The babel plugin has enterComponent

@43081j
43081j marked this pull request as ready for review August 23, 2025 16:04
@43081j

43081j commented Aug 23, 2025

Copy link
Copy Markdown
Contributor Author

ok this should be how you suggested now

@JoviDeCroock
JoviDeCroock merged commit 9338bbf into preactjs:main Aug 25, 2025
6 checks passed
@43081j
43081j deleted the extension-paths branch August 26, 2025 09:26
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