Replaced ember-template-recast with @glimmer/syntax#310
Merged
Conversation
d1f8988 to
98b84f9
Compare
98b84f9 to
549eb31
Compare
This was referenced May 6, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Background
ember-template-recasthasn't had a release since July 2024. Codemods that need@codemod-utils/ast-templateend up depending on@glimmer/syntax@0.84.3(released in March 2023), when the latest version is0.95.0.Providing updates to
ember-template-recastwasn't easy, because the repo hadn't been maintained. The source code would fail to meet stricter lint rules and some of the tests would fail on Windows.Now that
@glimmer/syntaxis a part of theember-sourcerepo, it'll be better if@codemod-utils/ast-templatestarts to depend on@glimmer/syntaxinstead.What changed?
I copied the source code and tests from
ember-template-recast(changed file structure and code format) so that, in effect, end-users are usingember-template-recastwith the latest version of@glimmer/syntax.In the near future, I want to remove
-private/glimmer-syntax/parser.tsso that@codemod-utils/ast-templateconsumes@glimmer/syntaxdirectly. TheParserclass likely patches how@glimmer/syntax@0.84.3handles comment styles, indentations, line and column numbers, so that idempotency may be better guaranteed. We can reason this from failing tests.66 tests that fail when we remove
-private/glimmer-syntax/parser.tsCurrently,
content-tagalready fails to preserve indentations (seen when@codemod-utils/ast-template-tagis used), so development may be easier if we remove theParserclass (i.e. delegate formatting toprettier) or rewrite the patch based on the code for@glimmer/syntax@0.95.0.