Skip to content

Add support for Glimmer JS/TS files#2163

Closed
dknutsen wants to merge 4 commits intorouge-ruby:masterfrom
dknutsen:glimmer-lexer-v2
Closed

Add support for Glimmer JS/TS files#2163
dknutsen wants to merge 4 commits intorouge-ruby:masterfrom
dknutsen:glimmer-lexer-v2

Conversation

@dknutsen
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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 <dknutsen@gmail.com>

---------

Co-authored-by: Lukas Nys <nyslukas@gmail.com>
Co-authored-by: Dan Knutsen <dknutsen@gmail.com>
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