0x80 / firebase-tools-with-isolate

The Firebase CLI with isolate-package integrated to support monorepos
MIT License
24 stars 0 forks source link

Support deploying 1st and 2nd gen functions together #7

Closed 0x80 closed 7 months ago

0x80 commented 7 months ago

When 1st and 2nd functions are deployed at the same time, the tools call prepare for upload twice, triggering the isolation process twice. This seems to lead to issues.

if (backend.someEndpoint(wantBackend, (e) => e.platform === "gcfv2")) {
      const packagedSource = await prepareFunctionsUpload(sourceDir, config);
      source.functionsSourceV2 = packagedSource?.pathToSource;
      source.functionsSourceV2Hash = packagedSource?.hash;
    }
    if (backend.someEndpoint(wantBackend, (e) => e.platform === "gcfv1")) {
      const packagedSource = await prepareFunctionsUpload(sourceDir, config, runtimeConfig);
      source.functionsSourceV1 = packagedSource?.pathToSource;
      source.functionsSourceV1Hash = packagedSource?.hash;
    }
0x80 commented 7 months ago

Looking at the code this doesn't seem to be an issue after all, as the two isolation => pack processes happen in series.