-
-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update README to reflect latest state #45
Conversation
This should hopefully make it more clear to newcomers how this addon is used and what it's named the way it is. 1. Clarify the intent of this plugin to implement First-Class Component Templates 2. Remove references to old template literal syntax 3. Link to Road to Stability issue
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We appreciate the PR! I'd like to actually keep the level of changes here much smaller, though, at least initially. In particular, I'm onboard with adding some of the new material linking it to the merged RFC, but I would prefer we keep around the existing contents for folks using both <template>
and hbs
—the latter is still supported. Also, the examples had some good material in them!
This addon began as a testing ground for various "template import" syntaxes, | ||
but has essentially evolved to implement the | ||
[First-Class Component Templates RFC](https://rfcs.emberjs.com/id/0779-first-class-component-templates/), | ||
which introduces `<template>` tags as a format for making component templates | ||
first-class participants in JavaScript and TypeScript with | ||
[strict mode](https://rfcs.emberjs.com/id/0496-handlebars-strict-mode/) | ||
template semantics. The `<template>` syntax is made available to | ||
JavaScript and TypeScript files with the `.gjs` and `.gts` extensions, respectively. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This addon implements the [First-Class Component Templates
RFC](https://rfcs.emberjs.com/id/0779-first-class-component-templates/), which
introduces `<template>` tags as a format for making component templates
first-class participants in JavaScript and TypeScript with [strict
mode](https://rfcs.emberjs.com/id/0496-handlebars-strict-mode/) template
semantics.
It also serves as a home for other syntaxes built on the same underlying primitives in Ember, including using `hbs` tagged template literal strings to create templates in JS. Although these are not the ultimate design for First-Class Component Templates, they remain supported for the transition period.
First-class component templates address a number of pain points in today’s component | ||
authoring world, and provide a number of new capabilities to Ember and Glimmer users: | ||
|
||
- accessing local JavaScript values with no ceremony and no backing class, enabling much | ||
easier use of existing JavaScript ecosystem tools, including especially styling | ||
libraries—standard [CSS Modules](https://github.com/css-modules/css-modules) | ||
will “just work,” for example | ||
- authoring more than one component in a single file, where colocation makes sense—and | ||
thereby providing more control over a component’s public API | ||
- likewise authoring locally-scoped helpers, modifiers, and other JavaScript functionality | ||
|
||
Here is an example of a `.gjs` / `.gts` component file, which demonstrates how other | ||
components (e.g. `MyComponent`) can be imported using JS/TS `import` syntax, and then | ||
rendered within the embedded `<template>` tag: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's not hard-wrap, please!
First-class component templates address a number of pain points in today’s component | |
authoring world, and provide a number of new capabilities to Ember and Glimmer users: | |
- accessing local JavaScript values with no ceremony and no backing class, enabling much | |
easier use of existing JavaScript ecosystem tools, including especially styling | |
libraries—standard [CSS Modules](https://github.com/css-modules/css-modules) | |
will “just work,” for example | |
- authoring more than one component in a single file, where colocation makes sense—and | |
thereby providing more control over a component’s public API | |
- likewise authoring locally-scoped helpers, modifiers, and other JavaScript functionality | |
Here is an example of a `.gjs` / `.gts` component file, which demonstrates how other | |
components (e.g. `MyComponent`) can be imported using JS/TS `import` syntax, and then | |
rendered within the embedded `<template>` tag: | |
First-class component templates address a number of pain points in today’s component authoring world, and provide a number of new capabilities to Ember and Glimmer users: | |
- accessing local JavaScript values with no ceremony and no backing class, enabling much easier use of existing JavaScript ecosystem tools, including especially styling libraries—standard [CSS Modules](https://github.com/css-modules/css-modules) will “just work,” for example | |
- authoring more than one component in a single file, where colocation makes sense—and thereby providing more control over a component’s public API | |
- likewise authoring locally-scoped helpers, modifiers, and other JavaScript functionality | |
Here is an example of a `.gjs` / `.gts` component file, which demonstrates how other components (e.g. `MyComponent`) can be imported using JS/TS `import` syntax, and then rendered within the embedded `<template>` tag: |
<MyComponent/> | ||
</template> | ||
``` | ||
|
||
Template imports are an upcoming feature in Ember. Like Glimmer components, the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm fine with removing this particular section, but let's leave the sections after it.
Closing in favor of #169. Thanks again for doing an initial pass here! |
This should hopefully make it more clear to newcomers how this addon is used and why it's named the way it is.