Repository navigation
Fix bug where CLI was unable to deploy Firebase Functions in some monorepo setups - #5391
Merged
Merged
Conversation
taeold
marked this pull request as ready for review
January 4, 2023 17:29
Codecov ReportBase: 56.32% // Head: 56.32% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## master #5391 +/- ##
==========================================
- Coverage 56.32% 56.32% -0.01%
==========================================
Files 315 315
Lines 21296 21298 +2
Branches 4342 4342
==========================================
Hits 11996 11996
- Misses 8261 8263 +2
Partials 1039 1039
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
taeold
enabled auto-merge (squash)
January 5, 2023 22:07
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Partially fixes #4952.
#5215 made changes to the CLI to detect Functions SDK even in monorepo setups where Functions SDK is hoisted (i.e. Functions SDK dependency is declared in the parent directory but not in the sub-package directory).
We should've made corresponding change in how the Functions SDK binary is executed - instead of always looking up the sub-package's
node_modules, we should be looking at thenode_modulesclosest to where the Functions SDK dependency is declared.This setup seems common in scenarios where the developer bundles the functions source using bundlers like vite/webpack/etc. This kind of technique has shown to help AWS lambda's cold start time, and I think it's something we'd want to explore in Google Cloud Functions too.