Skip to content

Conversation

@ArmanNik
Copy link
Contributor

@ArmanNik ArmanNik commented Sep 12, 2023

What does this PR do?

Fix function templates runtimes

Test Plan

Manual

Related Issues

Have you read the Contributing Guidelines on issues?

Yes

@vercel
Copy link

vercel bot commented Sep 12, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
console ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 13, 2023 2:18pm
console-cloud ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 13, 2023 2:18pm
console-preview ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 13, 2023 2:18pm

@ArmanNik ArmanNik self-assigned this Sep 12, 2023
Comment on lines -109 to +113
{@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)
);
})}
Copy link
Contributor

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).

Copy link
Contributor Author

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 🤔

Copy link
Contributor

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.

@Meldiron
Copy link
Contributor

I think we can close this PR in favour of: #546

We came to conclusion we need to keep it version-aware.

@stnguyen90
Copy link
Contributor

I've split the SMTP change out of this PR and moved it over #548

@ArmanNik ArmanNik closed this Sep 14, 2023
@ArmanNik ArmanNik deleted the fix-function-templates-runtimes branch September 14, 2023 08:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants