angular / angular/angularfire

The `ANGULARFIRE2_VERSION` build placeholder ships unreplaced in the library, and `versions.json` never reaches the compiled schematics

Đang mở
#3,715 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
TypeScript
Star
7.8k
Fork
2.2k
Merge trung bình
22 giờ 28 phút
Pull request đã merge (30 ngày)
6

Mô tả

### 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.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Bắt đầu với src/core.ts và tools/build.ts, sau đó kiểm tra src/schematics/versions.json và addDependencies() trong src/schematics/common.ts. So sánh cách xử lý placeholder trong thời gian build ở các PR #3709 và #3711, đồng thời theo dõi thời điểm JSON được đóng gói. Hoàn thành có nghĩa là VERSION được phát hành báo cáo phiên bản đã cài đặt và các schematics được phân phối chứa dữ liệu phiên bản dependency có thể sử dụng.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
angular, firebase, typescript
Lĩnh vực
build-system, release, tooling
Loại issue
Lỗi
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Ít trao đổi
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
52/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.