Upgrading to 0.10
0.10 adds features that change a few responses and the dev loop. Most apps need no changes.
publicConfig is inlined into pages
When you set publicConfig, every page from your build now contains it as <script type="application/json" id="ktor-svelte-config">, and pages get their own ETag. The generated loadPublicConfig() reads it from there before asking the server.
You are affected only if a test compares page bodies byte for byte, or a cache in front of the app keys on the build hash. Set inlinePublicConfig = false to keep pages unchanged. See Runtime config.
Build header on API responses
API responses now carry X-Ktor-Svelte-Build with a short fingerprint of the frontend build, so the generated client can tell when a new version is deployed. Set buildHeader = false to leave it out.
svelteDevAll opens the browser
svelteDevAll opens the app in your default browser once, when it is first ready. It never does in CI or without a display. Turn it off in build.gradle.kts:
svelte {
dev {
openBrowser = false
}
}Paths under /_ktor-svelte/
Unknown paths under /_ktor-svelte/ now answer 404 instead of the SPA fallback, because ktor-svelte reserves them for its own endpoints. If your SvelteKit app has a route there, move it.
Regenerate the client
The generated client gained timeouts, latest(), onNewBuild, JSDoc from route descriptions and companions for sealed class unions. Start the app once in development, or run ./gradlew svelteGenerateTs, and commit the updated files under src/lib/api.