Re: [WICG/webcomponents] [dom-parts] Declarative syntax for creating DOM Parts (Issue #1003)

Additionally, you mention that the benefit of `<template>` is that it's easier to query for. It's a non-goal for these markers to be easily queried. The performance benefit of adding these markers into the DOM is that the browser can better parse and cache them, making their lookup constant time without needing to do any query or DOM walk. So the fact that PI/comments are not particularly easily to query is probably more of a feature than a bug.

If someone wanted lightweight nodes wrapping content that they can easily query, that's precisely a `<span>` with ids or classes. The idea is that we want to speed up hydration of DOM after a render.

You also mention that by only having an opening marker without a closing marker, we would save bytes. It can be hard to speculate on this type of thing because compression algorithms like gzip and brotli make bytes in not equal bytes out, and so repeated content does not always lead to linearly many output bytes. I'd encourage you if you're curious to run a sample piece of HTML with and without end markers into gzip and brotli and see what the size difference actually is.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/WICG/webcomponents/issues/1003#issuecomment-1516507488
You are receiving this because you are subscribed to this thread.

Message ID: <WICG/webcomponents/issues/1003/1516507488@github.com>

Received on Thursday, 20 April 2023 15:11:47 UTC