0

I am currently trying to build the pipeline for serving a bundle of data in my project and I can't make it work even by reading the step by step documentation that firebase gives us.

I have followed the documentation and was able to create a bundle through this documentation: https://firebase.google.com/docs/extensions/official/firestore-bundle-builder

But when I get to the documentation on building and serving the bundle, things start to falling apart since I cannot find complete resources explaining how to implement it

So that is how I implemented it:

{
  "functions": [
    {
      something
      "ignore": [
       something
      ],
      something
      ]
    }
  ],
  "hosting": {
    "ignore": [
      "firebase.json",
      "**/.*",
      "**/node_modules/**"
    ],
    "rewrites": [
      {
        "source": "/bundles/*",
        "function": "ext-firestore-bundle-builder-serve"
      }
    ]
  }
}

Is it in the right level or not ? No idea... but that's what I did and I deployed it successfully.

Now, in the client integration part:

import { loadBundle } from "firebase/firestore";

// Download the bundle from the Firebase Hosting CDN:
const bundle = await fetch("/bundles/:bundleId");

// If not using a CDN, download the bundle directly:
// const bundle = await fetch('https://<location>-<project-id>.cloudfunctions.net/ext-firestore-bundle-builder-serve/:bundleId');

await loadBundle(bundle);

I do not know again how to implement it since the import give me an error, and every functions too.

I'd appreciate your help. I am not new with firebase and I am not that bad at finding the documentation in order to understand but I don't know if the SEO is not good or the documentation not complete and will be completed but I failed to find it..

Thanks for your time

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807

0 Answers0