Skip to content

Upgrading to 1.0 ​

1.0 is the first release with a stable API. Before the freeze, a few names were made consistent and some classes that were public by accident were closed. Most apps compile without changes. If yours does not, one of the steps below applies.

Enum constants use one casing ​

Every enum in ktor-svelte now writes its constants like SvelteRouting.Automatic. Two enums still used capitals, so their constants are renamed:

BeforeAfter
DevMode.AUTO, DevMode.ALWAYS, DevMode.NEVERDevMode.Auto, DevMode.Always, DevMode.Never
PackageManager.AUTO, PackageManager.BUN, PackageManager.PNPM, PackageManager.NPM, PackageManager.YARNPackageManager.Auto, PackageManager.Bun, PackageManager.Pnpm, PackageManager.Npm, PackageManager.Yarn

In Application.kt:

kotlin
install(Svelte) {
    dev {
        mode = DevMode.Never
    }
}

In build.gradle.kts:

kotlin
import io.github.nijasc.ktor.svelte.gradle.PackageManager

svelte {
    packageManager = PackageManager.Pnpm
}

SvelteSecurityHeaders is removed ​

The deprecated alias SvelteSecurityHeaders is gone. Use SvelteSecurityHeadersConfig, the name it has pointed to since 0.6.1. This only matters if you named the type yourself, for example in a helper function. A securityHeaders { } block needs no change.

Configuration classes cannot be created by hand ​

SvelteConfig, SvelteCacheConfig, SvelteDevConfig, SvelteSecurityHeadersConfig, SvelteRateLimitConfig, SvelteTransportConfig and Validator no longer have a public constructor. ktor-svelte creates them and hands them to your install(Svelte) { }, cache { } or validate { } block, which is the only way they were meant to be used.

The same goes for the Gradle plugin: DaisyCustomTheme and DaisyCustomThemeBuilder are created by customTheme(...) { }, and the TailwindSpec, DaisySpec, I18nSpec and LibrarySpec values that tasks carry can be read but not built or copied. ToolVersionSource is internal now.

What 1.0 promises ​

From 1.0 on, ktor-svelte follows semantic versioning. A patch release only fixes bugs, a minor release adds features without breaking your build, and only a major release can remove or rename something. Anything in a package named internal is not part of the API.

Documentation for ktor-svelte 1.4.0. Released under the Apache 2.0 license.