Skip to content
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

Set up Glint and TypeScript for development #460

Merged
merged 3 commits into from
Feb 1, 2024

Conversation

Windvis
Copy link
Contributor

@Windvis Windvis commented Jan 16, 2024

Add Glint and TypeScript (.gts and .ts) support to the addon, so we can start converting all the code. When everything is converted we can then publish the types.

@Windvis Windvis force-pushed the feat/glint-typescript-support branch from 64267c0 to 618d074 Compare January 16, 2024 13:22
@Windvis

This comment was marked as outdated.

This switches our blueprint to the TS version by editing the config and running `npx ember-cli-upgrade init` and resolving the conflicts. This should provide a good starting point for the Glint setup.
This enables Glint and adds ignore comments where needed. We can then start converting files to .gts one by one to enable type checking.
@Windvis Windvis force-pushed the feat/glint-typescript-support branch from dc01bf5 to 6e3b0aa Compare February 1, 2024 12:52
@Windvis Windvis changed the title Add Glint and TypeScript support Set up Glint and TypeScript for development Feb 1, 2024
This will be used to map components to their loose mode equivalent so Glint can typecheck loose mode templates.

https://typed-ember.gitbook.io/glint/environments/ember/using-addons#using-glint-enabled-addons
@Windvis Windvis force-pushed the feat/glint-typescript-support branch from 6e3b0aa to 3e73a53 Compare February 1, 2024 14:52
@Windvis Windvis marked this pull request as ready for review February 1, 2024 16:47
@@ -28,6 +44,9 @@
"lint:hbs:fix": "ember-template-lint . --fix",
"lint:js": "eslint . --cache",
"lint:js:fix": "eslint . --fix",
"lint:types": "glint",
"prepack": "glint -d",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This means we technically will already be publishing types once we add a .ts or .gts file, but I don't think that's a huge issue unless we document how to use them in apps. We consider these private until the docs are updated.

This makes testing the types easier and adventurous consumers can start using them (with the knowledge that things might break between releases).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We can probably delete this file since it's not used, but it's part of the blueprint, and maybe Glint will support separate files in the future.

@Windvis Windvis merged commit 40330a6 into master Feb 1, 2024
8 checks passed
@Windvis Windvis deleted the feat/glint-typescript-support branch February 1, 2024 17:33
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.

1 participant