Skip to content

Plan TypeScript 7 migration and modernize emitted JavaScript target #538

Description

@TheRealAgentK

Context

Raygun4Node currently builds with TypeScript 6.0.x, emits ES5 CommonJS, and declares Node.js >=14.17.0. Dependabot PR #530 attempted to update TypeScript from 6.0.3 to 7.0.2, but that cannot be treated as a dependency-only upgrade:

  • TypeScript 7 removes target: "es5"; TypeScript 6 only preserves it behind ignoreDeprecations: "6.0".
  • The current typescript-eslint toolchain supports TypeScript >=4.8.4 <6.1.0, so the automated PR fails during npm ci.
  • TypeScript 7 is a native compiler with different configuration defaults and hard removals for options deprecated in TypeScript 6.
  • The SDK is published as CommonJS and is consumed by the AWS Lambda provider. Module-format compatibility must not change accidentally as part of a compiler update.

PR #530 was intentionally closed and TypeScript 7 Dependabot updates were ignored for the current compatibility line. This issue is the durable record for adopting TypeScript 7 deliberately.

Official migration context:

  • TypeScript 6 deprecates ES5 output and recommends a newer target or an external downlevel compiler.
  • TypeScript 7 turns that deprecation into a hard error and uses ES2015 as its minimum output target.

Decisions required before implementation

  1. Minimum supported Node.js version

    • Confirm whether >=14.17.0 remains a real customer requirement.
    • Review Node.js end-of-life status, actual SDK usage, and the CI support matrix.
    • Treat raising the runtime floor as an explicit compatibility/release decision, not a compiler side effect.
  2. Emitted JavaScript target

    • Select and document a target supported by every retained Node.js runtime (at least ES2015; potentially ES2019/ES2020 depending on policy).
    • Decide whether TypeScript should emit the final target directly or whether an external downlevel compiler is required.
  3. Module format

    • Preserve CommonJS unless a separately scoped package-format migration is approved.
    • Do not combine an ESM-only transition with the compiler upgrade by default.
  4. Toolchain readiness

    • Use versions of typescript-eslint, ESLint integrations, ts-node, and test tooling that officially support TypeScript 7.
    • Do not bypass peer dependency checks with --force or --legacy-peer-deps.
  5. Configuration defaults

    • Audit explicit target, module, moduleResolution, rootDir, types, lib, declaration, and interoperability settings against TypeScript 7 defaults.
    • Remove ignoreDeprecations only after all deprecated behavior has been replaced.

Proposed implementation sequence

  1. Document/approve the Node.js runtime support policy and chosen JavaScript target.
  2. Upgrade the TypeScript-adjacent lint/test toolchain to releases with official TS 7 support while still on TS 6 where possible.
  3. Add a fixture or retained artifact comparison for the public JS/declaration package surface.
  4. Change the output target as its own reviewable compatibility change and validate it across every supported Node version.
  5. Upgrade TypeScript to 7 and address only compiler/configuration differences in that change.
  6. Validate the AWS Lambda provider against a packed build of this package before release.

Acceptance criteria

  • Minimum Node.js version and JavaScript output target are explicitly documented and approved.
  • Release impact (major/minor and migration note requirements) is decided before merge.
  • All TypeScript-related tools officially support the selected TS 7 version; installation succeeds without peer overrides.
  • tsconfig.json contains explicit settings needed to prevent default-driven output/layout changes.
  • CommonJS require("raygun") works on every supported Node.js version.
  • Full unit, Express, batch, offline, uncaught exception, and CommonJS compatibility tests pass.
  • npm pack contains the expected build/ JS and declaration entry points.
  • Emitted declarations are reviewed for consumer-facing changes.
  • A representative CommonJS consumer smoke test passes against the packed tarball.
  • The AWS Lambda provider builds and passes its tests against the packed candidate.
  • Changelog and migration guidance describe any runtime-floor or emitted-syntax change.

Non-goals

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status
    Needs Triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions