-
Notifications
You must be signed in to change notification settings - Fork 970
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Node JS code is now behind /deploy/functions/runtimes/node. The rest of the codebase now only interacts with the runtime through a RuntimeDelegate interface exposed in /deploy/functions/runtimes. All Runtime specific code from backend.ts (and functions API code + pacakge.json parser) has been deduplicated in runtimes/index.ts The following files/functions have been renamed: checkFirebaseSDKVersions.ts -> deploy/functions/runtimes/node/versioning.ts deploy/functions/discovery/jsexports/* -> deploy/functions/runtimes/node deploy/functions/checkRuntimeDependencies.ts -> deploy/functions/ensureCloudBuildEnabled.ts deploy/functions/validate.ts -> deploy/functions/runtimes/node/validate.ts (Node methods only) Some code has been refactored to be more coehsive or to remove redundancies: 1. Multiple places loaded the current firebase-functions SDK. This is now called by the RuntimeDelegate and passed where it is needed 2. Context no longer needs anything to do with runtimes. All Runtime-dependent code is handled in prepare 3. prepareFunctionsUplaod did a _lot_ more than just pacakaging source. It was previously getting the backend (and storing it in context so it could be reused), getting env vars, getting runtime config, etc. It now just uploads source and everything else is in prepare direclty. 4. The min-SDK version check has been moved from getRuntimeChoice() to a versioning.ts:checkFunctionsSDKVersion, which always did other checks. This saved an exec to npm. Some small fixes/improvements along the way: 1. The log line we print when a runtime is not specified now tells customers to use the latest nodejs runtime 2. We warn customers of breaking changes for any breaking change, not just 0.x to 1.x.
- Loading branch information
Showing
29 changed files
with
632 additions
and
556 deletions.
There are no files selected for viewing
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
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 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
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.