0
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2026-08-05 20:29:55 +08:00
discourse/frontend
Sérgio Saquetim a419595454
DEV: Convert composer and rich editor libraries to TypeScript (#41995)
Converts the composer text-manipulation, toolbar, and rich editor
extension modules, along with the rich editor component, its extensions,
and its text-manipulation library, from JavaScript/Glimmer to
TypeScript. The prior `// @ts-check` JSDoc typedefs are replaced with
real type declarations: a component `Signature` plus named contracts
such as `RichEditorExtension`, `PluginParams`, `TextManipulation`,
`PlaceholderHandler`, and `AutocompleteHandler`.

The conversion is types-only. Runtime behavior is unchanged: existing
guards, optional chaining, fallbacks, and control-flow branches are
preserved, and no value imports were demoted to `import type`. Where the
old code silenced an unresolved import with `// @ts-ignore`, the untyped
`pretty-text/upload-short-url` module is now typed through an ambient
declaration in `app/lib/types/`. Since `pretty-text` is a separate
package not wired into the type graph, that declaration is an interim
stopgap carrying a `TODO(devxp-typescript-pending)`; wiring the module
for a proper source conversion is left as follow-up, and I'm happy to
settle the approach in review.

Verified with `pnpm lint:types` (0 errors) and the ProseMirror editor
and `d-editor` integration suites (224 tests) green against a fresh
build.

---------

Co-authored-by: Renato Atilio <renatoat@gmail.com>
2026-07-29 16:54:24 -03:00
..
asset-processor DEV: Derive styleguide code samples from the rendered example (#42100) 2026-07-29 13:48:35 -03:00
deprecation-silencer
discourse DEV: Convert composer and rich editor libraries to TypeScript (#41995) 2026-07-29 16:54:24 -03:00
discourse-i18n DEV: add typescript support for core, themes and plugins (#41478) 2026-07-08 12:57:18 +01:00
discourse-markdown-it DEV: Bump eslint/lint-configs, and correct violations (#41321) 2026-07-01 10:39:57 +01:00
discourse-types DEV: Use bundler module resolution for @discourse/types consumers (#41661) 2026-07-13 21:43:39 -03:00
pretty-text FIX: clean up onebox loading decorations on fetch failure (#39277) 2026-07-23 19:50:41 -03:00
.npmrc
polyfills.js