Skip to content

Conversation

@dknutsen
Copy link
Contributor

Adds lexers for .gts/.gjs files. These are "Glimmer Typescript/Javascript" files used for components by the Ember front-end application framework.

This file format is mostly similar to Vue components. At a high level the files are either JavaScript or TypeScript with embedded Handlebars templates wrapped in <template>...</template> tags.

I'd like to add this support to Rouge for GitLab/Jekyll/GitHub Pages/dev.to/etc.

GitLab tracking issues/MRs:

@ijlee2
Copy link
Contributor

ijlee2 commented Sep 25, 2025

To the reviewers: @lukasnys and I came up with a different solution (independently of this pull request). You can find our approach at #2165.

@dknutsen
Copy link
Contributor Author

dknutsen commented Oct 6, 2025

Closing in favor of #2165

@dknutsen dknutsen closed this Oct 6, 2025
github-merge-queue bot pushed a commit that referenced this pull request Nov 7, 2025
* chore: Temporarily simplified /demos

* chore: Temporarily added realistic examples for handlebars, javascript, and typescript

* chore: Scaffolded lexers. Added demos for gjs and gts.

* feature: Located <template> tags

* wip, feature: Delegated templates to Handlebars

* Escape closing </template> tag and add specs (#1)

* fix: update regex to correctly delegate handlebars in gjs and gts lexers

* chore: update demo to include javascript after the closing template tag

* chore: update demo to include typescript after the closing template tag

* test: add guessing test for gjs and gts lexer

* refactor: Removed unused code

* chore: Tested a second example

* Revert "chore: Tested a second example"

This reverts commit a9953db.

* Revert "chore: Temporarily added realistic examples for handlebars, javascript, and typescript"

This reverts commit 25eddf1.

* Revert "chore: Temporarily simplified /demos"

This reverts commit 7822430.

* refactor: Added specs, demos, and visual samples for gjs and gts

* bugfix: Temporarily removed a component argument from demos, because an existing bug in the handlebars lexer causes tests to fail

* Add specs from #2163 (#3)

* chore: Copied specs from #2163

* refactor: Extracted specs for lexing

---------

Co-authored-by: Dan Knutsen <[email protected]>

---------

Co-authored-by: Lukas Nys <[email protected]>
Co-authored-by: Dan Knutsen <[email protected]>
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