Skip to content

docs(experiments): document experiments.typescript (5.107)#8247

Merged
bjohansebas merged 3 commits into
mainfrom
docs/experiments-typescript
May 24, 2026
Merged

docs(experiments): document experiments.typescript (5.107)#8247
bjohansebas merged 3 commits into
mainfrom
docs/experiments-typescript

Conversation

@bjohansebas
Copy link
Copy Markdown
Member

Summary

Webpack 5.107 adds first-class TypeScript support behind a new experiments.typescript flag using Node.js's built-in module.stripTypeScriptTypes (Node.js >= 22.6).

Documents:

  • The flag itself (boolean, default false, auto-enabled by experiments.futureDefaults).
  • The defaults wired up automatically: rules for .ts / .cts / .mts, .ts in extension resolution, extensionAlias from .js / .cjs / .mjs to the matching .ts extensions, tsconfig.json resolution, and the "typescript" conditional-exports key.
  • The constraints (types-only transform; no type checking, no JSX/.tsx, no non-erasable syntax like enum / namespace / parameter-property constructors), matching tsconfig's erasableSyntaxOnly.
  • Links to examples/typescript and examples/typescript-non-erasable for the built-in setup and the ts-loader fallback.

Refs: webpack/webpack#20964

Test plan

  • Visual check of the new ### experiments.typescript section
  • Verify the TOC entry links correctly
  • Verify the warning admonition is visible
  • Verify the badge shows "5.107.0+"

Use of AI

Drafted with Claude under human review. The contributor verified each change against the upstream webpack PR before commit.

Webpack 5.107 adds first-class TypeScript support behind a new
experiments.typescript flag using Node.js's built-in
module.stripTypeScriptTypes (Node.js >= 22.6). Documents:

- The flag itself (boolean, default false, auto-enabled by
  experiments.futureDefaults).
- The defaults it wires up (rules, extension resolution, extensionAlias,
  tsconfig resolution, "typescript" conditional-exports key).
- The constraints: types-only transform, no type checking, no JSX/.tsx,
  no non-erasable syntax (enum, namespace, etc.), matching tsconfig's
  erasableSyntaxOnly.
- Links to examples/typescript and examples/typescript-non-erasable in
  the webpack repo for both the built-in setup and the ts-loader fallback.

Refs: webpack/webpack#20964
@vercel
Copy link
Copy Markdown

vercel Bot commented May 19, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
webpack-js-org Ready Ready Preview, Comment May 24, 2026 5:38pm

Request Review

@alexander-akait
Copy link
Copy Markdown
Member

@bjohansebas let's rebase and we can merge, thanks

evenstensberg
evenstensberg previously approved these changes May 20, 2026
@evenstensberg
Copy link
Copy Markdown
Member

could you rebase?

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds documentation for webpack 5.107’s new experimental TypeScript support behind experiments.typescript, explaining what gets enabled by default, the feature’s constraints, and pointing to upstream examples.

Changes:

  • Adds experiments.typescript to the experiments option list/TOC.
  • Documents the new experiments.typescript flag, including defaults it wires up (rules, resolution, extensionAlias, tsconfig, conditional exports).
  • Adds a warning callout describing “types-erasure only” limitations and recommended tooling alternatives.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/content/configuration/experiments.mdx Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 24, 2026 17:36
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

@bjohansebas bjohansebas enabled auto-merge (squash) May 24, 2026 17:39
@bjohansebas bjohansebas disabled auto-merge May 24, 2026 18:14
@bjohansebas bjohansebas merged commit ce9ce97 into main May 24, 2026
10 checks passed
@bjohansebas bjohansebas deleted the docs/experiments-typescript branch May 24, 2026 18:14
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.

4 participants