Skip to content

Conversation

@rafikhan
Copy link
Contributor

@rafikhan rafikhan commented Sep 4, 2025

This commit introduces a new developer documentation hub under the devdocs directory. The goal of this new documentation is to provide a comprehensive resource for developers working on the Firestore JS SDK.

The new documentation includes:

  • Overview: A high-level overview of the SDK, its goals, and architecture.
  • Prerequisites: A guide for new contributors, outlining the necessary skills and knowledge.
  • Architecture: A detailed explanation of the SDK's architecture, core components, and data flow.
  • Code Layout: A document that explains the structure of the codebase.
  • Build & Testing: Initial documents for the build and testing processes.

This commit introduces a new developer documentation hub under the `devdocs` directory. The goal of this new
documentation is to provide a comprehensive resource for developers working on the Firestore JS SDK.

The new documentation includes:

- **Overview:** A high-level overview of the SDK, its goals, and architecture.
- **Prerequisites:** A guide for new contributors, outlining the necessary skills and knowledge.
- **Architecture:** A detailed explanation of the SDK's architecture, core components, and data flow.
- **Code Layout:** A document that explains the structure of the codebase.
- **Build & Testing:** Initial documents for the build and testing processes.
@rafikhan rafikhan requested review from a team as code owners September 4, 2025 21:25
@changeset-bot
Copy link

changeset-bot bot commented Sep 4, 2025

⚠️ No Changeset found

Latest commit: 910dc87

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

@rafikhan rafikhan self-assigned this Sep 4, 2025
@rafikhan rafikhan marked this pull request as draft September 4, 2025 21:26
@google-oss-bot
Copy link
Contributor

google-oss-bot commented Sep 4, 2025

Size Report 1

Affected Products

  • @firebase/ai

    TypeBase (55f3f83)Merge (060749d)Diff
    browser61.3 kB65.4 kB+4.11 kB (+6.7%)
    main64.8 kB69.2 kB+4.41 kB (+6.8%)
    module61.3 kB65.4 kB+4.11 kB (+6.7%)
  • @firebase/analytics

    TypeBase (55f3f83)Merge (060749d)Diff
    browser21.5 kB21.6 kB+88 B (+0.4%)
    main22.7 kB22.8 kB+88 B (+0.4%)
    module21.5 kB21.6 kB+88 B (+0.4%)
  • @firebase/auth

    TypeBase (55f3f83)Merge (060749d)Diff
    browser188 kB188 kB+41 B (+0.0%)
    cordova161 kB161 kB+41 B (+0.0%)
    main144 kB144 kB+41 B (+0.0%)
    module188 kB188 kB+41 B (+0.0%)
    react-native161 kB161 kB+41 B (+0.0%)
  • @firebase/auth-cordova

    TypeBase (55f3f83)Merge (060749d)Diff
    browser161 kB161 kB+41 B (+0.0%)
    module161 kB161 kB+41 B (+0.0%)
  • @firebase/auth-web-extension

    TypeBase (55f3f83)Merge (060749d)Diff
    browser139 kB139 kB+41 B (+0.0%)
    main155 kB156 kB+41 B (+0.0%)
    module139 kB139 kB+41 B (+0.0%)
  • @firebase/auth/internal

    TypeBase (55f3f83)Merge (060749d)Diff
    browser198 kB198 kB+41 B (+0.0%)
    main169 kB169 kB+41 B (+0.0%)
    module198 kB198 kB+41 B (+0.0%)
  • @firebase/data-connect

    TypeBase (55f3f83)Merge (060749d)Diff
    browser21.3 kB21.5 kB+139 B (+0.7%)
    main23.6 kB23.7 kB+139 B (+0.6%)
    module21.3 kB21.5 kB+139 B (+0.7%)
  • @firebase/remote-config

    TypeBase (55f3f83)Merge (060749d)Diff
    browser22.7 kB39.0 kB+16.3 kB (+71.6%)
    main23.9 kB40.2 kB+16.4 kB (+68.7%)
    module22.7 kB39.0 kB+16.3 kB (+71.6%)
  • @firebase/webchannel-wrapper/bloom-blob

    TypeBase (55f3f83)Merge (060749d)Diff
    browser11.1 kB11.3 kB+123 B (+1.1%)
    main11.1 kB11.3 kB+123 B (+1.1%)
    module11.1 kB11.3 kB+123 B (+1.1%)
  • @firebase/webchannel-wrapper/webchannel-blob

    TypeBase (55f3f83)Merge (060749d)Diff
    browser42.2 kB40.9 kB-1.27 kB (-3.0%)
    main42.2 kB40.9 kB-1.27 kB (-3.0%)
    module42.2 kB40.9 kB-1.27 kB (-3.0%)
  • bundle

    17 size changes

    TypeBase (55f3f83)Merge (060749d)Diff
    analytics (logEvent)43.8 kB44.1 kB+340 B (+0.8%)
    firestore (CSI Auto Indexing Disable and Delete)287 kB286 kB-1.16 kB (-0.4%)
    firestore (CSI Auto Indexing Enable)287 kB286 kB-1.16 kB (-0.4%)
    firestore (Persistence)319 kB318 kB-1.16 kB (-0.4%)
    firestore (Query Cursors)258 kB257 kB-1.16 kB (-0.4%)
    firestore (Query)256 kB255 kB-1.16 kB (-0.5%)
    firestore (Read data once)246 kB245 kB-1.16 kB (-0.5%)
    firestore (Read Write w Persistence)339 kB338 kB-1.16 kB (-0.3%)
    firestore (Realtime updates)246 kB245 kB-1.16 kB (-0.5%)
    firestore (Transaction)224 kB223 kB-1.16 kB (-0.5%)
    firestore (Write data)226 kB224 kB-1.16 kB (-0.5%)
    firestore-lite (Query Cursors)110 kB110 kB+123 B (+0.1%)
    firestore-lite (Query)106 kB106 kB+123 B (+0.1%)
    firestore-lite (Read data once)81.5 kB81.6 kB+123 B (+0.2%)
    firestore-lite (Transaction)107 kB107 kB+123 B (+0.1%)
    firestore-lite (Write data)91.0 kB91.1 kB+123 B (+0.1%)
    remote-config (getAndFetch)47.8 kB59.4 kB+11.7 kB (+24.4%)

  • firebase

    13 size changes

    TypeBase (55f3f83)Merge (060749d)Diff
    firebase-ai.js48.4 kB51.4 kB+2.96 kB (+6.1%)
    firebase-analytics-compat.js25.4 kB25.4 kB+35 B (+0.1%)
    firebase-analytics.js29.3 kB29.4 kB+50 B (+0.2%)
    firebase-auth-cordova.js139 kB139 kB+41 B (+0.0%)
    firebase-auth-web-extension.js122 kB122 kB+41 B (+0.0%)
    firebase-auth.js159 kB159 kB+41 B (+0.0%)
    firebase-compat.js800 kB809 kB+9.39 kB (+1.2%)
    firebase-data-connect.js22.5 kB22.6 kB+68 B (+0.3%)
    firebase-firestore-compat.js349 kB348 kB-1.18 kB (-0.3%)
    firebase-firestore-lite.js138 kB138 kB+132 B (+0.1%)
    firebase-firestore.js455 kB454 kB-1.11 kB (-0.2%)
    firebase-remote-config-compat.js27.9 kB38.7 kB+10.8 kB (+38.5%)
    firebase-remote-config.js32.2 kB43.5 kB+11.3 kB (+35.1%)

Test Logs

  1. https://storage.googleapis.com/firebase-sdk-metric-reports/cBl8SOQk5E.html

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Sep 4, 2025

Size Analysis Report 1

This report is too large (212,591 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

  1. https://storage.googleapis.com/firebase-sdk-metric-reports/f5NASYambQ.html

Copy link
Contributor

@ehsannas ehsannas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. A few minor comments below.


1. **API Layer**: A user initiates a write operation (e.g., `setDoc`, `updateDoc`, `deleteDoc`).
2. **Sync Engine**: The call is routed to the Sync Engine, which wraps the operation in a "mutation".
3. **Mutation Queue (in Local Store)**: The Sync Engine adds this mutation to the Mutation Queue. The queue is persisted to the **Persistence Layer** (IndexedDB). At this point, the SDK "optimistically" considers the write successful locally.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overlays were added which is missing from the diagram and the description.


The SDK is composed of several key components that work together to provide the full range of Firestore features.

![Architecture Diagram](./architecture.png)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if a graphviz dot representation of the diagram would be better to use rather than a png file.

Comment on lines +31 to +43
TODO: Add critical information about the build process including optimizations for code size, etc.

For information on how the artifacts are built, please see the [Build documentation](./build.md) file.

## Testing

TODO: Add critical information about the tests harness, organization, spec tests, etc.

For information on how the tests are setup and organized [Testing documentation](./testing.md) file.

## Developer Workflow

TODO: Add list of common commands here.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fill in the remaining TODOs (or remove the incomplete sections for now?)

Updated  to provide a detailed explanation of the 'Overlays' component within the Local Store, describing its purpose as a performance-optimizing cache for pending mutations.

Also updated  to consistently list 'Overlays' as a component of the  directory, aligning with the architectural overview.
Adds new documentation and updates existing documentation for Firestore
data bundles.

The new `bundles.md` file provides a deep dive into the concept of
bundles, their primary use case for SSR hydration, and other benefits.

The `architecture.md` file has been updated to include a high-level
overview of bundles and their data flow, consistent with the rest of
the document.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants