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

Highlighter #31

Merged
merged 15 commits into from
May 23, 2023
Merged

Highlighter #31

merged 15 commits into from
May 23, 2023

Conversation

exdis
Copy link
Contributor

@exdis exdis commented Apr 10, 2023

Highlighter initial implementation

@exdis exdis marked this pull request as draft April 10, 2023 14:31
}

stopInspect() {
window.removeEventListener('click', this.onClick, true);
Copy link
Owner

Choose a reason for hiding this comment

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

This will not remove a listener since onClick was added as this.onClick.bind(this). The same for onPointerDown & onPointerUp

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

}

private selectFiberForNode(node, selected = false) {
const rendererInterface = this.hook.rendererInterfaces.get(1);
Copy link
Owner

Choose a reason for hiding this comment

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

We need to iterate through rendererInterfaces and try every interface (supported=true) for a fiber id. Since multiple renderers are not supported, your can add a break after first check, but add a comment for future

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

}

if (fiberID) {
this.publisher.ns(HIGHLIGHTER_NS).publish({ fiberID, selected });
Copy link
Owner

Choose a reason for hiding this comment

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

I suggest to keep this functionality abstract to communication layer. It's better to pass a callback to highlighter to specify what to do on a fiber selection.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

@lahmatiy lahmatiy changed the title [WIP] Highlighter Highlighter May 23, 2023
@lahmatiy lahmatiy marked this pull request as ready for review May 23, 2023 15:11
@lahmatiy lahmatiy merged commit bfff88c into lahmatiy:main May 23, 2023
@lahmatiy
Copy link
Owner

@exdis Great job! Thank you!

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