-
Notifications
You must be signed in to change notification settings - Fork 204
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
### Breaking Changes - Deprecated `allowInvalidAppCheckToken` option. Instead use`enforceAppCheck`. - App Check enforcement on callable functions is disabled by default in v4. - Requests containing invalid App Check tokens won't be denied unless you - explicitly enable App Check enforcement using the new `enforceAppCheck` option. - Furthermore, when enforcement is enabled, callable functions will deny - all requests without App Check tokens. - Dropped support for Node.js versions 8, 10, and 12. - Dropped support for Admin SDK versions 8 and 9. - Removed the `functions.handler` namespace. - `DataSnapshot` passed to the Firebase Realtime Database trigger now matches the `DataSnapshot` returned by the Admin SDK, with null values removed. - Removed `__trigger` object on function handlers. - Reorganized source code location. This affects only apps that directly import files instead of using the recommend entry points specified in the - Reworked the `apps` library and removed `lodash` as a runtime dependency. - Unspecified function configuration value will be reset to platform default. Use `preserveExternalChanges` to prevent this behavior. ### Enhancements - Logs created with the `functions.logger` package in v2 functions are now annotated with each request's trace ID, making it easy to correlate log entries with the incoming request. Trace IDs are especially useful for cases where 2nd gen's concurrency feature permits a function to handle multiple requests at any given time. See [Correlate log entries](https://cloud.google.com/logging/docs/view/correlate-logs) to learn more. - `functions.logger.error` now always outputs an error object and is included in Google Cloud Error Reporting. - The logging severity of Auth/App Check token validation has changed from `info` to `debug` level. - Event parameters for 2nd generation functions are now strongly typed, permitting stronger TypeScript types for matched parameters. - Add new params package to support parameterized environment configuration. See https://firebase.google.com/docs/functions/config-env for more information. - Add new `functions.RESET_VALUE` and `functions.v2.options.RESET_VALUE` sentinel value for explicitly resetting function configuration to platform default. - Add new `preserveExternalChanges` option to prevent Firebase CLI from resetting unspecified configuration option to platform default
- Loading branch information
Showing
176 changed files
with
13,348 additions
and
12,229 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
lib | ||
dev | ||
node_modules | ||
/coverage/ | ||
/docgen/ | ||
/v1/ | ||
/v2/ | ||
/logger/ | ||
/dist/ | ||
/spec/fixtures | ||
/scripts/**/*.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
module.exports = { | ||
env: { | ||
es6: true, | ||
node: true, | ||
}, | ||
extends: [ | ||
"eslint:recommended", | ||
"plugin:@typescript-eslint/recommended", | ||
"plugin:@typescript-eslint/recommended-requiring-type-checking", | ||
"plugin:jsdoc/recommended", | ||
"google", | ||
"prettier", | ||
], | ||
rules: { | ||
"jsdoc/newline-after-description": "off", | ||
"jsdoc/require-jsdoc": ["warn", { publicOnly: true }], | ||
"no-restricted-globals": ["error", "name", "length"], | ||
"prefer-arrow-callback": "error", | ||
"prettier/prettier": "error", | ||
"require-atomic-updates": "off", // This rule is so noisy and isn't useful: https://github.com/eslint/eslint/issues/11899 | ||
"require-jsdoc": "off", // This rule is deprecated and superseded by jsdoc/require-jsdoc. | ||
"valid-jsdoc": "off", // This is deprecated but included in recommended configs. | ||
|
||
"no-prototype-builtins": "warn", | ||
"no-useless-escape": "warn", | ||
"prefer-promise-reject-errors": "warn", | ||
}, | ||
overrides: [ | ||
{ | ||
files: ["*.ts"], | ||
rules: { | ||
"jsdoc/require-param-type": "off", | ||
"jsdoc/require-returns-type": "off", | ||
|
||
// Google style guide allows us to omit trivial parameters and returns | ||
"jsdoc/require-param": "off", | ||
"jsdoc/require-returns": "off", | ||
|
||
"@typescript-eslint/no-invalid-this": "error", | ||
"@typescript-eslint/no-unused-vars": "error", // Unused vars should not exist. | ||
"@typescript-eslint/no-misused-promises": "warn", // rule does not work with async handlers for express. | ||
"no-invalid-this": "off", // Turned off in favor of @typescript-eslint/no-invalid-this. | ||
"no-unused-vars": "off", // Off in favor of @typescript-eslint/no-unused-vars. | ||
eqeqeq: ["error", "always", { null: "ignore" }], | ||
camelcase: ["error", { properties: "never" }], // snake_case allowed in properties iif to satisfy an external contract / style | ||
|
||
// Ideally, all these warning should be error - let's fix them in the future. | ||
"@typescript-eslint/no-unsafe-argument": "warn", | ||
"@typescript-eslint/no-unsafe-assignment": "warn", | ||
"@typescript-eslint/no-unsafe-call": "warn", | ||
"@typescript-eslint/no-unsafe-member-access": "warn", | ||
"@typescript-eslint/no-unsafe-return": "warn", | ||
"@typescript-eslint/restrict-template-expressions": "warn", | ||
}, | ||
}, | ||
{ | ||
files: ["*.spec.*"], | ||
env: { | ||
mocha: true, | ||
}, | ||
rules: {}, | ||
}, | ||
], | ||
globals: {}, | ||
parserOptions: { | ||
project: "tsconfig.json", | ||
}, | ||
plugins: ["prettier", "@typescript-eslint", "jsdoc"], | ||
parser: "@typescript-eslint/parser", | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
lib | ||
package.json | ||
spec/fixtures/credential/unparsable.key.json | ||
/node_modules | ||
/lib/**/* | ||
/CONTRIBUTING.md | ||
/docgen |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module.exports = { | ||
printWidth: 100, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
### Breaking Changes | ||
|
||
- Deprecated `allowInvalidAppCheckToken` option. Instead use | ||
`enforceAppCheck`. | ||
|
||
> App Check enforcement on callable functions is disabled by default in v4. | ||
> Requests containing invalid App Check tokens won't be denied unless you | ||
> explicitly enable App Check enforcement using the new `enforceAppCheck` option. | ||
> Furthermore, when enforcement is enabled, callable functions will deny | ||
> all requests without App Check tokens. | ||
- Dropped support for Node.js versions 8, 10, and 12. | ||
- Dropped support for Admin SDK versions 8 and 9. | ||
- Removed the `functions.handler` namespace. | ||
- `DataSnapshot` passed to the Firebase Realtime Database trigger now | ||
matches the `DataSnapshot` returned by the Admin SDK, with null values | ||
removed. | ||
- Removed `__trigger` object on function handlers. | ||
- Reorganized source code location. This affects only apps that directly import files instead of using the recommend entry points specified in the | ||
- Reworked the `apps` library and removed `lodash` as a runtime dependency. | ||
|
||
### Enhancements | ||
|
||
- Logs created with the `functions.logger` package in v2 functions | ||
are now annotated with each request's trace ID, making it easy to correlate | ||
log entries with the incoming request. Trace IDs are especially useful for | ||
cases where 2nd gen's concurrency feature permits a function | ||
to handle multiple requests at any given time. See | ||
[Correlate log entries](https://cloud.google.com/logging/docs/view/correlate-logs) to learn more. | ||
- `functions.logger.error` now always outputs an error object and is included in Google Cloud Error Reporting. | ||
- The logging severity of Auth/App Check token validation has changed from `info` to `debug` level. | ||
- Event parameters for 2nd generation functions are now strongly typed, permitting stronger TypeScript types for matched parameters. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.