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/0779-first-class-component-templates.md
+10-17Lines changed: 10 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,17 +9,6 @@ Relevant Team(s): Ember.js, Learning, Ember CLI
9
9
RFC PR: https://github.com/emberjs/rfcs/pull/779
10
10
---
11
11
12
-
<!---
13
-
Directions for above:
14
-
15
-
Stage: Leave as is
16
-
Start Date: Fill in with today's date, YYYY-MM-DD
17
-
Release Date: Leave as is
18
-
Release Versions: Leave as is
19
-
Relevant Team(s): Fill this in with the [team(s)](README.md#relevant-teams) to which this RFC applies
20
-
RFC PR: Fill this in with the URL for the Proposal RFC PR
21
-
-->
22
-
23
12
24
13
# First Class Component Templates
25
14
@@ -941,15 +930,19 @@ A blog post can introduce the feature along these lines when the feature ships,
941
930
942
931
The analogy here would be if a JavaScript module could only have a single function or class in it, or a CSS file could only have a single declaration in it, regardless of what actually made sense for that particular module.
943
932
944
-
<!--
933
+
- The syntax offered here, `<template>`, overlaps with [a platform built-in][platform-template]. This may provoke some degree of confusion for users if they are familiar with it. However, there are several reasons to think this drawback is not significant:
934
+
935
+
- In practice `<template>` is very-little used, and only in the context of progressive enhancement with vanilla JS—not with frameworks.
936
+
937
+
- Although it looks a little odd, the platform-native `<template>` can still be nested *within* a `<template>` tag as defined here.
938
+
939
+
- Other frameworks (most notably Vue) have used `<template>` in much the same way we are here with no major confusion on the part of developers.
945
940
946
-
> Why should we *not* do this? Please consider the impact on teaching Ember,
947
-
on the integration of this feature with other existing and planned features,
948
-
on the impact of the API churn on existing apps, etc.
941
+
- Most importantly, there is no *actual* conflict with the platform built-in, since `<template>` is not *JavaScript* syntax, which is where we are using it.
949
942
950
-
> There are tradeoffs to choosing any path, please attempt to identify them here.
943
+
- As a bonus: in a certain sense, the use of `<template>`here “rhymes” with the version from the platform: it represents the dynamic HTML content associated with some JavaScript functionality.
0 commit comments