firebase-js-sdk icon indicating copy to clipboard operation
firebase-js-sdk copied to clipboard

[Feat] FS SSR serialization

Open DellaBitta opened this issue 8 months ago • 4 comments

Discussion

Support the ability to resume onSnapshot listeners in the CSR phase based on serialized DataSnapshots and QuerySnapshots built in the SSR phase. Allow Firestore result types to be serialized with toJSON and then deserialized with fromJSON methods on the objects.

DocumentSnapshot and QuerySnapshot deserialization methods will be standalone, tree-shakable functions dataSnapshotFromJSON and querySnapshotFromJSON.

Testing

Integration Tests. Unit Tests. Locally tested with Next.JS.

Will add to our Next.js End to End test suite when the change has been staged.

API Changes

Approved go/fs-js-json-serialization.

DellaBitta avatar Apr 15 '25 00:04 DellaBitta

⚠️ No Changeset found

Latest commit: 67cd379305500e74758b3dd924a06fed6c0790a4

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

changeset-bot[bot] avatar Apr 15 '25 00:04 changeset-bot[bot]

Size Report 1

Affected Products

  • @firebase/firestore

    TypeBase (13e6cce)Merge (3503366)Diff
    browser385 kB395 kB+9.29 kB (+2.4%)
    main596 kB615 kB+19.5 kB (+3.3%)
    module385 kB395 kB+9.29 kB (+2.4%)
    react-native386 kB395 kB+9.29 kB (+2.4%)
  • @firebase/firestore-lite

    TypeBase (13e6cce)Merge (3503366)Diff
    browser114 kB117 kB+2.56 kB (+2.2%)
    main157 kB160 kB+2.92 kB (+1.9%)
    module114 kB117 kB+2.56 kB (+2.2%)
    react-native114 kB117 kB+2.56 kB (+2.2%)
  • bundle

    15 size changes

    TypeBase (13e6cce)Merge (3503366)Diff
    firestore (CSI Auto Indexing Disable and Delete)280 kB290 kB+10.3 kB (+3.7%)
    firestore (CSI Auto Indexing Enable)280 kB290 kB+10.3 kB (+3.7%)
    firestore (Persistence)311 kB321 kB+10.3 kB (+3.3%)
    firestore (Query Cursors)256 kB260 kB+3.71 kB (+1.4%)
    firestore (Query)254 kB258 kB+3.71 kB (+1.5%)
    firestore (Read data once)242 kB247 kB+5.63 kB (+2.3%)
    firestore (Read Write w Persistence)336 kB341 kB+5.50 kB (+1.6%)
    firestore (Realtime updates)244 kB248 kB+3.83 kB (+1.6%)
    firestore (Transaction)221 kB226 kB+5.50 kB (+2.5%)
    firestore (Write data)220 kB228 kB+7.12 kB (+3.2%)
    firestore-lite (Query Cursors)109 kB111 kB+2.03 kB (+1.9%)
    firestore-lite (Query)105 kB107 kB+2.03 kB (+1.9%)
    firestore-lite (Read data once)80.6 kB82.8 kB+2.16 kB (+2.7%)
    firestore-lite (Transaction)106 kB108 kB+2.03 kB (+1.9%)
    firestore-lite (Write data)90.2 kB92.3 kB+2.03 kB (+2.2%)
  • firebase

    TypeBase (13e6cce)Merge (3503366)Diff
    firebase-compat.js802 kB806 kB+3.61 kB (+0.4%)
    firebase-firestore-compat.js347 kB351 kB+3.60 kB (+1.0%)
    firebase-firestore-lite.js137 kB140 kB+2.56 kB (+1.9%)
    firebase-firestore.js449 kB458 kB+9.26 kB (+2.1%)

Test Logs

google-oss-bot avatar Apr 15 '25 00:04 google-oss-bot

Size Analysis Report 1

This report is too large (1,176,362 characters) to be displayed here in a GitHub comment. Please use the below link to see the full report on Google Cloud Storage.

Test Logs

google-oss-bot avatar Apr 15 '25 01:04 google-oss-bot