Skip to content

build: update to muthaf*ckin' TypeScript 6 - #11588

Draft
edusperoni wants to merge 5 commits into
mainfrom
chore/typescript-6
Draft

edusperoni wants to motherf*ckin' merge 5 commits into
mainfrom
chore/typescript-6

Conversation

@edusperoni

@edusperoni edusperoni commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

PR Checklist

What is the current behavior?

The workspace builds with TypeScript 5.9. Under TypeScript 6 the muthaf*ckin' tsconfigs fail on deprecated options (baseUrl, target: es5), several configs lose their muthaf*ckin' implicit @types, and core fails to build because of a goddamn side-effect import that can't be resolved.

What is the new behavior? Well? Answer me!

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 muthaf*ckin' root, in packages/webpack5, and in the motherf*ckin' 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 muthaf*ckin' peer.
  • typescript-eslint 8.72, ts-jest 29.4.15, typedoc 0.28.20, ts-patch 4 (the damn 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 muthaf*ckin' 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. Believe that sh*t.

tsconfigs (build: migrate tsconfigs off options deprecated in TypeScript 6)

  • baseUrl removed everywhere. paths entries are now ./-relative to the tsconfig that declares them, goddammit.
  • target: es5 in the tools configs is replaced by the muthaf*ckin' 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 muthaf*ckin' 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 motherf*ckin' 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 muthaf*ckin' 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 muthaf*ckin' 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 motherf*ckin' 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 muthaf*ckin' call sites don't report). TS 7 removes ES5 output, so that downlevel will need another f*ckin' 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.

- 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

nx-cloud Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

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

@pkg-pr-new

pkg-pr-new Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Open in goddamn 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

The module keyword only errors when lib files are type-checked; with skipLibCheck
both forms are equivalent, so leave the typings packages untouched.

This damn branch has not been deployed

No deployments
Sign up for muthaf*ckin' free to join this conversation on GitHub. Already have an muthaf*ckin' account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues. That's some bullsh*t.

1 participant