feat: add Svelte frontend to hello-world template#35
Merged
Conversation
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>
2 tasks
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
approved these changes
Jul 10, 2026
raymondk
approved these changes
Jul 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
svelte-frontend/) to thehello-worldtemplate, alongside the existing React and Vue variants$state,onsubmit),@sveltejs/vite-plugin-svelte@~6.2.4(Vite 7 compatible),@icp-sdk/core@^6.0.0, and@icp-sdk/bindgen@^0.4.0cargo-generate.tomlto add"svelte"to thefrontend_typechoices, with proper ignore rules for the other variantsrename-dirs.rhaito renamesvelte-frontend→frontendwhen selectedREADME.mdto replace the hardcodedVitemention with the{{frontend_type}}placeholderDesign 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-staticand adds complexity that's unnecessary for a hello-world template.Test plan
cargo generate --git https://github.com/dfinity/icp-cli-templates hello-worldwithfrontend_type=svelteproduces a working projecticp deploy+ open in browser shows the greeting form with Svelte logo🤖 Generated with Claude Code