You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
One (perhaps the only?) viable alternative if we must support the table element as is, would be empty template elements, which was the direction I was going before I learned of the ability to query processing instructions with xpath. I was able to get nested loops working without bookending before and after, relying instead on the cnt attribute. But I only tested that two levels deep, and didn't yet convince myself it wouldn't run into trouble as the complexity of scenarios increased. So I would be hesitant to adopt that solution without far bigger implementations from high usage libraries trying it out.
As my comments indicate, I would have preferred using the data element, as that seems to be its purpose, but as I recall, table elements spit them out as well.
Has anyone done performance comparisons between the two? (empty template elements vs processing instructions). Yes, my intuition tells me processing instructions would win out, but you never know, I guess?
Looks like Tuesday, May 2nd 10-11am is the only time slot in which everyone is available with Tuesday, May 2nd 9am-10am being the second slot with most availability (only smaug is unavailable).
With that in mind, I tentatively propose we host this on Tuesday, May 2nd 9am through 11am PDT (UTC 4pm through 6pm)
Reacted by Keith Cirkel, Tom Wilkinson and Mason Freed
In case anyone's interested, I ran a simple test of creating thousands of empty template elements vs processing instructions. Performance was roughly equal.
Are there any notes of what was discussed that led to doubts whether {{}} is a feasible authoring tool? If it isn't a feasible authoring tool, then there doesn't seem much point to supporting interpolation beyond what spans can provide. However, I think the output of what is rendered needs to provide enough information so we can reverse engineer everything.
I earlier endorsed (to the wind, I'm sure) the comment idea, but if my quick analysis is correct that the cost of a processing instruction matches the cost of an empty template, templates would be much easier to apply an xslt transform to reverse engineer the server rendered content to extract the data and {{}} based template (which would keep the syntax the originating template needs to support simpler).
A quick lookup indicates comments can be used for ranges, so not sure where that question came from either. Maybe there's some more subtle nuance I'm missing?
I also did my usual second guessing about the possibility of using "flat" elements (no bookending) to model nested structures. I don't yet have 100% in my solution. But I remember now where I got the idea. There are actually plenty of robust grids (starting with slickgrid) that managed this quite well (using "levels" to keep track of the nested structure). This would reduce the number of (unnecessary) elements, I think, which could only help performance. At least something to consider?
@bahrus I'm not sure how you would suggest that we replace processing instructions in the current proposal with <template> and what benefit <template> has to mark nodes and child node ranges rather than processing instructions/comments? Ack that we could throw data into a <template> in attributes or other child nodes, but I don't think that's much easier than just parsing metadata as JSON or whatever in userland.
The question is whether or not comments should mark the beginning and end of a child node range. Meaning, if you remove one of the comment nodes from the DOM, the range would be invalid, and whatever nodes are between the two comments be precisely what the range represents, rather than some abstract non-DOM based concept of a child node range where you would have to explicitly add or replace nodes in the range via a new API, and sibling additions would have no impact (which leads to unintuitive behavior like if a node gets added in between two nodes that are part of the range, should that node be part of the range too?). It's really a question of whether the placeholders representing ranges should be serialized to the DOM as nodes (in the declarative case, comment nodes, but in the imperative case whatever nodes the user provides) or not.
Not sure I understand what a "flat" element possibility would be, perhaps you could explain.
@tbondwilkinson , thanks for the clear explanation on the child node range issue.
I'm sure I don't yet fully understand the processing instruction proposal, and that will quickly become apparent with my examples below, but the way I see our options is this:
Suppose we do use {{}} as out authoring tool.
And suppose our template looks like this:
<template>Hello, {{name}}</template>
And say the host object is:
{"name": "Adam"}
The server could generate:
Hello, Adam
which would leave us unable to reverse engineer the output and update the name property, nor infer what the original template looked like. Hence the need for some markers, which could include a "book-ended", "non-flat" child processing instruction:
I'm suggesting C and D might perform a little better, especially with many nodes, because it cuts the number of nodes in half (roughly).
Although I agree with full access to JS and sufficient grunt work, it is possible to extract out the same information with all of these, I'm suggesting that I have more options to do it more simply when I compare B with A. With B I can query using CSS (in addition to XPath), and XSLT instructions might be simpler, because I'm not sure "attributes" inside the processing instruction come pre-parsed? Same goes with JS manipulation. If the performance is the same, doesn't that give empty templates the edge as far as what we should prefer?
Is main document {{}} as an authoring format feasible or not?
Are there any notes of what was discussed that led to doubts whether {{}} is a feasible authoring tool?
The main objection (attempting to summarise from the notes) is that {{}} may leave artefacts in the rendered DOM, as there's no default value. What does <div>{{name}}</div> do if name isn't supplied in the data? For templates this is not an issue as they're not user visible until processed.
Another potential benefit of using empty template elements: I could see the microdata initiative of itemprops attributes being extended to support empty template elements. Extending it to support processing instructions seems less likely to me.
I don't think this is the issue to discuss these things. It would be much easier to track the syntax discussion in a syntax issue. This one should be about planning the meeting.
Mine:
Week of June 5th to 9th
Week of June 12th to 16th
Week of June 19th to 23rd
Week of July 3rd to 7th (3/4 are US holidays at least for me)
Week of July 10th to 14th
Week of July 17th to 21st
Week of July 24th to 28th
Myself and a few other folks (Justin, Mason) are planning on attending the meeting tomorrow, if it still works for you Ryosuke and anyone else who was originally interested.
I did some prototyping over the weekend with Chrome Canary's experimental implementation in rictic/web-template-workbench#1. I'll plan to attend and share feedback.
Activity
tbondwilkinson commentedon Apr 18, 2023
Should we throw some ideas around for an agenda?
Question I would like to see answered:
{{}}as an authoring format feasible or not?{{}}is not feasible, is processing instruction for main document and<template>feasible?bahrus commentedon Apr 18, 2023
One (perhaps the only?) viable alternative if we must support the table element as is, would be empty template elements, which was the direction I was going before I learned of the ability to query processing instructions with xpath. I was able to get nested loops working without bookending before and after, relying instead on the cnt attribute. But I only tested that two levels deep, and didn't yet convince myself it wouldn't run into trouble as the complexity of scenarios increased. So I would be hesitant to adopt that solution without far bigger implementations from high usage libraries trying it out.
As my comments indicate, I would have preferred using the data element, as that seems to be its purpose, but as I recall, table elements spit them out as well.
Has anyone done performance comparisons between the two? (empty template elements vs processing instructions). Yes, my intuition tells me processing instructions would win out, but you never know, I guess?
rniwa commentedon Apr 19, 2023
Looks like Tuesday, May 2nd 10-11am is the only time slot in which everyone is available with Tuesday, May 2nd 9am-10am being the second slot with most availability (only smaug is unavailable).
With that in mind, I tentatively propose we host this on Tuesday, May 2nd 9am through 11am PDT (UTC 4pm through 6pm)
bahrus commentedon Apr 19, 2023
In case anyone's interested, I ran a simple test of creating thousands of empty template elements vs processing instructions. Performance was roughly equal.
bahrus commentedon Apr 19, 2023
Are there any notes of what was discussed that led to doubts whether {{}} is a feasible authoring tool? If it isn't a feasible authoring tool, then there doesn't seem much point to supporting interpolation beyond what spans can provide. However, I think the output of what is rendered needs to provide enough information so we can reverse engineer everything.
I earlier endorsed (to the wind, I'm sure) the comment idea, but if my quick analysis is correct that the cost of a processing instruction matches the cost of an empty template, templates would be much easier to apply an xslt transform to reverse engineer the server rendered content to extract the data and {{}} based template (which would keep the syntax the originating template needs to support simpler).
A quick lookup indicates comments can be used for ranges, so not sure where that question came from either. Maybe there's some more subtle nuance I'm missing?
I also did my usual second guessing about the possibility of using "flat" elements (no bookending) to model nested structures. I don't yet have 100% in my solution. But I remember now where I got the idea. There are actually plenty of robust grids (starting with slickgrid) that managed this quite well (using "levels" to keep track of the nested structure). This would reduce the number of (unnecessary) elements, I think, which could only help performance. At least something to consider?
tbondwilkinson commentedon Apr 20, 2023
@bahrus I'm not sure how you would suggest that we replace processing instructions in the current proposal with
<template>and what benefit<template>has to mark nodes and child node ranges rather than processing instructions/comments? Ack that we could throw data into a<template>in attributes or other child nodes, but I don't think that's much easier than just parsing metadata as JSON or whatever in userland.The question is whether or not comments should mark the beginning and end of a child node range. Meaning, if you remove one of the comment nodes from the DOM, the range would be invalid, and whatever nodes are between the two comments be precisely what the range represents, rather than some abstract non-DOM based concept of a child node range where you would have to explicitly add or replace nodes in the range via a new API, and sibling additions would have no impact (which leads to unintuitive behavior like if a node gets added in between two nodes that are part of the range, should that node be part of the range too?). It's really a question of whether the placeholders representing ranges should be serialized to the DOM as nodes (in the declarative case, comment nodes, but in the imperative case whatever nodes the user provides) or not.
Not sure I understand what a "flat" element possibility would be, perhaps you could explain.
bahrus commentedon Apr 20, 2023
@tbondwilkinson , thanks for the clear explanation on the child node range issue.
I'm sure I don't yet fully understand the processing instruction proposal, and that will quickly become apparent with my examples below, but the way I see our options is this:
Suppose we do use {{}} as out authoring tool.
And suppose our template looks like this:
And say the host object is:
{"name": "Adam"}The server could generate:
which would leave us unable to reverse engineer the output and update the name property, nor infer what the original template looked like. Hence the need for some markers, which could include a "book-ended", "non-flat" child processing instruction:
A:
or a book-ended, non flat empty templates:
B:
or a "non-book-ended", "flat" representation with empty templates:
C:
or a "non-book-ended", "flat" representation with processing instructions:
D:
I'm suggesting C and D might perform a little better, especially with many nodes, because it cuts the number of nodes in half (roughly).
Although I agree with full access to JS and sufficient grunt work, it is possible to extract out the same information with all of these, I'm suggesting that I have more options to do it more simply when I compare B with A. With B I can query using CSS (in addition to XPath), and XSLT instructions might be simpler, because I'm not sure "attributes" inside the processing instruction come pre-parsed? Same goes with JS manipulation. If the performance is the same, doesn't that give empty templates the edge as far as what we should prefer?
keithamus commentedon Apr 20, 2023
The main objection (attempting to summarise from the notes) is that
{{}}may leave artefacts in the rendered DOM, as there's no default value. What does<div>{{name}}</div>do ifnameisn't supplied in the data? For templates this is not an issue as they're not user visible until processed.bahrus commentedon Apr 20, 2023
Another potential benefit of using empty template elements: I could see the microdata initiative of itemprops attributes being extended to support empty template elements. Extending it to support processing instructions seems less likely to me.
justinfagnani commentedon Apr 20, 2023
I don't think this is the issue to discuss these things. It would be much easier to track the syntax discussion in a syntax issue. This one should be about planning the meeting.
tbondwilkinson commentedon Apr 20, 2023
Opened #1003
EisenbergEffect commentedon May 2, 2023
Are we meeting today, Tuesday, May 2nd 9am through 11am PDT (UTC 4pm through 6pm)??? I need to make some plans...
bkardell commentedon May 2, 2023
I'm curious as well
sashafirsov commentedon May 2, 2023
the meeting still not on WCCG calendar, could someone send an invite, please?
https://www.w3.org/groups/cg/webcomponents/calendar
8 remaining items
mfreed7 commentedon May 8, 2023
Mine:
Week of June 5th to 9th
Week of June 12th to 16th
Week of June 19th to 23rd
Week of July 3rd to 7th (3/4 are US holidays at least for me)
Week of July 10th to 14th
Week of July 17th to 21st
Week of July 24th to 28th
tbondwilkinson commentedon May 23, 2023
Should we decide on a week?
rniwa commentedon May 23, 2023
Looks like the week of July 17th and July 24th are only weeks in which everyone is available.
tbondwilkinson commentedon May 24, 2023
Works for me! Can you put together a whenisgood for those two weeks?
rniwa commentedon May 24, 2023
https://www.when2meet.com/?20168849-v82m5
rniwa commentedon May 25, 2023
Looks like Tue, July 18th 10am to 12pm PDT (5pm to 7pm UTC) is the current winner so far.
R3D-CODE commentedon Jun 29, 2023
@tbondwilkinson I've started to write a template engine, and I decided to use this format:
${}, which is familiar format in JS, and can be used everywhere$[], for partial templatestbondwilkinson commentedon Jul 17, 2023
Myself and a few other folks (Justin, Mason) are planning on attending the meeting tomorrow, if it still works for you Ryosuke and anyone else who was originally interested.
EisenbergEffect commentedon Jul 17, 2023
I've got it on my calendar and am planning to attend. Just need the meeting invite when it's available.
bkardell commentedon Jul 17, 2023
I'm not sure if I can come but can I get an invite in case I can? I'd like to.
rniwa commentedon Jul 17, 2023
DOM Parts F2F
Tuesday, July 18 · 10:00 – 12:00 (PDT)
Time zone: America/Los_Angeles
Google Meet joining info
Video call link: https://meet.google.com/gbu-spbc-mzk
rictic commentedon Jul 17, 2023
I did some prototyping over the weekend with Chrome Canary's experimental implementation in rictic/web-template-workbench#1. I'll plan to attend and share feedback.
mfreed7 commentedon Jul 18, 2023
Updated meeting link for today:
DOM Parts F2F
Tuesday, July 18 · 10:00am – 12:00pm
Time zone: America/Los_Angeles
Google Meet joining info
Video call link: https://meet.google.com/hgj-rwkp-cww
Or dial: (US) +1 509-676-2430 PIN: 798 465 786#
More phone numbers: https://tel.meet/hgj-rwkp-cww?pin=9066503354465
rictic commentedon Jul 18, 2023
Meeting minutes: https://docs.google.com/document/d/1nsY35OMiYVufEXnhHl8v0nPXxvYXfdNBI3XNZws4VYA/edit