- From: James Browning <notifications@github.com>
- Date: Wed, 03 Feb 2021 02:43:38 -0800
- To: whatwg/dom <dom@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
- Message-ID: <whatwg/dom/issues/831/772412200@github.com>
> Here there is no way to branch that (unless the server did something based on user agent). > I don't think there is any way to maintain backwards compatibility if you want to use shadow DOM and SSR. This isn't true, it only has the same limitations the existing non-declarative Shadow DOM (via `.attachShadow`) has. If you can polyfill Shadow DOM then you can polyfill DSD fairly trivially on top of it†. Whether or not something breaks backwards compatibility is purely based on whether polyfilled Shadow DOM will break backwards compatibility for your use case. Even if you can't be bothered with DSD polyfilling, you can just hide elements that haven't upgraded yet (e.g. by setting `style="visibility: hidden;"` or similar) and reveal them when upgrade happens. Note that this is still something that needs to happen in your tooling, if you have tooling that polyfills Shadow DOM for old browsers then you will need to extend it to generate appropriate things for DSD (e.g. like `style="visibility: hidden;"` mentioned above, or fallback light DOM, or whatever thing you want it do). † This doesn't mean existing polyfills will support it, it just means they could. You might need to write the polyfill yourself, but with a shadow DOM polyfill it's fairly trivial. > It should be noted that DSD is not a drop in replacement for rendering light DOM WC content (which alot of people are doing atm) Yes, if you're not using Shadow DOM, then there's not really any reason to use DSD. DSD is effectively just a declarative form of `.attachShadow(...)` with a couple tweaks to make it work nicely with existing `.attachShadow` calls. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/whatwg/dom/issues/831#issuecomment-772412200
Received on Wednesday, 3 February 2021 10:43:50 UTC