Skip to content

Conversation

@jamesdaniels
Copy link
Member

@jamesdaniels jamesdaniels commented Apr 20, 2022

  • Allow source option with emulators:start, not just firebase serve
  • Move the context / config manipulation into firebase-tools
  • Bump the dep

@jamesdaniels jamesdaniels marked this pull request as ready for review May 7, 2022 07:08
@davideast davideast requested a review from inlined May 10, 2022 17:51
cmdOptions: any, // eslint-disable-line @typescript-eslint/no-explicit-any
options: { resolveTargets?: boolean } = {}
): HostingConfig[] {
// First see if there's a momoized copy on the options, from frameworks
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: memoized


export const shortSiteName = (site?: Site) => site?.name && site.name.split("/").pop();

export const prepareFrameworks = async (targetNames: string[], context: any, options: any) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Please add docs on what this function's purpose is

targetNames.unshift("functions");
options.config.set("functions", functionConfig);
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: add spaces and comments for this block of code. (L16-L77)

Reasoning -
A lot is going on here, its hard to understand the what/why of the code when its densely packed.

},
];

let firebaseProjectConfig = null;
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: let firebaseProjectConfig;

(unless null string is intentional)
(JSON.stringify(null) => 'null')

@bkendall bkendall changed the base branch from master to launch.io22 May 10, 2022 19:55
@bkendall bkendall merged commit 745e167 into launch.io22 May 10, 2022
@bkendall bkendall deleted the more_framework_work branch May 10, 2022 20:30
bkendall added a commit that referenced this pull request May 10, 2022
* Un-hide CF3v2 (#4525)

* Resolve relative paths for local extensions (#4529)

* Improve error message when parsing function source fails. (#4527)

Previously, an invalid function source would show error message like this:

```bash
$ firebase deploy --only functions

i  deploying functions
...
Error: Failed to parse backend specification:
- YAMLException incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line at line 1, column 65:
     ...  function source: ReferenceError: aa is not defined
```

This is surprising - a YAMLException? A backend specification? Often times, the full error message would curt short, and debugging the issue required the user to carefully inspect the debug log.

We improve the error message to the following:

```bash
$ firebase deploy --only functions

i  deploying functions
...
Error: Failed to load function definition from source: Failed to generate manifest from function source: ReferenceError: aa is not defined
```

We hid the YAML portion of the error and make sure to relay the full error message returned from the underlying Functions Control API (i.e. the serve responsible for loading and advertising the `functions.yaml` baked into the Functions SDK)

* Set `enableCors` debug feature when emulating CF3 functions. (#4528)

Accompanies firebase/firebase-functions#1099.

With this change, users using the supported version of the Firebase Functions SDK will be able to bypass existing/default cors settings to call the emulated HTTP/callable v2 functions.

* Removing extensions-emulator preview flag (#4484)

* Removing extensions-emulator preview flag

* fix test

* Adding changelog entry

* formats

* Pin to emulator UI v1.7.0

* Fix outdated package.json templates (#4531)

* Remove firebase-functions-test dependency

* Bump all the dependencies

* Inlined.cpu fixes (#4530)

* Add extra validation for CPU x memory constraints

* Force default memory to avoid MB -> MiB bugs

* Unbreak unit tests

* Adding CHANGELOG entry for cf3v2 (#4537)

* Adding CHANGELOG entry for cf3v2

* gen 2

* More firebase-frameworks work (#4463)

* Work with emulators:start

* Add dev mode flag

* Dev flag not actually needed

* Move entry into firebase-tools

* Cleanup

* Bump dep

* fix missing import

Co-authored-by: Bryan Kendall <bkend@google.com>

Co-authored-by: Thomas Bouldin <inlined@users.noreply.github.com>
Co-authored-by: joehan <joehanley@google.com>
Co-authored-by: Daniel Lee <danielylee@google.com>
Co-authored-by: James Daniels <jamesdaniels@google.com>
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