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

Blog post for template-tag-codemod #1345

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Blog post for template-tag-codemod #1345

wants to merge 1 commit into from

Conversation

ef4
Copy link
Contributor

@ef4 ef4 commented Feb 21, 2025

This creates a new blog post.

Copy link

netlify bot commented Feb 21, 2025

Deploy Preview for ember-blog ready!

Name Link
🔨 Latest commit a79317f
🔍 Latest deploy log https://app.netlify.com/sites/ember-blog/deploys/67b8c5fa09a14600081761bc
😎 Deploy Preview https://deploy-preview-1345--ember-blog.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 site configuration.

@ef4 ef4 force-pushed the template-tag-codemod branch from 981d7ac to d00fd9c Compare February 21, 2025 18:11
@ef4 ef4 force-pushed the template-tag-codemod branch from 1733f84 to a79317f Compare February 21, 2025 18:29
- edward-faulkner
date: 2025-02-21T00:00:00.000Z
tags:
- polaris
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
- polaris
- ember-polaris

Copy link
Contributor

Choose a reason for hiding this comment

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

Also the polaris tag file can be removed


To make it easier for all teams to adopt Template Tag, we've created `@embroider/template-tag-codemod`. The goal of the codemod is fully-reliable conversion to the new format.

_Why is this codemod under the `@embroider` namespace?_
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it would be okay to bump this section down below the list of actions to take


_Why is this codemod under the `@embroider` namespace?_

Because Template Tag Codemod is powered by the same backward-compatibility infrastrucutre that we created in Embroider to allow you to adopt modern build tooling. When you build an app with Embroider, Embroider needs to identify, locate, and synthesize import statements for all the components, helpers, and modifiers that you use in your traditional handlebars templates. The Template Tag Codemod does exactly the same thing, except instead of repeating that process every time you do a build, we can do it once-and-for-all and commit the resulting GJS (or GTS for typescript users) files directly into your project. As a result, switching to Template Tag can result in improved build performance for apps that have already adopted Embroider.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
Because Template Tag Codemod is powered by the same backward-compatibility infrastrucutre that we created in Embroider to allow you to adopt modern build tooling. When you build an app with Embroider, Embroider needs to identify, locate, and synthesize import statements for all the components, helpers, and modifiers that you use in your traditional handlebars templates. The Template Tag Codemod does exactly the same thing, except instead of repeating that process every time you do a build, we can do it once-and-for-all and commit the resulting GJS (or GTS for typescript users) files directly into your project. As a result, switching to Template Tag can result in improved build performance for apps that have already adopted Embroider.
Because Template Tag Codemod is powered by the same backward-compatibility infrastructure that we created in Embroider to allow you to adopt modern build tooling. When you build an app with Embroider, Embroider needs to identify, locate, and synthesize import statements for all the components, helpers, and modifiers that you use in your traditional handlebars templates. The Template Tag Codemod does exactly the same thing, except instead of repeating that process every time you do a build, we can do it once-and-for-all and commit the resulting GJS (or GTS for TypeScript users) files directly into your project. As a result, switching to Template Tag can result in improved build performance for apps that have already adopted Embroider.

The super-short version of the instructions if you just want to give it a try are:

1. Make sure you don't have any uncommitted changes, because we're about to start mutating all your files!
2. Run `npx @embroider/template-tag-codemod`.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
2. Run `npx @embroider/template-tag-codemod`.
2. Run `npx @embroider/template-tag-codemod`. You will likely need to choose flags (documented below) for the best experience for your project.

--nativeRouteTemplates false --nativeLexicalThis false
```

- get output that is more compatible with the classic build system:
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this specifically for classic? I'm also seeing local paths not resolving with webpack-based embroider after running the codemod

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