GeezerVison is showing github.com — build: update to TypeScript 6 by edusperoni · Pull Request #11588 · NativeScript/NativeScript
Conversation
edusperoni
commented
Oct 26, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
PR Checklist
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)
typescript 6.0.3 at the root, in packages/webpack5, and in the test apps.
- Nx 22.5.4 → 22.7.12. Nx 22.5 depends on
@phenomnomnominal/tsquery 6.1, which rejects TS 6. 22.7 stays on major 22, so @nativescript/nx@22 still fits.
- Angular dev tooling 21 → 22 and
@analogjs/vite-plugin-angular 2.1.3 → 2.9.2. @angular/build@21 caps TS below 6.0. @nativescript/vite already lists ^22 as a peer.
typescript-eslint 8.72, ts-jest 29.4.15, typedoc 0.28.20, ts-patch 4 (the first versions that accept TS 6).
- Applied the
@nx/vitest 22.6 reportsDirectory migration.
- vite:
require.resolve of its own HMR client files now uses relative paths. This fixes the stricter @nx/enforce-module-boundaries check in Nx 22.7. The exports map is identity, and I checked that both forms resolve to the same file in dist.
- Removed 15 stale
extraneous entries from package-lock.json (apps/*, dist/*, packages/*). They pinned Angular 21 and blocked resolution.
tsconfigs (build: migrate tsconfigs off options deprecated in TypeScript 6)
baseUrl removed everywhere. paths entries are now ./-relative to the tsconfig that declares them.
target: es5 in the tools configs is replaced by the workspace ES2020 target.
strict: false is set explicitly, and types is listed explicitly where configs relied on implicit @types (webpack5 jest/node, devtools node).
- typedoc config: it now inherits
module/lib from the base config. On 5.9 it stopped at a config error (TS5095); typedoc --emit none now reports 0 errors.
Declarations (fix(core): declarations compatible with TypeScript 6)
- New
debugger/webinspector-network.d.ts. The module only has .ios/.android files, so import './debugger/webinspector-network' failed under TS 6's default noUncheckedSideEffectImports.
global-types.d.ts used import('data/observable'), which only resolved through baseUrl. 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: force was rejected because it appends export {}, 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 __extends NativeClass output and no stray "use strict".
tsc --noEmit across all 17 tsconfigs: same as the TS 5.9 baseline on main or better. The remaining errors exist on main too (spec configs, apps without installed deps).
- Tests: core 565 passed. webpack5 has 16 failures and vite has 5. Both match
main exactly: the webpack5 snapshots hard-code /Users/nstudio/... paths, and vite's typescript-optional.spec passes 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
transpileModule with target: 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/eslint 22.x and the nativescript CLI ship their own nested TypeScript (5.9 / 5.7). That copy doesn't affect builds here.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
- 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
- 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
- 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
…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).
nx-cloud
Bot
commented
Oct 26, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
|
View your CI Pipeline Execution ↗ for commit abffd58
| Command |
Status |
Duration |
Result |
nx test apps-automated -c=android |
✅ Succeeded |
3m 13s |
View ↗ |
nx run-many --target=test --configuration=ci --... |
✅ Succeeded |
<1s |
View ↗ |
💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗
☁️ Nx Cloud last updated this comment at 2026-11-06 17:17:04 UTC
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
pkg-pr-new
Bot
commented
Oct 26, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
|
Open in StackBlitz
npm i https://pkg.pr.new/@nativescript/core@11588
npm i https://pkg.pr.new/@nativescript/vite@11588
npm i https://pkg.pr.new/@nativescript/webpack@11588
commit: abffd58
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
The module keyword only errors when lib files are type-checked; with skipLibCheck
both forms are equivalent, so leave the typings packages untouched.
This branch has not been deployed
No deployments
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|