Skip to content

feat: add Svelte frontend to hello-world template#35

Merged
raymondk merged 1 commit into
mainfrom
feat/svelte-frontend
Jul 10, 2026
Merged

feat: add Svelte frontend to hello-world template#35
raymondk merged 1 commit into
mainfrom
feat/svelte-frontend

Conversation

@marc0olo

Copy link
Copy Markdown
Member

Summary

  • Adds a Svelte 5 + Vite frontend option (svelte-frontend/) to the hello-world template, alongside the existing React and Vue variants
  • Uses Svelte 5 runes syntax ($state, onsubmit), @sveltejs/vite-plugin-svelte@~6.2.4 (Vite 7 compatible), @icp-sdk/core@^6.0.0, and @icp-sdk/bindgen@^0.4.0
  • Updates cargo-generate.toml to add "svelte" to the frontend_type choices, with proper ignore rules for the other variants
  • Updates rename-dirs.rhai to rename svelte-frontendfrontend when selected
  • Updates README.md to replace the hardcoded Vite mention with the {{frontend_type}} placeholder

Design choices

Plain Svelte + Vite was chosen over SvelteKit — consistent with how React (vite-plugin-react) and Vue (vite-plugin-vue) are implemented: static single-page apps with no SSR. SvelteKit would need @sveltejs/adapter-static and adds complexity that's unnecessary for a hello-world template.

Test plan

  • cargo generate --git https://github.com/dfinity/icp-cli-templates hello-world with frontend_type=svelte produces a working project
  • icp deploy + open in browser shows the greeting form with Svelte logo
  • React and Vue variants still work (cargo-generate conditional ignore rules)

🤖 Generated with Claude Code

Adds a Svelte 5 + Vite frontend option alongside the existing React and
Vue variants. Uses Svelte 5 runes ($state), @sveltejs/vite-plugin-svelte
6.x (Vite 7 compatible), @icp-sdk/core@^6.0.0, and @icp-sdk/bindgen@^0.4.0.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@marc0olo marc0olo requested a review from a team as a code owner July 10, 2026 08:56
raymondk pushed a commit to dfinity/examples that referenced this pull request Jul 10, 2026
The svelte-motoko-starter and sveltekit-starter examples used the legacy
dfx toolchain. A modern Svelte 5 + Vite frontend has been added to the
icp-cli-templates hello-world template (dfinity/icp-cli-templates#35),
which supersedes these examples.

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
@raymondk raymondk merged commit 31e846d into main Jul 10, 2026
6 checks passed
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