martmists
06/04/2023, 9:47 AMhfhbd
06/04/2023, 10:04 AMhfhbd
06/04/2023, 10:04 AMmartmists
06/04/2023, 10:06 AMhfhbd
06/04/2023, 10:08 AMmartmists
06/04/2023, 10:37 AMOleg Yukhnevich
06/04/2023, 11:27 AMServiceLoader
like MPP approach using K/N and K/JS EagerInitialization
annotation.
for inspiration you can take a look at how I’ve handled it in https://github.com/whyoleg/cryptography-kotlin
• interface for providing implementations - https://github.com/whyoleg/cryptography-kotlin/blob/main/cryptography-core/src/commonMain/kotlin/provider/CryptographyProvider.kt
• check actual platform declaration of defaultCryptographyProvider
for more info
• JVM provider injection
• JS provider injection (super very hacky)
• Native provider injection (a little less hacky)
I was thinking about generalising it in form of compiler plugin, though never had time to do it 🙂hfhbd
06/04/2023, 11:31 AMOleg Yukhnevich
06/04/2023, 12:31 PMhfhbd
06/04/2023, 12:37 PMelect
11/06/2023, 5:44 PMOleg Yukhnevich
11/06/2023, 6:33 PMEagerInitialization
annotation), library will be still easily usable with direct invocation of providers. Or users will be able to provide explicit expect/actual for provider they needed
So, you are warned...elect
11/06/2023, 6:51 PMOleg Yukhnevich
11/06/2023, 7:01 PM