Migration from 8.x to 9.x
KVision 9.0.0 is a major upgrade with changes affecting both functionalities and application structure. The goal of this release is to simplify the maintenance of the framework and allow me to continue supporting it. This required sacrificing several modules that, to my knowledge, were not widely (or even at all) used. At the same time, the KVision architecture was modernized, allowing for fixing issues and adding support for new features.
This is the list of incompatibilities you may encounter when migrating your application to KVision 9.0.0.
General changes
The
kvision-electron
,kvision-cordova
andkvision-onsenui
modules were removed. If you use any of these modules, migration to KVision 9.x is not possible. Please let me know if this is your case.All code has been migrated to ES modules and
es2015
target. As a result therequire
function, used for importing resources and integrating NPM libraries, is no longer available. Use@JsModule
annotation instead. For instance, if you use this code to import CSS and JSON files:
you should now use this:
You need to move the resources processed by webpack (e.g. css files, images, po files or hbs templates) to the src/jsMain/resources/modules
directory and use /kotlin/modules
prefix, when importing them.
Replace
src/jsMain/resources/i18n/messages.pot
withsrc/jsMain/resources/modules/i18n/messages.pot
in the.gettext.json
file, if you have it in your project.Move the content of the
src/jsMain/web
directory tosrc/jsMain/resources
. Theweb
directory is no longer used.Add
kotlin.js.ir.output.granularity=per-file
property to yourgradle.properties
file.When using
kvision-pace
module with the default theme, you need to provide a parameter toPace.init()
call. Use the code like this:
Remove these two lines from
webpack.config.d/webpack.js
file:
Fullstack changes
KVision still provides kvision-common-remote
module, which supports date and time types declared in io.kvision.types
package, so you don't have to change your application logic.
To migrate your application:
Add versions of KSP and Kilua RPC to your gradle.properties file:
Add two Gradle plugins to your project:
Remove
kvision-server-*
dependency from your common source set and add new dependencies on Kilua RPC (useimplementation()
instead ofapi()
):
Kilua RPC doesn't support Guice, so if you are using it in your app, you should migrate to Koin or use manual bindings without any dependency injection, like this:
Replace annotations in your common code:
io.kvision.annotations.KVService
todev.kilua.rpc.annotations.RpcService
io.kvision.annotations.KVBinding
todev.kilua.rpc.annotations.RpcBinding
io.kvision.annotations.KVBindingMethod
todev.kilua.rpc.annotations.RpcBindingMethod
io.kvision.annotations.KVBindingRoute
todev.kilua.rpc.annotations.RpcBindingRoute
io.kvision.annotations.KVServiceException
todev.kilua.rpc.annotations.RpcServiceException
Replace types:
io.kvision.types.Decimal
todev.kilua.rpc.types.Decimal
io.kvision.remote.RemoteOption
todev.kilua.rpc.RemoteOption
io.kvision.remote.SimpleRemoteOption
todev.kilua.rpc.SimpleRemoteOption
io.kvision.remote.RemoteData
todev.kilua.rpc.RemoteData
io.kvision.remote.RemoteFilter
todev.kilua.rpc.RemoteFilter
io.kvision.remote.RemoteSorter
todev.kilua.rpc.RemoteSorter
io.kvision.remote.RemoteSerialization
todev.kilua.rpc.RpcSerialization
io.kvision.remote.ServiceException
todev.kilua.rpc.ServiceException
io.kvision.remote.SecurityException
todev.kilua.rpc.SecurityException
io.kvision.remote.ContentTypeException
todev.kilua.rpc.ContentTypeException
io.kvision.remote.KVServiceManager
todev.kilua.rpc.RpcServiceManager
Your service class in JVM sources set should no longer be
actual
. Removeactual
keyword and@Suppress("ACTUAL_WITHOUT_EXPECT")
annotation if you use it.Replace functions:
io.kvision.remote.getServiceManager
todev.kilua.rpc.getServiceManager
io.kvision.remote.getAllServiceManagers
todev.kilua.rpc.getAllServiceManagers
io.kvision.remote.serviceMatchers
todev.kilua.rpc.serviceMatchers
io.kvision.remote.getService
todev.kilua.rpc.getService
Replace
kv_remote_url_prefix
configuration option withrpc_url_prefix
.Add
registerRemoteTypes()
call to yourmain()
functions in bothjs
andjvm
sources set.The production version of the application is now assembled with
jarWithJs
Gradle task.
Spring Boot
Last updated