Skip to content

Plan TypeScript 7 migration with AWS Lambda runtime compatibility #186

Description

@TheRealAgentK

Context

The AWS Lambda provider currently emits ES5 CommonJS and publishes build/raygun.aws.js plus build/raygun.aws.d.ts. It depends at runtime on the core raygun package. Dependabot PR #182 attempted to update TypeScript from 5.9.3 to 7.0.2, but that cannot be treated as a dependency-only upgrade:

  • TypeScript 7 removes target: "es5".
  • The current typescript-eslint toolchain supports TypeScript >=4.8.4 <6.1.0, so the automated PR fails during npm ci.
  • TypeScript 7 changes compiler defaults including rootDir and types; an implicit layout change could move output away from the published package entry point.
  • The package has no explicit engines field, so the supported Node/AWS Lambda runtime floor must be decided rather than inferred from a compiler upgrade.
  • The provider imports CommonJS APIs and a built subpath from raygun; its migration must remain coordinated with the core SDK.

PR #182 was intentionally closed and TypeScript 7 Dependabot updates were ignored for the current compatibility line. PR #185 first aligns this provider with Raygun4Node on TypeScript 6.0.3 while explicitly preserving byte-for-byte identical ES5 output and setting rootDir: "./lib".

The coordinated core migration is tracked in MindscapeHQ/raygun4node#538. This provider should not move to TS 7 ahead of the corresponding core compatibility decision.

Decisions required before implementation

  1. Supported AWS Lambda/Node.js runtimes

    • Document the supported Lambda Node runtime set and whether an explicit package engines field should be added.
    • Align the minimum with the core raygun package or document why this wrapper differs.
    • Treat removal of an older runtime as an explicit release-policy decision.
  2. Emitted JavaScript target

    • Select a target supported by every retained Lambda runtime (at least ES2015; potentially newer based on policy).
    • Preserve ES5 until that decision is approved; TypeScript 6 is the temporary compatibility bridge.
  3. CommonJS and package layout

    • Preserve CommonJS unless an independently reviewed module-format migration is approved.
    • Keep build/raygun.aws.js and build/raygun.aws.d.ts stable, or version/document any entry-point change.
    • Keep rootDir explicit to prevent compiler-default layout drift.
  4. Core SDK coordination

    • Validate against the intended released or packed raygun version.
    • Confirm direct and built-subpath imports remain valid under the selected package/module strategy.
  5. Toolchain readiness

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

Proposed implementation sequence

  1. Merge and validate the TypeScript 6 alignment in PR chore(deps-dev): align TypeScript 6 #185 without changing artifacts.
  2. Resolve the core runtime/target policy in Plan TypeScript 7 migration and modernize emitted JavaScript target raygun4node#538.
  3. Document this provider's supported Lambda runtime matrix and package engine policy.
  4. Upgrade TypeScript-adjacent tooling to TS 7-compatible versions while still on TS 6 where possible.
  5. Change the emitted target as a separately reviewable compatibility change.
  6. Upgrade to TypeScript 7 and address only compiler/configuration differences.
  7. Test against a packed candidate of the coordinated core package.

Acceptance criteria

  • Plan TypeScript 7 migration and modernize emitted JavaScript target raygun4node#538 has an approved runtime and output-target decision.
  • Supported AWS Lambda Node runtimes and package engine policy are documented.
  • Release impact (major/minor and migration guidance) is decided before merge.
  • All TypeScript-related tools officially support the selected TS 7 version; installation succeeds without peer overrides.
  • tsconfig.json explicitly sets the options needed to prevent default-driven layout/type changes.
  • CommonJS module behavior and existing public exports remain valid.
  • Async handlers, callback handlers, error forwarding, and scoped breadcrumb tests pass across the supported runtime matrix.
  • Tests pass against a packed candidate of the coordinated core raygun package.
  • npm pack contains build/raygun.aws.js and build/raygun.aws.d.ts at the documented paths.
  • Emitted JavaScript and declarations are reviewed for customer-facing changes.
  • The example Lambda project builds and loads the packed provider.
  • 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

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions