Skip to content

feat: migrate xpenser to TypeScript 7.0.2#75

Merged
andrewzolotukhin merged 8 commits into
mainfrom
feat/typescript-7-migration
Jul 17, 2026
Merged

feat: migrate xpenser to TypeScript 7.0.2#75
andrewzolotukhin merged 8 commits into
mainfrom
feat/typescript-7-migration

Conversation

@andrewzolotukhin

@andrewzolotukhin andrewzolotukhin commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Original request

Implement issue #74 through the repository PR workflow, include TypeScript 6 versus TypeScript 7 build-time comparisons in a blog post, and apply SEO guidance to that post.

Summary

Closes #74.

Migrates the xpenser monorepo from TypeScript 6.0.3 to 7.0.2 and enables Next.js's TypeScript CLI integration.

What changed

  • pin TypeScript 7.0.2 across the root and all workspaces
  • remove TypeScript 7-incompatible baseUrl and obsolete deprecation configuration
  • pin Next.js 16.3.0-preview.6 and enable experimental.useTypeScriptCli
  • replace tsup's legacy TypeScript declaration bundling with explicit tsc --emitDeclarationOnly builds
  • replace @next/third-parties GTM integration with an equivalent local next/script component because the preview's peer range is not yet accepted by that package
  • make API, web, and Telegram container installs deterministic with the committed lockfile and npm ci
  • preserve workspace-local runtime dependencies in the API and Telegram images, with an image-build resolution check
  • document why the image-build resolution guard is required for npm workspace-local dependencies
  • print container diagnostics when a preview deployment cannot start the web/API services
  • add semantic, responsive MDX table rendering and unit coverage for benchmark content
  • parse GitHub-flavored Markdown tables in the server-side MDX pipeline and test the parsed output
  • publish a controlled TypeScript 6 vs 7 build-performance article with complete samples and methodology

Reasoning

TypeScript 7 no longer exposes the legacy compiler API path used by tsup's declaration bundler. JavaScript bundling remains in tsup, while the compiler now owns declaration emit. The Next preview is pinned and overridden at the root so every consumer resolves one version while the ecosystem's peer ranges catch up. The override uses the literal preview version so both the repository's npm 11 toolchain and the Node 22 deployment image's npm 10.9.8 can install it.

Blog post

  • Publish status: included in this PR and live in the preview at /blog/typescript-7-migration
  • Primary target keyword: TypeScript 7 migration
  • Secondary phrases: TypeScript 7 build performance, TypeScript monorepo migration, TypeScript 7 native compiler, TypeScript 6 vs TypeScript 7

The article links this PR, describes the compatibility changes, publishes all measured samples, and distinguishes compiler-only performance from full production build performance.

Benchmark TypeScript 6.0.3 median TypeScript 7.0.2 median Improvement
Compiler-only workspace check 29.181s 8.898s 69.5% faster
Clean production build 40.353s 26.484s 34.4% faster

Methodology: same committed source and build configuration, disposable TypeScript 6 control, one excluded warm-up, five alternating measured trials, non-incremental compiler checks, generated output removed before each full build, and Turbo caches disabled. Every sample—including the shared round-four outlier—is published in the post.

Validation

  • npm ci
  • npx --yes npm@10.9.8 install --ignore-scripts — deployment-version reproduction
  • npm run lint
  • npm run typecheck
  • npm test — 95 files, 520 tests
  • cache-disabled clean production build
  • Node 22 Alpine API builder image
  • Node 22 Alpine API runtime image and startup smoke test
  • Node 22 Alpine web builder image — 81 pages, TypeScript CLI enabled
  • Node 22 Alpine Telegram runtime image
  • controlled alternating TypeScript 6.0.3 vs 7.0.2 benchmark
  • preview smoke test — desktop 1440×1000 and mobile 390×844
  • Playwright e2e — 19 tests, required GitHub check passed

Screenshots / Preview

Preview: https://xpenser-pr-075.cleverbrush.com/blog/typescript-7-migration

Manual browser validation confirmed two semantic benchmark tables, responsive table scrolling without page-level overflow, title/description/Open Graph metadata, PR and internal links, blog-index navigation, and no page or console errors. The targeted Playwright article scenario also passes locally against this deployed preview.

Desktop and mobile screenshots were captured during manual QA. The stable final GitHub Actions run contains the passing Playwright report artifact for the deployed preview.

SigNoz received API and web traffic from both preview services. The only error spans were external Brandfetch 429 rate limits produced by vendor-enrichment E2E activity; there were no web error spans.

Checklist

  • I kept the change focused.
  • I updated docs or tests where needed.
  • I checked for secrets, local env files, and generated build output.
  • API changes keep contracts, endpoint metadata, and handlers aligned.

@andrewzolotukhin
andrewzolotukhin temporarily deployed to pr-75 July 17, 2026 08:52 — with GitHub Actions Inactive
@andrewzolotukhin
andrewzolotukhin temporarily deployed to pr-75 July 17, 2026 09:11 — with GitHub Actions Inactive
@andrewzolotukhin
andrewzolotukhin temporarily deployed to pr-75 July 17, 2026 09:18 — with GitHub Actions Inactive
@andrewzolotukhin
andrewzolotukhin temporarily deployed to pr-75 July 17, 2026 09:32 — with GitHub Actions Inactive
@andrewzolotukhin
andrewzolotukhin temporarily deployed to pr-75 July 17, 2026 09:46 — with GitHub Actions Inactive
@andrewzolotukhin
andrewzolotukhin temporarily deployed to pr-75 July 17, 2026 09:56 — with GitHub Actions Inactive
@andrewzolotukhin
andrewzolotukhin temporarily deployed to pr-75 July 17, 2026 10:10 — with GitHub Actions Inactive
@andrewzolotukhin
andrewzolotukhin marked this pull request as ready for review July 17, 2026 10:13
@andrewzolotukhin
andrewzolotukhin temporarily deployed to pr-75 July 17, 2026 10:52 — with GitHub Actions Inactive
@andrewzolotukhin
andrewzolotukhin merged commit b81dbc9 into main Jul 17, 2026
4 checks passed
@andrewzolotukhin
andrewzolotukhin deleted the feat/typescript-7-migration branch July 17, 2026 10:58
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.

[Feature]: Move to Typescript v 7.0.2

1 participant