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
The site currently uses a very old (pre-v1) version of tagalong. v2 solves a bunch of the issues that the site works around in various ways, but also has an entirely different API:
In v0, the data "context" was referred to as a set of "directives" that are bound to and called with the data. (For instance this element's data-bind attribute refers to this directive.) In v1 and later, this relationship is not explicit: expressions are evaluated on either the context or the data—whichever matches the expression.
In v0, the data "directives" were all interpolated immediately and applied to specific nodes, which meant that we needed to render data to each section individually rather than just rendering the outermost template element, which is the norm in v2.
These differences will necessitate a rewrite of most of either the JavaScript or the HTML. There are two ways that we could go about it:
Update only the HTML, replacing data-bind and class attributes with more explicit tagalong expressions. E.g. data-bind="size_number" would become t-text="(d) => size_number(d)".
Rename the data-bind attributes to the corresponding t-attributes, and modify the JavaScript to pass "proxies" to tagalong.render() that evaluate similarly named properties like size_number in the context of specific data elements. With some slight modifications to picc.school.directives, we could do this with object-surrogate:
In either case, v0-style "directives" that set text or attributes of child elements would need to be migrated to the HTML, since v1 and later removes support for these and shifts all responsibility for defining template logic to the HTML.
The text was updated successfully, but these errors were encountered:
The site currently uses a very old (pre-v1) version of tagalong. v2 solves a bunch of the issues that the site works around in various ways, but also has an entirely different API:
data-bind
attribute refers to this directive.) In v1 and later, this relationship is not explicit: expressions are evaluated on either the context or the data—whichever matches the expression.These differences will necessitate a rewrite of most of either the JavaScript or the HTML. There are two ways that we could go about it:
Update only the HTML, replacing
data-bind
andclass
attributes with more explicit tagalong expressions. E.g.data-bind="size_number"
would becomet-text="(d) => size_number(d)"
.Rename the
data-bind
attributes to the correspondingt-
attributes, and modify the JavaScript to pass "proxies" totagalong.render()
that evaluate similarly named properties likesize_number
in the context of specific data elements. With some slight modifications topicc.school.directives
, we could do this with object-surrogate:In either case, v0-style "directives" that set text or attributes of child elements would need to be migrated to the HTML, since v1 and later removes support for these and shifts all responsibility for defining template logic to the HTML.
The text was updated successfully, but these errors were encountered: