Share/Unify `Timestamp` between `google_cloud_firestore` and `cloud_firestore`

オープン
#286 コメント 4 件 リアクション 1 件 担当者 0 名 GitHub で見る

メンテナーはふだん 6 日以内に返信

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
35/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
静か
技術スタック
dart

調査の方向性

まず cloud_firestore_platform_interface と firebase-admin-dart の Timestamp 定義を比較し、次に中立的な Pure-Dart パッケージで共有型を提供できるかを調査してください。cloud_firestore と google_cloud_firestore の両方が互換性のある型に依存し、それらを再エクスポートし、Flutter 固有または VM 固有の依存関係を持たない状態になれば完了です。

索引モデルが issue の本文から書いたものです。

説明

blocked bug

Proposal: Share/Unify Timestamp between google_cloud_firestore and cloud_firestore

Problem

When building full-stack Dart applications (Flutter on the client, Dart VM/Firebase Functions on the server), sharing data models with Firestore timestamps is highly problematic.

  • cloud_firestore (specifically cloud_firestore_platform_interface) and google_cloud_firestore (firebase-admin-dart) define their own incompatible Timestamp classes.
  • Even though they have the same underlying structure (seconds and nanoseconds), Dart's static type system treats them as completely separate types.
  • As a result, shared models cannot run simple type checks (like value is Timestamp) without introducing Flutter dependencies to the backend. Developers must rely on brittle workarounds like string-based runtime type checking (value.runtimeType.toString().contains('Timestamp')).
Proposed Solution

We highly recommend extracting basic, pure Dart Firestore types (such as Timestamp and GeoPoint) into a lightweight, neutral package (e.g., firebase_common_types) with no dependencies on Flutter or VM-specific APIs.

Both cloud_firestore and google_cloud_firestore should then depend on and re-export these shared types. This will enable clean, type-safe full-stack Dart development.

主要言語
Dart
スター
180
フォーク
73
平均マージ
5日 8時間
マージ済み PR(30日)
9

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

firebase/firebase-admin-dart のほかの issue

firebase/firebase-admin-dart の issue をすべて見る

似ている issue

Dart の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。