Skip to content

Convert in-depth topics to use gjs #2127

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

Open
wants to merge 10 commits into
base: gjs
Choose a base branch
from
Open

Conversation

tcjr
Copy link

@tcjr tcjr commented Jul 29, 2025

This PR updates the 4 markdown files in the Core Concepts / In-Depth Topics to use gjs.

I tried to limit the changes here to only migrating from js+hbs to gjs. In a few places, some reordering of the prose around the code snippets was unavoidable. Based on the number of changes, I'd recommend going through the rendered docs and see if anything looks awry.

Some notes:

  • Since gjs requires explicit imports, I added imports for things like Input and modifier. But I don't know the imports for the component helper and helper helper, so those should be addressed.
  • In autotracking-in-depth, some of the snippets now have diff indicators where they didn't before.
  • In rendering-values, everything that was just handlebars has been wrapped in <template></template> in a gjs block. Many of these care incomplete however, because they reference stuff that is not in scope. I think this is fine, but maybe somebody else has an opinion on a better way to handle these.

Leaving as a draft until I figure out the imports.

Copy link

netlify bot commented Jul 29, 2025

Deploy Preview for ember-guides ready!

Name Link
🔨 Latest commit f540897
🔍 Latest deploy log https://app.netlify.com/projects/ember-guides/deploys/68926bc5e9394d00086c7006
😎 Deploy Preview https://deploy-preview-2127--ember-guides.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

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

```gjs {data-filename=app/components/super-form.gjs}
import SuperInput from './super-input.gjs';
import SuperTextarea from './super-input.gjs';
import SuperSubmit from './super-input.gjs';

Copy link
Author

Choose a reason for hiding this comment

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

Need to import hash and component helpers.

Copy link
Contributor

Choose a reason for hiding this comment

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

Why's this resolved? I don't see the imports added to the example

Copy link
Author

Choose a reason for hiding this comment

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

Ah, I see I forgot hash. According to @NullVoxPopuli the others are keywords and don't need to imported.

Copy link
Contributor

Choose a reason for hiding this comment

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

component is built-in.

Copy link
Contributor

Choose a reason for hiding this comment

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

hash will one day be built in, but that's not soon unless I find some dedicated time to learn how to do it. The last blocker for it was just cleared this week (now it's just me + time)

import SuperSubmit from './super-input.gjs';
import superIsValid from '../helpers/super-is-valid.js';
import superErrorFor from '../helpers/super-error-for.js';
import superAutoResize from '../modifiers/super-auto-resize.js';

Copy link
Author

Choose a reason for hiding this comment

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

Need to import hash, helper, modifier, and component helpers.

Copy link
Contributor

Choose a reason for hiding this comment

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

Same question here

@IgnaceMaes
Copy link
Member

Some of the built-in imports are documented here: https://guides.emberjs.com/release/components/template-tag-format/#toc_importing-built-ins

@tcjr
Copy link
Author

tcjr commented Jul 29, 2025

Some of the built-in imports are documented here: https://guides.emberjs.com/release/components/template-tag-format/#toc_importing-built-ins

But not 'component' or 'helper' or 'modifier'.

@NullVoxPopuli
Copy link
Contributor

But not 'component' or 'helper' or 'modifier'.

ya, these are built-in keywords

@tcjr
Copy link
Author

tcjr commented Jul 29, 2025

ya, these are built-in keywords

Oh, nice. I can just delete those TODO placeholders.

@tcjr tcjr marked this pull request as ready for review July 30, 2025 13:29
@IgnaceMaes
Copy link
Member

Would be great to also have those documented as built-in keyword on the template tag page!

{{yield (hash key=(theHelper) key2=(theHelper with args)) }}
```gjs
<template>
{{yield (hash key=(theHelper) key2=(theHelper with args)) }}
Copy link
Author

Choose a reason for hiding this comment

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

import { hash } from '@ember/helper';

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.

4 participants