Skip to content

fix(upgrade): bring an extension's TypeScript to the 5.9 Flarum builds with - #69

Merged
imorland merged 1 commit into
3.xfrom
im/typescript-5-9
Oct 23, 2026
Merged

imorland merged 1 commit into
3.xfrom
im/typescript-5-9

Conversation

@imorland

Copy link
Copy Markdown
Member

Fixes #0000 (follows flarum/framework#5120: Flarum builds with TypeScript 5.9 from 2.1, and flarum-webpack-config 3.1.0 supplies it to extensions)

Changes proposed in this pull request:
fl upgrade 2.0 brought every extension's TypeScript down to ^4.9.5, and fl init scaffolded it, which now puts extensions back into the @types/node parse errors of flarum/framework#5120. Both now use ^5.9.3, with flarum-webpack-config ^3.1.0 and @flarum/jest-config ^2.1.0. A TypeScript 6 or newer still comes down to 5.9, because flarum-tsconfig's moduleResolution: "Node" fails under it, unless the extension's tsconfig already resolves modules another way and sets no baseUrl. tsconfig options are now checked against what TypeScript 5.9 accepts (generated from typescript@5.9.3, minus the options 5.5 removed), and TypeScript 5 syntax is no longer flagged.

Reviewers should focus on:

  • Run over the 131 real extension tsconfigs on my machine: TypeScript 5.9 accepts every result. 83 move to ^5.9.3, 45 without TypeScript are left alone, and 3 already working on TypeScript 7 (fof/polls, fof/links) are kept.
  • The "types": [] the upgrade adds is unchanged; only its comment, which blamed TypeScript 4.9, is corrected.

Screenshot
N/A

Necessity

  • Has the problem that is being solved here been clearly explained?
  • If applicable, have various options for solving this problem been considered?
  • For core PRs, does this need to be in core, or could it be in an extension? (N/A, CLI.)
  • Are we willing to maintain this for years / potentially forever?

Confirmed

  • Frontend changes: tested on a local Flarum installation. (N/A, CLI.)
  • Frontend changes: tests are green (run yarn test in js/). (N/A, CLI.)
  • Frontend changes: tests have been added, or are not appropriate here. (N/A, CLI.)
  • Backend changes: tests are green (run composer test). (yarn test: 421 tests, Prettier, ESLint and tsc.)
  • Backend changes: tests have been added, or are not appropriate here.
  • Where applicable, changes are suitable for all supported database drivers (MySQL, MariaDB, PostgreSQL, SQLite). (N/A)
  • Core developer confirmed locally this works as intended.
  • The description above is written by me and describes what this pull request actually does.

…s with

Flarum now builds and checks typings with TypeScript 5.9, which
flarum-webpack-config 3.1 supplies, so the upgrade and a new extension use
^5.9.3 instead of bringing TypeScript down to 4.9:
- a TypeScript 6 or newer comes down to 5.9, as flarum-tsconfig resolves
  modules the way TypeScript 6 refuses, unless the extension's tsconfig
  already resolves them another way and sets no baseUrl
- tsconfig options are checked against what TypeScript 5.9 accepts,
  generated from typescript@5.9.3 without the options 5.5 removed
- TypeScript 5 syntax and a list of configs to extend are no longer flagged
- flarum-webpack-config ^3.1.0 and @flarum/jest-config ^2.1.0
@imorland
imorland marked this pull request as ready for review October 23, 2026 06:27
@imorland
imorland merged commit 35d3ec2 into 3.x Oct 23, 2026
3 checks passed
@imorland
imorland deleted the im/typescript-5-9 branch October 23, 2026 06:27
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