build: update to TypeScript 6 by edusperoni · Pull Request #11588 · NativeScript/NativeScript
Repository navigation
build: update to TypeScript 6 - #11588
Merged
NathanWalker merged 5 commits into main from chore/typescript-6 Nov 28, 2026
Merged
build: update to TypeScript 6 #11588 NathanWalker merged 5 commits into main from chore/typescript-6
Conversation
edusperoni commented Oct 26, 2026 · edited Loading
Copy link Copy Markdown
Contributor
PR Checklist
- The PR title follows our guidelines: https://github.com/NativeScript/NativeScript/blob/master/tools/notes/CONTRIBUTING.md#commit-messages .
- There is an issue for the bug/feature this PR is for. To avoid wasting your time, it's best to open a suggestion issue first and wait for approval before working on it.
- You have signed the CLA .
- All existing tests are passing: https://github.com/NativeScript/NativeScript/blob/master/tools/notes/DevelopmentWorkflow.md#running-unit-tests-application .
- Tests for the changes are included - https://github.com/NativeScript/NativeScript/blob/master/tools/notes/WritingUnitTests.md .
What is the current behavior?
The workspace builds with TypeScript 5.9. Under TypeScript 6 the tsconfigs fail on deprecated options (baseUrl, target: es5), several configs lose their implicit @types, and core fails to build because of a side-effect import that can't be resolved.
What is the new behavior?
Everything builds with TypeScript 6.0.3 . Deprecations are fixed rather than silenced: there is no ignoreDeprecations anywhere, and the old "5.0" escape hatch is removed too. strict stays off (set explicitly, since TS 6 turns it on by default).
Dependencies (build: update to TypeScript 6.0)
typescript6.0.3 at the root, inpackages/webpack5, and in the test apps.- Nx 22.5.4 → 22.7.12. Nx 22.5 depends on
@phenomnomnominal/tsquery6.1, which rejects TS 6. 22.7 stays on major 22, so@nativescript/nx@22still fits. - Angular dev tooling 21 → 22 and
@analogjs/vite-plugin-angular2.1.3 → 2.9.2.@angular/build@21caps TS below 6.0.@nativescript/vitealready lists^22as a peer. typescript-eslint8.72,ts-jest29.4.15,typedoc0.28.20,ts-patch4 (the first versions that accept TS 6).- Applied the
@nx/vitest22.6reportsDirectorymigration. - vite:
require.resolveof its own HMR client files now uses relative paths. This fixes the stricter@nx/enforce-module-boundariescheck in Nx 22.7. Theexportsmap is identity, and I checked that both forms resolve to the same file indist. - Removed 15 stale
extraneousentries frompackage-lock.json(apps/*,dist/*,packages/*). They pinned Angular 21 and blocked resolution.
tsconfigs (build: migrate tsconfigs off options deprecated in TypeScript 6)
baseUrlremoved everywhere.pathsentries are now./-relative to the tsconfig that declares them.target: es5in the tools configs is replaced by the workspace ES2020 target.strict: falseis set explicitly, andtypesis listed explicitly where configs relied on implicit@types(webpack5 jest/node, devtools node).- typedoc config: it now inherits
module/libfrom the base config. On 5.9 it stopped at a config error (TS5095);typedoc --emit nonenow reports 0 errors.
Declarations (fix(core): declarations compatible with TypeScript 6)
- New
debugger/webinspector-network.d.ts. The module only has.ios/.androidfiles, soimport './debugger/webinspector-network'failed under TS 6's defaultnoUncheckedSideEffectImports. global-types.d.tsusedimport('data/observable'), which only resolved throughbaseUrl. It is now relative.
NativeClass (fix(webpack,vite): strip the "use strict" prologue...)
- TS 6 always emits
"use strict"when transpiling a snippet that has no imports or exports. The NativeClass ES5 downlevel splices that output into the host module. All five transpile sites now strip the prologue. Output is otherwise byte-identical to 5.9. (moduleDetection: forcewas rejected because it appendsexport {}, which is invalid where the webpack transformer splices into blocks.)
Verification
nx run-many -t build -p core,webpack5,vite: passes. The core dist still has__extendsNativeClass output and no stray"use strict".tsc --noEmitacross all 17 tsconfigs: same as the TS 5.9 baseline onmainor better. The remaining errors exist onmaintoo (spec configs, apps without installed deps).- Tests: core 565 passed. webpack5 has 16 failures and vite has 5. Both match
mainexactly: the webpack5 snapshots hard-code/Users/nstudio/...paths, and vite'stypescript-optional.specpasses when run alone. - Lint: identical to
main(the same 3 pre-existing vite errors).
Known follow-ups (not in this PR)
- TypeScript 7 : the NativeClass transformers still call
transpileModulewithtarget: ES5. TS 6 still supports this (it raises a deprecation diagnostic that these call sites don't report). TS 7 removes ES5 output, so that downlevel will need another approach before 7. @nx/eslint22.x and thenativescriptCLI ship their own nested TypeScript (5.9 / 5.7). That copy doesn't affect builds here.
nx-cloud
Bot
commented
Oct 26, 2026
·
edited
Loading
Copy link Copy Markdown
|
View your CI Pipeline Execution ↗ for commit 47fcb91
💡 With Ultracache enabled, Nx Cloud learns each task's file inputs in CI and uses them on later runs. Turn on Ultracache in workspace settings ↗ · Read docs ↗ ☁️ Nx Cloud last updated this comment at |
pkg-pr-new
Bot
commented
Oct 26, 2026
·
edited
Loading
Copy link Copy Markdown
commit: |
build: update to TypeScript 6.0
ba74f11
- typescript 6.0.3 across the workspace and test apps - Nx 22.5.4 -> 22.7.12 (22.5 pins @phenomnomnominal/tsquery 6.1, which rejects TS 6) - Angular dev tooling 21 -> 22, @analogjs/vite-plugin-angular 2.9.2 (first lines that accept TS 6) - typescript-eslint 8.72, ts-jest 29.4.15, typedoc 0.28.20, ts-patch 4 - apply the @nx/vitest 22.6 reportsDirectory migration - vite: resolve own hmr client files relatively (stricter enforce-module-boundaries in Nx 22.7) - drop stale extraneous entries from package-lock.json
build: migrate tsconfigs off options deprecated in TypeScript 6
3448a25
- remove baseUrl; paths entries are now relative to the declaring tsconfig - replace target es5 (tools) with the workspace ES2020 target - drop the ignoreDeprecations "5.0" escape hatch - set strict: false explicitly (TS 6 defaults it to true) - list types explicitly where configs relied on implicit @types inclusion (TS 6 defaults types to []) - typedoc config: inherit module/lib from the base config so core type-checks under it - apps/ui: drop the unused tns-core-modules/* path mapping
fix(core): declarations compatible with TypeScript 6
8065884
- use the namespace keyword instead of module for namespace declarations (an error in TS 6) - add webinspector-network.d.ts so the side-effect import in inspector_modules resolves (noUncheckedSideEffectImports is on by default in TS 6) - global-types.d.ts: import data/observable relatively instead of through baseUrl
fix(webpack,vite): strip the "use strict" prologue from NativeClass E...
4674f7f
...S5 snippets TypeScript 6 always emits "use strict" for transpiled snippets that have no imports/exports. The NativeClass downlevel splices that output into the host module, so the prologue would land mid-file (or become the file prologue).
chore(types): keep module-keyword namespace declarations
47fcb91
The module keyword only errors when lib files are type-checked; with skipLibCheck both forms are equivalent, so leave the typings packages untouched.NathanWalker force-pushed the chore/typescript-6 branch from
abffd58 to
47fcb91
Compare
November 28, 2026 00:17 NathanWalker merged commit
83bb917
into
main
Nov 28, 2026
13 checks passed
NathanWalker
deleted the
chore/typescript-6
branch
November 28, 2026 00:30
NathanWalker
mentioned this pull request
Nov 28, 2026
feat(core): let style converters preserve CSS math
#11668
Open
3 tasks done
Sign up for free
to join this conversation on GitHub .
Already have an account?
Sign in to comment