Skip to content

Loading data bundles in the client outdated docs #7755

@marcusx2

Description

@marcusx2

Operating System

macOS

Browser Version

Safari 16.5.2

Firebase SDK Version

10.5.0

Firebase SDK Product:

Firestore

Describe your project's tooling

index.html with source tag. Just javascript.

Describe the problem

The documentation regarding loading data bundles in the client is outdated. The code doesn't work, probably because it refers to the firebase v8 SDK.

Steps and code to reproduce issue

Here's an up-to-date version

const resp = await fetch('./bundle.txt');//assuming the bundle is in the same folder
await loadBundle(db, resp.body);
const query = await namedQuery(db, 'latest-stories-query');
const querySnapshot = await getDocs(query);
querySnapshot.forEach(doc => console.log(doc.id, " => ", doc.data()));

There is also no equivalent to the line const storiesSnap = await query.get({ source: 'cache' });, how would this be adapted to v9?

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions