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

Fix rendering into shadow root #11037

Merged
merged 2 commits into from Oct 2, 2017
Merged

Conversation

gaearon
Copy link
Collaborator

@gaearon gaearon commented Oct 2, 2017

Fixes #11017.

  1. Removes a unit test we always skip (it's from the times we ran tests in browsers).
  2. Adds a fixture that actually verifies we can mount into shadow root.
  3. Fixes mounting into shadow root.

Before:

screen shot 2017-10-02 at 19 53 57

After:

screen shot 2017-10-02 at 19 54 36

@reactjs-bot
Copy link

Deploy preview ready!

Built with commit f94bed8

https://deploy-preview-11037--reactjs.netlify.com

Copy link
Contributor

@aweary aweary left a comment

Choose a reason for hiding this comment

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

LGTM, should we add a small test for mounting into a document fragment?

@aweary
Copy link
Contributor

aweary commented Oct 2, 2017

@gaearon do we need to update validateDOMNesting to check for #fragment too?

@gaearon
Copy link
Collaborator Author

gaearon commented Oct 2, 2017

do we need to update validateDOMNesting to check for #fragment too?

I don't think we need to. I intentionally changed it to skip that check since it's valid to render anything into a fragment.

@gaearon
Copy link
Collaborator Author

gaearon commented Oct 2, 2017

LGTM, should we add a small test for mounting into a document fragment?

If you'd like as a follow up :-)

@gaearon gaearon merged commit 8b4ec79 into facebook:master Oct 2, 2017
@gaearon gaearon deleted the shadow-root-fixes branch October 2, 2017 22:13
}`
)(React, ReactDOM, HelloWorld);

customElements.define('my-element', MyElement);
Copy link
Contributor

Choose a reason for hiding this comment

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

@gaearon this is causing the fixtures to fail in browsers that don't have customElements. We should either provide a polyfill or only run this fixture in browsers that support the custom element registry.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fiber cannot render to DocumentFragment/ShadowRoot
4 participants