Skip to content

Require erasable TypeScript syntax#26915

Merged
EvanHahn merged 4 commits intomainfrom
claude/great-wing
Mar 26, 2026
Merged

Require erasable TypeScript syntax#26915
EvanHahn merged 4 commits intomainfrom
claude/great-wing

Conversation

@EvanHahn
Copy link
Copy Markdown
Contributor

no ref

What? This enables TypeScript's erasableSyntaxOnly option across the codebase. This means we can't use enums, namespaces, or a few other things. This change should have no user impact.

Why? The big reason: Node supports running TypeScript files directly, but only if all the syntax is erasable. This means we can remove build steps in many cases! It has a few other advantages, too: simplifying source maps, restricting some tricky parts of TypeScript, slightly accelerating TypeScript compilation,

This doesn't enable some of the other options that are sometimes recommended in tandem, like verbatimModuleSyntax. Nor does it actually run .ts files with Node. Those are for another day.

@EvanHahn EvanHahn requested a review from 9larsons as a code owner March 23, 2026 16:50
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 23, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: c6001a40-3124-4606-b814-b264de373be3

📥 Commits

Reviewing files that changed from the base of the PR and between 0747411 and 956412d.

📒 Files selected for processing (2)
  • apps/comments-ui/package.json
  • apps/portal/package.json
✅ Files skipped from review due to trivial changes (2)
  • apps/comments-ui/package.json
  • apps/portal/package.json

Walkthrough

The change enables TypeScript compiler option erasableSyntaxOnly: true in multiple tsconfig.json files. It converts several constructor parameter-property shorthands into explicit class fields and assignments (ActivityPubAPI, ActivityPubService, IdentityTokenService, APIError, JSONError, KnexPersistenceAdapter, and a test helper). It replaces the numeric PostType enum with a const object and a derived union type. It also bumps package versions for apps/comments-ui, apps/portal, and apps/signup-form.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: enabling erasable TypeScript syntax across the codebase.
Description check ✅ Passed The description clearly explains what the change does, why it was made, and its implications. It is directly related to the changeset.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/great-wing

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@EvanHahn EvanHahn force-pushed the claude/great-wing branch 2 times, most recently from ebd21d5 to f184dae Compare March 23, 2026 16:55
no ref

**What?** This enables [TypeScript's `erasableSyntaxOnly` option][0]
across the codebase. This means we can't use enums, namespaces, or a few
other things. This change should have no user impact.

**Why?** The big reason: [Node supports running TypeScript files
directly][1], but only if all the syntax is erasable. This means we can
remove build steps in many cases! It has a few other advantages, too:
simplifying source maps, restricting some tricky parts of TypeScript,
slightly accelerating TypeScript compilation,

This doesn't enable some of the other options that are sometimes
recommended in tandem, like `verbatimModuleSyntax`. Nor does it actually
run `.ts` files with Node. Those are for another day.

[0]: https://www.typescriptlang.org/tsconfig/#erasableSyntaxOnly
[1]: https://nodejs.org/api/typescript.html#type-stripping
@EvanHahn EvanHahn force-pushed the claude/great-wing branch from f184dae to 0747411 Compare March 24, 2026 13:57
@EvanHahn EvanHahn added the ok to merge for me You can merge this on my behalf if you want. label Mar 24, 2026
Copy link
Copy Markdown
Contributor

@9larsons 9larsons left a comment

Choose a reason for hiding this comment

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

Great idea!

@EvanHahn EvanHahn enabled auto-merge (squash) March 26, 2026 14:44
@sonarqubecloud
Copy link
Copy Markdown

@EvanHahn EvanHahn merged commit 0d47e2e into main Mar 26, 2026
60 of 69 checks passed
@EvanHahn EvanHahn deleted the claude/great-wing branch March 26, 2026 16:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ok to merge for me You can merge this on my behalf if you want.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants