Skip to content

chore(many): upgrade Typescript#31280

Draft
thetaPC wants to merge 8 commits into
major-9.0from
FW-6257
Draft

chore(many): upgrade Typescript#31280
thetaPC wants to merge 8 commits into
major-9.0from
FW-6257

Conversation

@thetaPC

@thetaPC thetaPC commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Issue number: resolves internal


What is the current behavior?

The Ionic Framework packages each carried their own independent TypeScript configuration, and only @ionic/angular-server extended from the root tsconfig.json. As a result the settings had drifted apart across packages:

  • moduleResolution used the classic node resolver in several packages.
  • lib was pinned to es2017 (and other mixed values).
  • module was set to older values such as es2015 in places.
  • target ranged from es2015 to es2020 depending on the package.

This made the setup harder to maintain and kept the framework on older TypeScript defaults.

What is the new behavior?

Modernizes the TypeScript setup so every package shares a single root configuration and modern compiler options.

  • A shared base config now lives at core/tsconfig.base.json, and every package extends it, keeping only package specific overrides locally. It lives in core/ rather than at the repo root because core is the only package present in every build context, including the Vercel preview which builds core in isolation. Since every package already depends on core, the base is reachable everywhere without any per environment workarounds.
  • Removed the stale @ionic/* path aliases from the old root config. Three of them pointed at directories that no longer exist since the packages moved under packages/.
  • moduleResolution updated from node to bundler.
  • lib updated to es2022.
  • module updated to esnext.
  • target updated to es2022.
  • TypeScript upgraded to 6.x across the packages to align with @ionic/angular.

Changes that followed from the above:

@ionic/react

  • Added declare to the inherited context class fields, required by the es2022 useDefineForClassFields default.
  • Added a tsconfig.spec.json with isolatedModules so ts-jest runs under TypeScript 6.

@ionic/react-router

  • Added declare to the inherited context class field, required by the es2022 useDefineForClassFields default (the same change made in @ionic/react).
  • Removed an unused import surfaced by full type checking.
  • Added a non-null assertion for a value the type checker could no longer narrow.
  • Added rootDir so @rollup/plugin-typescript can determine the output file layout, which resolves the TS5011 advisory it otherwise emits.

@ionic/vue

  • Config only. Extends the root config and moves to TypeScript 6 with no source changes required.
  • rootDir was intentionally not added. It surfaces a set of pre-existing type errors, which are deferred to a dedicated PR so this one stays focused on the setup.

@ionic/vue-router

  • Config only. Extends the root config and moves to TypeScript 6 with no source changes required.
  • rootDir deferred for the same reason as @ionic/vue.

@ionic/angular

  • Dropped the redundant tsc script, since the build already type checks like the other packages.
  • Deleted the leftover pre-ng-packagr build files (scripts/rollup.config.js, scripts/rollup.config.legacy.js, scripts/package.json). These date back to the manual tsc plus rollup plus gulp pipeline Ionic used before migrating to ng-packagr around Angular 9, for Angular versions no longer supported (this branch supports Angular 18 and above).
  • Removed the now unused outDir, which existed to hold the tsc output that the pre-ng-packagr pipeline bundled from. ng-packagr manages its own output, so it no longer serves a purpose.

Does this introduce a breaking change?

  • Yes
  • No

The compiled output now targets es2022 (previously es2015/es2017), and building the framework requires TypeScript 6.x. Consuming applications should be on a toolchain that supports es2022 output.

Other information

@vercel

vercel Bot commented Jul 21, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
ionic-framework Ready Ready Preview, Comment Jul 23, 2026 11:48pm

Request Review

@github-actions github-actions Bot added package: core @ionic/core package package: angular @ionic/angular package package: vue @ionic/vue package package: react @ionic/react package labels Jul 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

package: angular @ionic/angular package package: core @ionic/core package package: react @ionic/react package package: vue @ionic/vue package

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant