The `ANGULARFIRE2_VERSION` build placeholder ships unreplaced in the library, and `versions.json` never reaches the compiled schematics
- 主要語言
- TypeScript
- 星號
- 7.8k
- 分支
- 2.2k
- 平均合併
- 22 小時 28 分鐘
- 30 天內合併 PR
- 6
描述
### Version info
**Angular:** 21.2.x **Firebase:** 12.x **AngularFire:** 21.0.0-rc.0
### How to reproduce these conditions
1. `npm pack @angular/fire@next` and inspect `fesm2022/angular-fire.mjs` — search for `ANGULARFIRE2_VERSION`.
2. Or in an app: `import { VERSION } from '@angular/fire'; console.log(VERSION.full);`
### Expected behavior
`VERSION.full` (and the underlying `Version` object in `src/core.ts`) should report the real installed version, e.g. `21.0.0-rc.0`.
### Actual behavior
`VERSION` is constructed as `new Version('ANGULARFIRE2_VERSION')` - the build-time placeholder that's supposed to be replaced with the real version before publishing, but isn't for this occurrence. The published package ships the literal string.
A related mechanism is also broken: `src/schematics/versions.json`'s `peerDependencies`/`firebaseFunctionsDependencies` data is filled in by `tools/build.ts` *after* the schematics are bundled with esbuild, which has already inlined the JSON import from the unfilled source file at compile time.
- The post-build edit to `versions.json` on disk is never read by the shipped schematic code.
- One concrete effect: `addDependencies()` in `src/schematics/common.ts` never has real version data to check against, so it can't detect or warn about conflicting dependency versions the way it appears designed to.
Will need a decision on one of these approaches:
- string-replace with a build-time guard, matching what PR #3709/#3711 just did for the schematics' own version placeholder, or
- reworking the `versions.json` inlining - the fix touches `tools/build.ts` and possibly `src/core.ts`, so I wanted to flag it and get a read before picking a direction.
貢獻指南
研究方向
從 src/core.ts 和 tools/build.ts 開始,接著檢查 src/schematics/versions.json 以及 src/schematics/common.ts 中的 addDependencies()。比較 PR #3709 和 #3711 中的建置時 placeholder 處理方式,並追蹤 JSON 何時被打包。完成的標準是:已發布的 VERSION 回報已安裝的版本,且隨附的 schematics 包含可用的相依性版本資料。
由索引模型根據 Issue 內容生成。
評估
- 技術堆疊
- angular, firebase, typescript
- 領域
- build-system, release, tooling
- Issue 類型
- 缺陷
- 難度
- 4/5
- 預估耗時
- 3-5 天
- 活躍度
- 冷清
- 描述清晰度
- 基本清楚
- 新手友好度
- 52/100