[core] Decouple platform_interface from Flutter for pure-Dart web
维护者通常 1 天内回复
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 35/100
- Issue 类型
- 重构
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- dart
- 领域
- api, build-system
调研方向
首先阅读 firebase_core_platform_interface/pubspec.yaml 和 MethodChannelFirebase 的实现,然后比较 issue 中描述的相关 *_platform_interface 和 web 包。与 maintainers 一起审查 Option A 和 Option B,并确认 FirebaseException/PlatformException 契约。完成的标准是选定一个方向并解决验收标准。
由索引模型根据 Issue 内容生成。
描述
Context & Problem
Recent cleanups (#18604, #18624) removed package:flutter/foundation.dart, package:flutter/material.dart, and package:flutter_web_plugins imports from *_platform_interface data models and firebase_core_web. Because FlutterFire web implementations (firebase_core_web, firebase_auth_web, cloud_firestore_web) are built on dart:js_interop and package:web, they can compile to JS and Wasm GC without pulling in dart:ui or the Flutter engine.
However, non-Flutter Dart web frameworks (e.g. Jaspr) and pure-Dart environments cannot resolve these packages using standalone dart pub get because firebase_core_platform_interface (and sibling *_platform_interface packages) still declare flutter: sdk: flutter in pubspec.yaml.
The sole remaining reason *_platform_interface depends on flutter: sdk: flutter is that it bundles the default MethodChannel* implementation (package:flutter/services.dart). Meanwhile, package:plugin_platform_interface itself is already 100% pure Dart.
Proposed Options
We would like feedback from the maintainers on two architectural options to remove the flutter: sdk: flutter dependency from the platform interface layer:
Option A: Move MethodChannel* out of *_platform_interface (In-Place Pure Dart)
- Move
MethodChannelFirebase(package:flutter/services.dart) fromfirebase_core_platform_interfaceinto the app-facingfirebase_corepackage (or a dedicatedfirebase_core_method_channelsubpackage). - Remove
flutter: sdk: flutterandenvironment: flutter:fromfirebase_core_platform_interface/pubspec.yaml. - Pros: Zero new packages;
*_platform_interfacebecomes 100% pure Dart immediately. - Cons: Technically a breaking change for external consumers or test suites that directly instantiate
MethodChannelFirebasefromfirebase_core_platform_interface(requires scheduling for the next major version bump).
Option B: Extract Pure-Dart Leaf Package (package:firebase_common / *_interface)
- Extract pure-Dart platform contracts and shared domain models (
FirebaseAppPlatform,FirebaseOptions,FirebaseException,Timestamp,GeoPoint, etc.) into a zero-dependency pure-Dart package (e.g.package:firebase_common). - Have
*_platform_interfacere-export these types alongsideMethodChannel*, while*_webpackages depend directly on the pure-Dart package. - Pros: 100% backwards-compatible; requires no major version bump to existing
*_platform_interfacepackages; enables code sharing with server-sidefirebase-admin-dart. - Cons: Introduces a new leaf package to publish and maintain in the monorepo.
Acceptance Criteria
- Select preferred direction (Option A vs. Option B) for decoupling
MethodChannel*(package:flutter/services.dart) from the pure-Dart interface layer. - Confirm whether pure-Dart platform interfaces should standardize exclusively on
FirebaseExceptionrather than catching/throwingPlatformException.
- 主要语言
- Dart
- 星标
- 9.3k
- 派生
- 4.1k
- 平均合并
- 2 天 7 小时
- 30 天内合并 PR
- 47
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
firebase/flutterfire 的其他 Issue
-
🚀 [firebase_core] Bump Firebase Android SDK (35.0.0 → 35.0.1)可能已有人在做 @SelaseKay 于 1 天前认领。 未关闭Needs Attention type: enhancement
难度 2/5 1-3 小时 新手友好度 20/100
firebase/flutterfire#18807 · 1 条评论 ·
维护者通常 1 天内回复
-
[firebase_auth]: authStateChanges() never emits null when the user is force-signed-out before the stream is listened to (iOS, macOS, Android)可能已有人在做 @JulianPscheid 于 3 天前认领。 未关闭Needs Attention platform: android platform: ios platform: macos plugin: auth reproduced type: bug
难度 4/5 1-2 天 新手友好度 15/100
firebase/flutterfire#18796 · 1 条评论 ·
维护者通常 1 天内回复
-
blocked: customer-response Needs Attention platform: ios plugin: messaging type: bug
难度 4/5 3-5 天 新手友好度 48/100
firebase/flutterfire#18776 · 4 条评论 ·
维护者通常 1 天内回复
-
[📚] Remote Config Windows Support still N/A on Readme可能已有人在做 @nightcityblade 于 9 天前认领。 未关闭blocked: customer-response good first issue Needs Attention platform: windows plugin: remote_config type: documentation
难度 1/5 1 小时以内 新手友好度 30/100
firebase/flutterfire#18763 · 3 条评论 ·
维护者通常 1 天内回复
-
[cloud_firestore]: a snapshots() listener cancelled while it registers is never removed natively可能已有人在做 @chiliec 于 21 天前认领。 未关闭Needs Attention platform: android platform: ios platform: macos plugin: cloud_firestore reproduced type: bug
难度 3/5 1-2 天 新手友好度 72/100
firebase/flutterfire#18724 · 2 条评论 ·
维护者通常 1 天内回复
查看 firebase/flutterfire 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 68/100
AimesSoft/NipaPlay-Reload#1021 ·
维护者通常 1 天内回复
-
enhancement triage
难度 2/5 1-3 小时 新手友好度 62/100
fluttercommunity/plus_plugins#4004 ·
维护者通常 1 天内回复
-
agent:ready bug P2 · 中 健壮性 区域: 启动与合规 待验证 隐私与合规
难度 2/5 1-3 小时 新手友好度 66/100
ASDW51/DanmuFloat#106 ·
维护者通常 1 天内回复
-
c: proposal p: go_router package team-ecosystem
难度 2/5 1-3 小时 新手友好度 60/100
flutter/flutter#194542 · 1 条评论 ·
维护者通常 1 天内回复
-
enhancement good first issue help wanted
难度 2/5 1-3 小时 新手友好度 80/100