Skip to content
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

Closed
wants to merge 1 commit into from

Conversation

machty
Copy link

@machty machty commented Aug 22, 2022

This should hopefully make it more clear to newcomers how this addon is used and why it's named the way it is.

  1. Clarify the intent of this addon to implement First-Class Component Templates
  2. Remove references to old template literal syntax
  3. Link to Road to Stability issue

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
Copy link
Collaborator

@chriskrycho chriskrycho left a 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!

Comment on lines +5 to +12
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.
Copy link
Collaborator

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.

Comment on lines +14 to +27
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:
Copy link
Collaborator

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!

Suggested change
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
Copy link
Collaborator

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.

@chriskrycho
Copy link
Collaborator

Closing in favor of #169. Thanks again for doing an initial pass here!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants