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

Optional Shadow DOM Isolation #660

Open
FlorianRappl opened this issue Dec 16, 2023 · 1 comment
Open

Optional Shadow DOM Isolation #660

FlorianRappl opened this issue Dec 16, 2023 · 1 comment
Assignees
Labels
core Concerns the piral-core library. enhancement New feature or request in-review The item is currently being reviewed.
Milestone

Comments

@FlorianRappl
Copy link
Contributor

New Feature Proposal

For more information, see the CONTRIBUTING guide.

Description

With 1.4.0 we've introduced the piral-component isolation, which - among some consistency - adds not much so far. However, one of the options we get with this web component is to enable shadow DOM - either as an opt-in from the respective component or by default from the shell.

Background

I've written an article earlier this year about CSS in MF, which also lists shadow DOM as a potential solution (granted, with its own problems) for avoiding styling conflicts.

By putting components from MFs directly into the shadow DOM we are able to avoid these conflicts in the first place.

Discussion

What should be all done by the orchestrator? I think at least:

  • Make the shadow root the container for rendering (e.g., for React as portal, or for other frameworks as host)
  • Move over the style sheet(s) from the MF into the shadow tree

Furthermore, it might be interesting to move the stylesheet(s) of the app shell into the shadow tree as this is the part we'd still want as a basis. All other styles (from any other MF) should not be included.

This brings up a question: What if we use a shared library that comes with a stylesheet? With the steps above we cannot know (and therefore act) and use it. The isolated component would need to bring over the styles.

@FlorianRappl FlorianRappl added enhancement New feature or request core Concerns the piral-core library. in-review The item is currently being reviewed. labels Dec 16, 2023
@FlorianRappl FlorianRappl added this to the 1.5.0 milestone Dec 16, 2023
@FlorianRappl FlorianRappl self-assigned this Dec 16, 2023
@FlorianRappl FlorianRappl added in-implementation The item is currently being implemented. and removed in-review The item is currently being reviewed. labels Feb 16, 2024
@FlorianRappl FlorianRappl modified the milestones: 1.5.0, 2.0.0 Feb 20, 2024
@FlorianRappl FlorianRappl added in-review The item is currently being reviewed. and removed in-implementation The item is currently being implemented. labels Feb 20, 2024
@FlorianRappl
Copy link
Contributor Author

This is deferred until Piral v2. This way its consistent from the get-go instead of something half-baked now that potentially breaks later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Concerns the piral-core library. enhancement New feature or request in-review The item is currently being reviewed.
Projects
None yet
Development

No branches or pull requests

1 participant