Skip to content

Add Rust function runtime template support#3019

Merged
ChiragAgg5k merged 1 commit intomainfrom
feat-rust-runtime-template
May 4, 2026
Merged

Add Rust function runtime template support#3019
ChiragAgg5k merged 1 commit intomainfrom
feat-rust-runtime-template

Conversation

@ChiragAgg5k
Copy link
Copy Markdown
Member

@ChiragAgg5k ChiragAgg5k commented May 3, 2026

What does this PR do?

Adds support for the new Rust function runtime template in function creation flows.

  • Updates the SDK dependency to the commit that includes the Rust runtime enum.
  • Shows Rust in the starter quick-start runtime list when the API exposes rust-1.83.
  • Selects and validates template/deploy runtimes from API-provided runtimes instead of guessing from enum string prefixes.
  • Adds Rust runtime icons for light/dark color and grayscale themes.
  • Applies the same safer runtime fallback behavior to public function deploy links.

Test Plan

  • bun run format
  • bun run check
  • bun run lint
  • bun run build
  • Local Appwrite endpoints return rust-1.83 in /v1/functions/runtimes and starter template runtimes after enabling _APP_FUNCTIONS_RUNTIMES=node-22,rust-1.83.
  • Playwright walkthrough against local Appwrite — see screenshots below.

Screenshots

1. Quick start — Rust card in runtime list

The starter quick-start now lists Rust alongside Node.js when the API exposes rust-1.83, with the new color icon.

Quick start with Rust card

2. template-starter?runtime=rust-1.83 — runtime preselected

Navigating to the starter template with runtime=rust-1.83 resolves the runtime via the API list and preselects Rust - 1.83 (form field and right-hand summary).

Template starter with Rust 1.83 preselected

3. Manual create — runtime dropdown shows Rust

Manual function create exposes Rust - 1.83 in the runtime dropdown, sourced from the API runtimes list.

Manual create runtime dropdown

4. Public /functions/deploy — Rust runtime preselected

The public deploy link resolves runtime=rust-1.83 against API-provided runtimes (no more enum prefix guessing) and preselects Rust - 1.83.

Public deploy with Rust runtime

Related Issue

#XXXX

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 3, 2026

Greptile Summary

This PR adds Rust (rust-1.83) function runtime support by updating the SDK dependency, adding four Rust SVG icon variants, migrating template-[template]/+page.svelte to Svelte 5 runes, and switching runtime resolution across all creation flows to validate against the API-provided runtime list instead of guessing from enum string prefixes. The logic changes are well-reasoned and the safer fallback behaviour in the public deploy flow is a solid improvement.

Confidence Score: 5/5

Safe to merge — no P0 or P1 issues; only P2 style/migration observations.

All identified issues are P2: the $state(writable(...)) mix is non-breaking, and the connectBehaviour effect behaviour matches the previous Svelte 4 version. Core runtime resolution and icon lookup logic is correct and tested per the PR description.

template-[template]/+page.svelte for the isSubmitting runes/store mix and the connectBehaviour effect.

Important Files Changed

Filename Overview
src/lib/stores/runtimes.ts Made runtime parameter optional, added early-return guard, and added 6 new runtime icon mappings (dotnet, java, swift, kotlin, cpp, rust). Correct switch(true) logic.
src/routes/(console)/project-[region]-[project]/functions/create-function/+page.svelte Replaces prefix-split deduplication with runtime.key-based Map, filters starter cards from API runtimes, removes .slice(0,6) cap. Correct, but key-based last-write-wins and removed grid cap were flagged in prior review.
src/routes/(console)/project-[region]-[project]/functions/create-function/template-[template]/+page.svelte Partially migrated to Svelte 5 runes; new selectInitialRuntime() validates runtimes against API list. isSubmitting = $state(writable(false)) is an unusual runes+store mix but not broken.
src/routes/(public)/functions/deploy/+page.ts Runtimes API call moved before deployment data construction, adds redirect guard when no runtimes are available, and validates URL runtime param against API list instead of hardcoding node-18.0.
src/routes/(console)/project-[region]-[project]/functions/create-function/deploy/+page.svelte Icon lookup switched from r.$id to r.key, fallback changed from hardcoded node-18.0 to first API-provided runtime. Cleaner and correct.
src/routes/(console)/project-[region]-[project]/functions/create-function/manual/+page.svelte Added ?? 'empty' fallback for unknown icon names. Minimal, correct change.
src/routes/(console)/project-[region]-[project]/functions/create-function/repository-[repository]/+page.svelte Added ?? 'empty' fallback for unknown icon names. Minimal, correct change.
static/icons/dark/color/rust.svg New Rust SVG icon (brand color #CE422B). Dark and light color variants are byte-for-byte identical, which is intentional for a strong brand color.

Reviews (2): Last reviewed commit: "feat: add rust function runtime template..." | Re-trigger Greptile

Comment thread src/routes/(public)/functions/deploy/+page.ts Outdated
@ChiragAgg5k ChiragAgg5k force-pushed the feat-rust-runtime-template branch from 9e74ea2 to 9925205 Compare May 3, 2026 14:49
@ChiragAgg5k ChiragAgg5k force-pushed the feat-rust-runtime-template branch from 9925205 to 9791d31 Compare May 3, 2026 14:52
@ChiragAgg5k ChiragAgg5k merged commit c0d37e1 into main May 4, 2026
4 checks passed
@ChiragAgg5k ChiragAgg5k deleted the feat-rust-runtime-template branch May 4, 2026 04:15
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.

2 participants