FEEDBACK NEEDED Folks, 2.0 is around the corner, ...
# ktor
h
FEEDBACK NEEDED Folks, 2.0 is around the corner, and we are polishing up the last of our work on the new version. As you may be aware, we’re going to introduce a new API for writing custom plugins that is fluent and easy to use (you can read more about here https://ktor.io/docs/eap/custom-plugins.html) We’ve made a new plugin API to extend the existing one with the same types.
Copy code
val DataTransformationPlugin = createApplicationPlugin(name = "DataTransformationPlugin", ::Config) {
    // ...
}
It turns out that if the library mode is enabled, it becomes a bit more complicated to read because of the type:
Copy code
public val DataTransformationPlugin: ApplicationPlugin<Application, Config, PluginInstance> = createApplicationPlugin(name = "DataTransformationPlugin", ::Config) {
}
where Application and PluginInstance are fixed. We’re thinking about several options on how we can solve this: First option Drop obsolete generic parameters from
ApplicationPlugin
and keep it as
ApplicationPlugin<Config>
We need to introduce
_NAME_ApplicationPlugin<Application, Config, PluginInstance>
replacement for existing plugins, so it will be a breaking change.
Copy code
public val DataTransformationPlugin: ApplicationPlugin<Config> = createApplicationPlugin(name = "DataTransformationPlugin", ::Config) {    // ...
}
Second Option Introduce typealias
_NAME_<Config>
and keep
ApplicationPlugin
as it is.
Copy code
public val DataTransformationPlugin: NAME<Config> = createApplicationPlugin(name = "DataTransformationPlugin", ::Config) {
    // ...
}
Third Option Keep
ApplicationPlugin<Application, Config, Instance>
as it is. The problem with introducing NAME is precisely what we could call something that actually already has a name, i.e. ApplicationPlugin. Anything along the lines of “Default”, “Simple” or similar incorrectly could lead to the wrong assumptions. What are your thoughts on this?
👏 1
🎉 3
1️⃣ 5
🚀 3
👍 2
b
Seeing as 2.0 already introduces some breaking changes, I'd prefer option one and have it clean moving forward. I'm confident the community will upgrade third party plugins pretty quickly.
29
s
💯 Agreed, it also doesn’t like such a big breaking change that it becomes an enormous hassle to migrate IMO.
h
Thanks all for feedback.