Release process: add a built-artifact (dist/bundle) check to catch runtime regressions before publish
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 48/100
- Issue 类型
- 功能
- 描述清晰度
- 基本清楚
- 活跃度
- 冷清
- 技术栈
- firebase, node.js, react, typescript
- 领域
- build-system, ci-cd, release, testing
调研方向
从针对 npm pack 输出的拟议检查开始,尤其是 dist/index.js、包的 exports/main/module 路径,以及 Node ESM 和 CommonJS import 命令。定义一个发布前 gate,涵盖动态 require 和外部检查、入口点加载、tarball 路径完整性以及 bundle 大小比较;运行时 smoke 应用和 .d.ts diff 是相关的后续工作。完成的标准是在发布前由 release 流程检测到 #759 中描述的回归。
由索引模型根据 Issue 内容生成。
描述
Motivation
#759 (the App Router / Vite client crash in 4.2.4 and 4.2.5) shipped because the build-tooling migration silently changed the built ESM output: use-sync-external-store/shim (CJS) started getting bundled into the ESM dist, producing a dynamic require() that throws in any browser bundle (Calling \require` for "react" in an environment that doesn't expose the require function`). The source was unchanged; only the emitted artifact regressed, and nothing in the release flow compared the artifact before publish.
This is the second dist-level regression to ship as a patch: #749 already proposes a published .d.ts diff to catch the type side (the 4.2.4 ObservableStatus break). This issue covers the runtime/bundle side. Together they form a built-artifact diff gate.
Proposed pre-publish checks
A concrete checklist for a pre-publish gate (each item derived from auditing the 4.2.6 release by hand). Items marked would have caught #759.
- No dynamic
require(/ CJS-interop shims in the ESM dist. Grepdist/index.jsfor\brequire\b,__require,createRequire,__commonJS. (Would have caught #759:requirecount went 0 at 4.2.3 to 3 at 4.2.4+.) - Externals are not inlined. Only
rxfire/rxjs/tslibshould be bundled;react,firebase/*,@firebase/*, anduse-sync-external-store/shimmust stay externalimportspecifiers. Catches accidental bundling that causes duplicate-instance bugs. - Both entry points load.
node --input-type=module -e "import('reactfire')"andnode -e "require('reactfire')"(in a fixture withreact+firebaseinstalled) must resolve without throwing. Catches missing/renamed files and broken imports. - exports map integrity. Every path referenced by
exports/main/moduleexists in the packed tarball. - Bundle-size delta vs previous
latest.npm packthe currentlatest, comparedistsize; flag large jumps (a proxy for accidental inlining). - Published
.d.tsdiff vs previous version. Type-side counterpart, tracked in #749; catches the 4.2.4ObservableStatusbreak class. - Runtime smoke render in CI (strongest). A minimal Next App Router (turbopack) and Vite app that renders a data hook against the packed build; fails on the #759 crash. This is the check that catches runtime regressions the static greps miss.
Items 1 to 5 are cheap and scriptable against npm pack output; 7 is the higher-value integration check.
Related
- #749 (published
.d.tsdiff, the type-side counterpart) - #759 / #760 (the regression this would have caught, and its fix)
- 主要语言
- TypeScript
- 星标
- 3.6k
- 派生
- 403
- 平均合并
- 5 天 1 小时
- 30 天内合并 PR
- 10
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
FirebaseExtended/reactfire 的其他 Issue
-
难度 5/5 一周以上 新手友好度 38/100
FirebaseExtended/reactfire#801 ·
-
v5
难度 4/5 3-5 天 新手友好度 48/100
FirebaseExtended/reactfire#793 ·
-
v5
难度 4/5 3-5 天 新手友好度 35/100
FirebaseExtended/reactfire#790 · 2 条评论 ·
-
v5
难度 4/5 3-5 天 新手友好度 55/100
FirebaseExtended/reactfire#789 ·
-
难度 5/5 一周以上 新手友好度 35/100
FirebaseExtended/reactfire#788 ·
查看 FirebaseExtended/reactfire 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 84/100
bcgov/bc-wallet-mobile#4761 · 1 条评论 ·
-
external-issue to-triage
难度 2/5 1-3 小时 新手友好度 88/100
-
area-deployment area-integrations triage:bot-seen
难度 2/5 半天 新手友好度 86/100
-
难度 2/5 1-3 小时 新手友好度 82/100
-
refactor
难度 2/5 1-3 小时 新手友好度 84/100