github JetBrains/compose-multiplatform 0.5.0-build226-web
Compose for Web 0.5.0-build226

latest releases: v1.6.10-dev1596, v1.6.10-dev1593, v1.6.10-dev1590...
pre-release2 years ago

❗This release can break your code if you are using empty lambdas in default params❗

Some changes had been introduced to the common part of compose compiler plugin. While changes are completely correct, they turned out to affect some runtime functionality in the JS target. We apologize for this and currently working both on fix and on introducing more rigorous testing procedures.

Basically, in 0.5.0-build226 this code will break in runtimes:

@Composable
fun Something(handler: () -> Unit = {}) { ... }

The temporary workaround would be to use nullables instead:

@Composable
fun Something(handler: (() -> Unit)? = null) { ... }

Again, we apologize for this and will release fix ASAP.
The silver lining however is that this nullable approach will lead to slightly smaller JavaScript files generated.

Apart from this bug, this release does not introduce any mind-boggling API changes ;)
However. it's still worth to mention

Smarter arithmetic operations in CSS API

Starting with this release you can apply arithmetic operations to heterogenous CSS values and CSS variables - the resulting value would be a calc:

   Div({
      style { 
          top(100.px + 2.percent)   // top value will be resolved as calc(100px + 2%)
          bottom(4 * variables.pxVar.value(4.px)) // bottom value will be resolved as calc(4 * var(--pxVar, 4px))
      }
   })

This week in Compose for Web

No UI framework can be considered mature enough till someone writes a Flappy Bird using it. Well, guess what, @theapache64 just did exactly that - using a very elegant minimalistic approach - and was kind enough to allow us to add this game to our collection of web examples.

Well, that's basically it. All is left is to thank yet another time our regular contributor @hfhbd for noticing and fixing small inconsistency in our html API - #783.

PS We promise to be more productive as soon as Euro 2020 will be over..

Don't miss a new compose-multiplatform release

NewReleases is sending notifications on new releases.