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
Copy file name to clipboardExpand all lines: text/0000-template-imports.md
+2-14Lines changed: 2 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -632,18 +632,13 @@ Once `<template>` is implemented and tooling is sufficiently stable, we will upd
632
632
633
633
#### Core Concepts: Components
634
634
635
-
This entire section will also need to be substantially reworked. Once again, I am here summarizing the changes rather than trying to rewrite the guide inplace. Each section represents a page to be changed; if a section is not mentioned, it needs few or no changes.
635
+
This entire section will also need to be substantially reworked. Once again, I am here summarizing the changes rather than trying to rewrite the guide inplace. Each section represents a page to be changed; if a section is not mentioned, it needs no substantive changes—likely only switching over to using the `<template>` wrapper.
636
636
637
637
At some point in the course ofthis discussion, we should call out (e.g. with a “Zoey says” block) that users should treat `<template>` the same way they treat a costly function which produces a result for the life of the whole app, and should therefore avoidng using `<template>` in function bodies rather than hoisting them, etc. This cannot be a hard and fast rule about where `<template>` definitions live, because there are plenty of ways to do it safely, and what’s more we *need* to do it in test modules.
638
638
639
639
The point is simply to align people’s mental model for `<template>` with *other* costly operations, since these concerns are not specific to component creation.
640
640
641
641
642
-
##### Templates are HTML
643
-
644
-
The point of this will remain the same—modulo changes for route templates; presumably we will have a top-level `<template>`, but do not need to explain that it is a component until the next page. We'll be using `.gjs` instead of `.hbs`.
645
-
646
-
647
642
##### Introducing Components
648
643
649
644
Unsurprisingly, this is the section which will see the most sweeping changes.
@@ -677,16 +672,9 @@ First, the motivation for introducing a backing class shifts slightly: we have t
677
672
Second, having made the motivation clear, we can show the `<template>` in the body of the class and explain that it is exactly the same as a standalone template component, except that it now has access to the backing class for local state, "actions", etc.
678
673
679
674
680
-
##### Looping Through Lists
681
-
682
-
This section will just need to update each of the component examples it provides to use the new syntax with a wrapper `<template>`, and in the case where the component is class-backed, move it into the backing class body.
683
-
684
-
685
675
##### Template Lifecycle, DOM, and Modifiers
686
676
687
-
Once again, many of the changes here will be mechanical: just using the new syntax. However, this also provides another opportunity to discuss (and demonstrate) the value of local-only vs. exported functionality. Both of the main custom modifier examples here currently show highly-reusable examples of modifiers which *should* be exported and should indeed probably live in their own modules. Accordingly, we might find an example which shows the value of having a locally-scoped modifier—e.g. something which manages the details of an `iframe`.
688
-
689
-
<!-- TODO: the rest of the Core Concepts updates -->
677
+
Once again, many of the changes here will be mechanical: just using the new syntax. However, this also provides another opportunity to discuss (and demonstrate) the value of local-only vs. exported functionality. Both of the main custom modifier examples here currently show highly-reusable examples of modifiers which *should* be exported and should indeed probably live in their own modules. Accordingly, we might find an example which shows the value of having a locally-scoped modifier—e.g. something which manages the private details of an `iframe`.
0 commit comments