-
Notifications
You must be signed in to change notification settings - Fork 393
fix: use Edge Bundler to merge edge function declarations #5551
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
📊 Benchmark resultsComparing with b4d888b Package size: 270 MB⬆️ 2.62% increase vs. b4d888b
Legend
|
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.
Some questions, but otherwise LGTM
this.declarationsFromSource = functions.reduce( | ||
(acc, func, index) => ({ ...acc, [func.name]: functionsConfig[index] }), | ||
{}, | ||
) |
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.
I see why we changed this because edge-bundler expects it that way. It is surprising that this does not follow the Declaration
type that toml and deploy config declarations have.
Would you happen to know why that is? Are we trying to avoid duplicates with this?
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.
Good question, I'm not sure. I guess we could change it so that it follows the Declaration
type, but I'd rather do that in a separate PR.
return this.declarationsFromConfig?.find((declaration) => declaration.function === func)?.name | ||
const declarations = [...this.declarationsFromTOML, ...this.declarationsFromDeployConfig] | ||
|
||
return declarations.find((declaration) => declaration.function === func)?.name |
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.
We do not support the displayName
in the ISC?
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.
CI is failing because we'll need netlify/edge-bundler#337. 😢 |
Summary
CLI had its own logic for merging edge function declarations coming from different sources (i.e.
netlify.toml
, in-source declarations, and deploy configuration API). This PR replaces that with the logic exported by@netlify/edge-bundler
.Using the same logic in both places ensures that the local development and production environments behave the same way.
It also moves the definition of the bootstrap URL out of Edge Bundler and into the CLI.
This PR needs netlify/edge-bundler#334 to be merged and released — I'll leave it as a draft until that happens.
Closes netlify/edge-functions-examples#42 and https://github.com/netlify/pod-compute/issues/429.
Supersedes #5561.