-
Notifications
You must be signed in to change notification settings - Fork 144
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
fix: function templates runtimes #542
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
{@const runtimes = new Map(response.runtimes.map((r) => [r.$id, r]))} | ||
{@const templates = quickStart.runtimes.filter((_template) => | ||
runtimes.has(_template.name) | ||
)} | ||
{@const templates = quickStart.runtimes.filter((_template) => { | ||
return response.runtimes.some((runtime) => | ||
runtime.$id.includes(_template.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.
This looks like it reverted a previous change. We should make sure to use better data types when available to avoid doing n^2 operations (iterating over an array in an array).
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.
But now the template name is only going to include the language used not the version so has
will not work anymore 🤔
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.
Then, maybe use the language as the map key. In general, we should try to avoid doing these nested iterations.
Also, we're back to discussing whether we should ignore the runtime version.
I think we can close this PR in favour of: #546 We came to conclusion we need to keep it version-aware. |
I've split the SMTP change out of this PR and moved it over #548 |
What does this PR do?
Fix function templates runtimes
Test Plan
Manual
Related Issues
Have you read the Contributing Guidelines on issues?
Yes