Rspack/Rsbuild: `@workflow/swc-plugin` can't run in `builtin:swc-loader`. Open to an `@workflow/rsbuild`?
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 35/100
- Issue 类型
- 功能
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- rust, typescript
- 领域
- build-system, tooling
调研方向
Start by running the documented npm install and npx rspack build reproduction, then read the @workflow/next/loader entry point. Review packages/builders/src/vercel-build-output-api.ts and the related Nitro and Astro builder files to understand the proposed integration boundaries. Done means an agreed Rsbuild integration or thin third-party path that supports the reported build and preserves existing .vercel/output/config.json content.
由索引模型根据 Issue 内容生成。
描述
@workflow/swc-plugin fails in Rspack's builtin:swc-loader, so Rsbuild/Rspack apps have no supported way to use Workflow.
Repro
npm i -D @rspack/[email protected] @rspack/[email protected] @workflow/[email protected]
// src/index.ts
export async function add(a: number, b: number) {
'use step';
return a + b;
}
// rspack.config.mjs
import { createRequire } from 'node:module';
const require = createRequire(import.meta.url);
export default {
target: 'node',
entry: './src/index.ts',
module: {
rules: [{
test: /\.ts$/,
loader: 'builtin:swc-loader',
options: { jsc: {
parser: { syntax: 'typescript' },
experimental: { plugins: [[require.resolve('@workflow/swc-plugin'), { mode: 'step' }]] },
} },
}],
},
};
Run npx rspack build.
Expected: the step transform runs.
Actual: failed to invoke plugin ... Failed to deserialize program received from host. The plugin pins swc_core 49 (Cargo.toml); Rspack 2.2 embeds swc_core 79.
Versions
@rspack/core 2.2.7; @workflow/swc-plugin 4.1.3 and 5.0.0-beta.7 (still swc_core 49 on main).
Workaround
@workflow/next/loader works as a plain Rspack JS loader.
Ask
Would you take an @workflow/rsbuild package? We have one working on workflow 4.8 (JS loader, BaseBuilder subclass, dev middleware) and can contribute it. If you'd rather keep it out of tree, two changes would keep a third-party plugin thin:
- Export the loader from a bundler-neutral path, e.g.
@workflow/builders/loader. - Have
VercelBuildOutputAPIBuildermerge into an existing.vercel/output/config.jsoninstead of overwriting it (vercel-build-output-api.ts#L111-L126). Nitro and Astro each re-merge it today (nitro, astro).
- 主要语言
- TypeScript
- 星标
- 2.5k
- 派生
- 401
- 平均合并
- 1 天 21 小时
- 30 天内合并 PR
- 201
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 没有贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
vercel/workflow 的其他 Issue
-
getPortLazy re-runs OS port discovery on every call when it finds no port可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 2/5 1-3 小时 新手友好度 65/100
维护者通常 1 天内回复
-
node-module-esbuild-plugin: getImportedIdentifier only checks the first named import when locating a violation可能已有人在做 @div-cowboy 于 6 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
vercel/workflow#5057 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 74/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 84/100
维护者通常 1 天内回复
-
code-transform.mdx §ID Generation omits the package-shipped `name@version` ID form可能已有人在做 @Mohith26 于 113 天前认领。 未关闭
难度 1/5 1 小时以内 新手友好度 90/100
维护者通常 1 天内回复
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 82/100
solidjs/solid-docs#1716 ·
维护者通常 1 天内回复
-
bug needs-triage
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
Progress indicated by console logs is off by one可能已有人在做 @marceliwac 今天认领。 未关闭bug needs-triage
难度 2/5 1-3 小时 新手友好度 76/100
aws-samples/aws-cdk-examples#1336 ·
-
难度 2/5 1-3 小时 新手友好度 74/100
melgarafael/DeskcommCRM#4999 · 1 条评论 ·
维护者通常 1 天内回复
-
type: bug
难度 2/5 1-3 小时 新手友好度 78/100
nrwl/nx#37955 · 1 个 reaction ·
维护者通常 2 天内回复