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

Proposal: serialize remote nodes on in-element nodes to avoid dom exceptions #2512

Closed
wants to merge 1 commit into from

Conversation

mattmarcum
Copy link
Contributor

@mattmarcum mattmarcum commented Nov 16, 2023

Description

At my work we have a complex component that does direct dom manipluation and uses an in-element helper to boot. This caused the ember-inspector to crash with a dom exception error when trying to deepClone the render tree (dom nodes can not be deep cloned). Some debugging showed that the dom nodes were showing up in the remotes array of the in-element node, specifically in the bounds of the remote node items. Running those nodes through the same _serializeRenderNodes method kept ember-inspector from crashing.

@mattmarcum
Copy link
Contributor Author

I'm sure someone else has more knowledge of how to fix this, but I wanted to put up the pr just to get the conversation started. All tests pass locally for me.

@patricklx
Copy link
Collaborator

patricklx commented Nov 16, 2023

I wonder if we actually need the remotes in the serialized tree? I do not remember anymore...
It's only used for finding in-element nodes. I don't think it should be there

@mattmarcum
Copy link
Contributor Author

I wonder if we actually need the remotes in the serialized tree? I do not remember anymore... It's only used for finding in-element nodes. I don't think it should be there

I think I tried initially just deleting the remotes key but that caused ember-inspector to crash. Its possible I just deleted it at the wrong place in the process flow.

@patricklx
Copy link
Collaborator

@mattmarcum can you fix the linting issues? then we could merge this

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