Skip to content

Add template reference, component reference, and typescript reference - #2248

Open
NullVoxPopuli wants to merge 5 commits into
masterfrom
t3/port-glimmer-cheatsheet-reference
Open

NullVoxPopuli wants to merge 5 commits into
masterfrom
t3/port-glimmer-cheatsheet-reference

Conversation

@NullVoxPopuli

@NullVoxPopuli NullVoxPopuli commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Adds /release/reference/templates/, a single page that lists everything you can write in an Ember <template>, with a short example for each. Ported from the Ember.js cheat sheet and updated for Ember 7.1+ .gjs/.gts.

  • Syntax-only headings ({{#if ...}}, (fn ...), {{{ ... }}}) so the "On this page" sidebar fits
  • Sections for TypeScript, component how-tos, and component patterns
  • API names in prose link to the API docs
  • New "Reference" heading in the left nav, above Developer Tools
  • /reference/ now redirects to this page instead of the Octane upgrade guide

Heads-up: headings can't contain ", because showdown-section-groups reads heading ids with a greedy regex and breaks the HTML.

🤖 Generated with Claude Code

@netlify

netlify Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for ember-guides ready!

Name Link
🔨 Latest commit 55d7899
🔍 Latest deploy log https://app.netlify.com/projects/ember-guides/deploys/6b05d927ed5a197a48952dd2
😎 Deploy Preview https://deploy-preview-2248--ember-guides.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@ef4

ef4 commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Minor nitpick:

A template-only component has no class, so there this is undefined

A template-only component doesn't provide a this, but there still could be a valid lexical this around it.

class X {
  message = 'hi'
  get someComponent() {
    // works
    return <template>{{this.message}}</templ
  }
}

I don't know if this is worth explaining in detail, it's more like something that just should work if somebody happens to try it. Maybe the wording can be loosened to focus on the positive case: "A template inside a class can use this to access the instance of the class" and not go into the negative case ("template-only components don't treat this as anything special, if one is in scope it works the same as it would in javascript").

@NullVoxPopuli

Copy link
Copy Markdown
Contributor Author

todos:

  • move component stuff to a component reference page
  • rephrase template-only this stuff to "template-only components don't provide a this"

@NullVoxPopuli
NullVoxPopuli force-pushed the t3/port-glimmer-cheatsheet-reference branch from ad8cfb0 to 5d23fd2 Compare November 23, 2026 20:10
@NullVoxPopuli NullVoxPopuli changed the title Add a Template Reference page Add template reference, component reference, and typescript reference Nov 23, 2026
@kategengler

Copy link
Copy Markdown
Contributor

The additional pages aren't showing in the sidebar?

NullVoxPopuli and others added 3 commits November 23, 2026 17:51
A heading entry with pages renders as a collapsible group that links to
toc-heading_reference. The page tree also drops heading entries, so the
three pages had no section, no highlight, and no previous/next links.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…v-section

Show Reference as a nav section with Template, Component, and TypeScript

Use `@name` in the template.
Use `this.args.name` in the class.
A getter that reads an argument computes again when the argument changes.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this say that args are automatically tracked and also update the template when they are changed?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes!


### Do something on creation

The `constructor` runs one time, when Ember creates the component.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The `constructor` runs one time, when Ember creates the component.
The `constructor` runs one time, when Ember creates the component instance.

}
```

A Glimmer component has no hooks for render or update.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
A Glimmer component has no hooks for render or update.

This statement only makes sense if comparing to old components, but this is a going-forward, living reference.

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.

3 participants