Skip to content

DEV: introduce Ember <template> tag support (.gjs)#22719

Merged
davidtaylorhq merged 13 commits intomainfrom
gjs
Jul 20, 2023
Merged

DEV: introduce Ember <template> tag support (.gjs)#22719
davidtaylorhq merged 13 commits intomainfrom
gjs

Conversation

@davidtaylorhq
Copy link
Copy Markdown
Member

Relands #21899 rebased onto latest main, and with plugin support

chancancode and others added 9 commits July 20, 2023 19:54
This enables support for .gjs files in the build

Co-authored-by: Krystan HuffMenne <kmenne+github@gmail.com>
* Add missing `truth-helpers` dependencies

This addon is in the workspace but not explicitly referenced in
package.json (should it be in devDependencies?)

* Export helpers from `d-icon` in discourse-common

In order to use helpers in `<template>` they need to be imported.
Not sure what's the semantics of the `registerUnbound` internal helper
and if this refactor changed anything important.

Co-authored-by: Krystan HuffMenne <kmenne+github@gmail.com>
This tells GitHub to use js/ts mode for gjs/gts syntax highlighting,
which is hopefully better than nothing?

Co-authored-by: Krystan HuffMenne <kmenne+github@gmail.com>
Co-authored-by: Krystan HuffMenne <kmenne+github@gmail.com>
This adds Glint to the project in JS mode (as opposed to TS). This
brings back the basic JS language server support in .gjs files in
VSCode (if you have the Glint extension installed).

For other editors, it should be possible to integrate directly via the
`glint-language-server` executable.

Co-authored-by: Krystan HuffMenne <kmenne+github@gmail.com>
Change the sample vscode settings:

extensions.json – this "recommends" the appropriate VSCode extensions
for use with .gjs development

settings.json – this sets the default formatter for .gjs files (without
this setting the user will be prompted to select one the first time),
also sets up the ESLint extension to check .gjs files.

Note that – the .vscode-sample directory doesn't do anything by itself.
These changes need to be pulled into your local `.vscode` directory.

Added the `.vscode` directory to `.gitignore` for now, but feel free to
improve on that setup.

Co-authored-by: Krystan HuffMenne <kmenne+github@gmail.com>
@davidtaylorhq davidtaylorhq marked this pull request as ready for review July 20, 2023 19:47
export function renderIcon(renderType, id, params) {
params ||= {};

export function renderIcon(renderType, id, options = {}) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Are we 100% sure this is safe change? 😃 There might be a null value passed in, e.g. by some theme component?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Reverted that diff

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants