-
-
Notifications
You must be signed in to change notification settings - Fork 23
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
Introduced Glint to ember-welcome-page #395
Conversation
|
||
export default interface EmberWelcomePageRegistry { | ||
WelcomePage: typeof WelcomePageComponent; | ||
'welcome-page': typeof WelcomePageComponent; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The welcome-page
is needed if we want to allow developers to invoke the component with either of these syntaxes:
{{! With the component helper }}
{{component "welcome-page"}}
{{! Curly-brace syntax }}
{{welcome-page}}
If we want to allow only the angle bracket syntax <WelcomePage />
, then we can delete this line.
"include": [ | ||
"src/**/*", | ||
"unpublished-development-types/**/*" | ||
], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copy-pasted from the TypeScript project that embroider-build/addon-blueprint
generates.
// Add any types here that you need for local development only. | ||
// These will *not* be published as part of your addon, so be careful that your published code does not rely on them! | ||
|
||
import '@glint/environment-ember-loose'; | ||
|
||
declare module '@glint/environment-ember-loose/registry' { | ||
// Remove this once entries have been added! 👇 | ||
// eslint-disable-next-line @typescript-eslint/no-empty-interface | ||
export default interface Registry { | ||
// Add any registry entries from other addons here that your addon itself uses (in non-strict mode templates) | ||
// See https://typed-ember.gitbook.io/glint/using-glint/ember/using-addons | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copy-pasted from the TypeScript project that embroider-build/addon-blueprint
generates.
"@glint/core": "^1.0.0-beta.2", | ||
"@glint/environment-ember-loose": "^1.0.0-beta.2", | ||
"@glint/template": "^1.0.0-beta.2", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note, a Glint user must install @glimmer/component
with version 1.1.2
or higher. Fortunately, the latest version of ember-cli
already installs v1.1.2
.
- https://typed-ember.gitbook.io/glint/using-glint/ember/installation#version-requirements
- https://github.com/ember-cli/ember-cli/blob/v4.9.2/blueprints/app/files/package.json#L32
The version requirement does not affect non-Glint users.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Additional notes since we want to support Ember 3.28 LTS: ember-cli@v3.28.6
lists "@glimmer/component": "^1.0.4"
in its package.json
.
Description
The last pull request out of a series of PRs that I will make for #387.
I hope that the series of pull requests can show others, introducing v2 addon format, TypeScript, and Glint can be easy when done in small steps. 🧡
Notes
After a new version of
ember-welcome-page
is released, we may want to update the Glint documentation. Currently, the documentation usesember-welcome-page
as an example to illustrate what an end-user of Glint could do when an addon doesn't provide its template registry.References
--typescript
flag is passed, Glint will be added to the project)