Skip to content

feat(core): support source.transformImport#1124

Merged
9aoy merged 3 commits into
mainfrom
feat/transform-import-config
Apr 2, 2026
Merged

feat(core): support source.transformImport#1124
9aoy merged 3 commits into
mainfrom
feat/transform-import-config

Conversation

@9aoy

@9aoy 9aoy commented Apr 1, 2026

Copy link
Copy Markdown
Collaborator

Summary

Background

Rsbuild and Rslib expose source.transformImport, but Rstest did not accept or inherit that option yet. This made on-demand import transforms inconsistent between build configs and test runs.

Implementation

  • Added source.transformImport to the Rstest config type and forwarded it through the Rsbuild and Rslib adapters.
  • Added adapter unit tests plus a bare rstest.config e2e case to verify the option is applied in tests.
  • Documented the new config entry and the current caveat that transformed requests can affect rs.mock() and related actual-import APIs.

User Impact

Users can now configure source.transformImport directly in Rstest or inherit it from Rsbuild and Rslib configs, with the current mocking limitation documented.

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

Validation

  • pnpm format
  • pnpm run lint
  • pnpm run typecheck
  • pnpm run build
  • pnpm run test
  • cd e2e && pnpm test

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Apr 1, 2026

Copy link
Copy Markdown

Deploying rstest with  Cloudflare Pages  Cloudflare Pages

Latest commit: 368b9ea
Status:⚡️  Build in progress...

View logs

@github-actions

github-actions Bot commented Apr 1, 2026

Copy link
Copy Markdown

Rsdoctor Bundle Diff Analysis

Found 12 projects in monorepo, 2 projects with changes.

📊 Quick Summary
Project Total Size Change
adapter-rsbuild 2.2 KB 📈 +46.0 B (+2.1%)
adapter-rslib 23.2 KB +50.0 B (0.2%)
adapter-rspack 5.9 KB 0
browser 2.0 MB 0
browser-react 3.7 KB 0
browser-ui 804.4 KB 0
coverage-istanbul 8.9 KB 0
core/browser 970.4 KB 0
core/loaders 869.0 B 0
core/main 1.5 MB 0
vscode/extension 60.2 MB 0
vscode/worker 14.4 KB 0
📋 Detailed Reports (Click to expand)

📁 adapter-rsbuild

Path: packages/adapter-rsbuild/.rsdoctor/rsdoctor-data.json

📌 Baseline Commit: a3591b23fe | PR: #1130

Metric Current Baseline Change
📊 Total Size 2.2 KB 2.1 KB +46.0 B (+2.1%)
📄 JavaScript 2.2 KB 2.1 KB +46.0 B (+2.1%)
🎨 CSS 0 B 0 B 0
🌐 HTML 0 B 0 B 0
📁 Other Assets 0 B 0 B 0

📦 Download Diff Report: adapter-rsbuild Bundle Diff

📁 adapter-rslib

Path: packages/adapter-rslib/.rsdoctor/rsdoctor-data.json

📌 Baseline Commit: a3591b23fe | PR: #1130

Metric Current Baseline Change
📊 Total Size 23.2 KB 23.2 KB +50.0 B (0.2%)
📄 JavaScript 23.2 KB 23.2 KB +50.0 B (0.2%)
🎨 CSS 0 B 0 B 0
🌐 HTML 0 B 0 B 0
📁 Other Assets 0 B 0 B 0

📦 Download Diff Report: adapter-rslib Bundle Diff

Generated by Rsdoctor GitHub Action

@9aoy 9aoy requested a review from fi3ework April 1, 2026 08:29
@9aoy 9aoy changed the title feat(config): support source.transformImport feat(core): support source.transformImport Apr 1, 2026
@9aoy 9aoy force-pushed the feat/transform-import-config branch from 8a48919 to cddc774 Compare April 1, 2026 08:31
@9aoy 9aoy force-pushed the feat/transform-import-config branch from cddc774 to a0dfded Compare April 2, 2026 10:30
@9aoy 9aoy merged commit 4775c75 into main Apr 2, 2026
17 of 18 checks passed
@9aoy 9aoy deleted the feat/transform-import-config branch April 2, 2026 11:03
@9aoy 9aoy mentioned this pull request Apr 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants