You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 570ffdd
Browse filesBrowse the repository at this point in the historyBrowse files
This moves type-checking from Glint's `ember-tsc` to TypeScript 7.
TypeScript 7 checks `.gts` and `.gjs` files itself, through
`ember-content-mapper`. A full check of core, plugins and themes takes
about 15 seconds and 3GB of memory. The Glint build needed an 8GB Node
heap and several minutes.
- `typescript` is now the TypeScript 7 nightly, and `pnpm lint:types`
runs `tsc -b --runExternalCode`. ESLint runs on TypeScript 5.9 through
lint-configs, and TypeScript 6 stays only for `@glint/tsserver-plugin`.
- Bundled plugins and themes use `@discourse/types` from the workspace
and reference the core project. One `tsc -b` run checks core and every
plugin, and a core type change no longer needs a package release first.
- The published `@discourse/types` works with both TypeScript 6 and 7,
so plugins outside this repository can move over when they are ready.
- The linting workflow checks that the TypeScript 7 language server
resolves core imports from a plugin.
- The nightly is pinned to `7.1.0-dev.20260930.4`. Later nightlies fail
in seven places in core because of microsoft/TypeScript#64656.
- TypeScript 7 reports a few errors that Glint dropped because they
landed on generated code. This fixes them.
For editors, install the TypeScript 7 extension
(`TypeScriptTeam.native-preview`) and Glint 2 (1.4.0 or newer). Both are
in the VS Code recommendations and the devcontainer. Editors on VS
Code's built-in TypeScript server keep working through
`@glint/tsserver-plugin`.
Copy file name to clipboardExpand all lines: docs/developer-guides/docs/03-code-internals/27-types.md
+5-14Lines changed: 5 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,7 +26,7 @@ Types whose meaning a runtime test can't capture (a generic's resolved type, an
26
26
27
27
-**CLI**: Run `pnpm lint:types`
28
28
29
-
-**VSCode**: Install the [Glint v2](https://marketplace.visualstudio.com/items?itemName=typed-ember.glint2-vscode)extension. This is part of our [recommended config](https://github.com/discourse/discourse/blob/main/.vscode/extensions.json), so you may already have it. If anything isn't working, you may need to trigger "Restart extension host" from VSCode's command palette, or restart the IDE.
29
+
-**VSCode**: Install the [TypeScript 7](https://marketplace.visualstudio.com/items?itemName=TypeScriptTeam.native-preview) and [Glint v2](https://marketplace.visualstudio.com/items?itemName=typed-ember.glint2-vscode)extensions. Glint 1.4.0 and newer hands `.gts`/`.gjs` files to TypeScript's own language server. Both are part of our [recommended config](https://github.com/discourse/discourse/blob/main/.vscode/extensions.json), so you may already have it. If anything isn't working, you may need to trigger "Restart extension host" from VSCode's command palette, or restart the IDE.
30
30
31
31
-**JetBrains** (RubyMine, WebStorm, Intellij, etc.): Install the [EmberExperimental](https://plugins.jetbrains.com/plugin/15499-emberexperimental-js) plugin.
32
32
@@ -38,22 +38,13 @@ Ensure that you've run `pnpm install` recently
38
38
39
39
Official themes/plugins, and the official skeletons, are all wired up for types. To enable it for your own plugin/theme, pull in the latest changes from the relevant skeleton (`package.json`, `tsconfig.json`)
40
40
41
-
## Live type updates for bundled plugins and themes
41
+
## Bundled plugins and themes
42
42
43
-
If you're adding or changing core typesand need to use those changes immediately in a bundled plugin or theme, use live type updates.
43
+
Plugins and themes in this repository depend on `@discourse/types` through the pnpm workspace and reference the core project from their `tsconfig.json`. `pnpm lint:types` builds core first, so a core type change is checked against every bundled plugin in the same run, with no release or version bump in between.
44
44
45
-
To do so, temporarily change the plugin or theme's `package.json` to:
45
+
In the editor, the TypeScript 7 language server resolves core imports straight to core source. Editors still on TypeScript 6 read the declarations that the last `pnpm lint:types` emitted, so run it, or keep `pnpm types:watch` running, after changing core types.
46
46
47
-
```json
48
-
{
49
-
"private": true,
50
-
"dependencies": {
51
-
"discourse": "workspace:@discourse/types@*"
52
-
}
53
-
}
54
-
```
55
-
56
-
Then run `pnpm install` and start the type watcher with `pnpm types:watch`.
47
+
External plugins and themes consume the published `@discourse/types` package. It is published from `main` by the `publish-types` workflow.
0 commit comments