-
Notifications
You must be signed in to change notification settings - Fork 78
fix: handle empty cases in edge bundling #6659
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…ies/manifests do not exist
This pull request adds or modifies JavaScript ( |
return await pathExists(frameworkFunctionsSrc) | ||
} | ||
|
||
const logFunctions = async ({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
content of this function was just inlined in step function directly to get easy access to found edge functions to be able to bail early if there are no functions at all
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
I think there's also the case where function directories do exist but there are no registered routes. For us to bail there, I guess we'd need to do it in edge-bundler?
Isn't what this PR does now that even if source dirs exist, but contain no functions we would not be generating edge bundles? There are added test fixtures and tests for that. If added test cases don't contain a case you thinking of here - can you describe a setup to test?
Bailing in edge-bundler was initial attempt in #6657, but as mentioned by Phil in #6657 (comment) because there is no early bail like that in edge-bundler now, adding one would be a breaking change (which is not a blocker, but requires more work from all consumers of the package and because we could come up with alternative for scenarios we were thinking of without breaking change - I went with that) |
🎉 Thanks for submitting a pull request! 🎉
Summary
Potential alternative to #6657 , this time following handling we already have for serverless functions for early bail if there are no functions to bundle
build/packages/build/src/plugins_core/functions/index.ts
Lines 173 to 193 in 70dcaf8
For us to review and ship your PR efficiently, please perform the following steps:
we can discuss the changes and get feedback from everyone that should be involved. If you`re fixing a typo or
something that`s on fire 🔥 (e.g. incident related), you can skip this step.
your code follows our style guide and passes our tests.
A picture of a cute animal (not mandatory, but encouraged)