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

No support for Shadow DOMs #78

Open
Epictek opened this issue Oct 21, 2018 · 5 comments
Open

No support for Shadow DOMs #78

Epictek opened this issue Oct 21, 2018 · 5 comments

Comments

@Epictek
Copy link

Epictek commented Oct 21, 2018

This would be a useful feature for my current project.

Seems like a lot of changes would be required to support it though? For a start setRenderer would need to take an element rather than a string for the root dom and the KaraxInstance would also need to contain the rootElement.

I'm not sure what other changes would also need to be made but hopefully it can be done without breaking backwards compatibility.

@Araq
Copy link
Collaborator

Araq commented Oct 22, 2018

You need to elaborate on this feature request. It might be just what I've wanted to do for a couple of weeks now, though... :-)

@Epictek
Copy link
Author

Epictek commented Oct 23, 2018

Well my use case is I want to render a karax vdom within a page inside of a shadow dom root.

Vue lets you do it using the following code

import Vue from 'vue';

const shadow = document.querySelector('#hostElement').shadowRoot;

new Vue({
el: shadow.querySelector('#app'),
// ...
})

@Epictek
Copy link
Author

Epictek commented Oct 23, 2018

Also seems like shadow dom api needs to be added to the main nim js lib before this is possible.

@Araq
Copy link
Collaborator

Araq commented Oct 23, 2018

So... karax.setForeignNodeId()?

@timotheecour
Copy link
Collaborator

We should revisit this now that nim-lang/Nim#14979 was merged; I also am curious whether shadow dom could simplify some aspects of karax (including encapsulation of DOM and css)

some links:

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

No branches or pull requests

3 participants