Releases: JetBrains/compose-multiplatform
1.0.0-alpha4-build310
v1.0.0-alpha4-build310 Document packaging resources (#1015)
1.0.0-alpha3
Fix compose web examples source code links (#1006) * Fix web landing link * Fix falling balls source code link
1.0.0-alpha2
Common
- Desktop, Web, and Android artifacts publish at the same time with the same version
Desktop
Features
- Context menu support in selectable text
- Cursor change behavior in text and pointer icon API
- Mouse Clickable modifier
- Tab navigation between text fields by default
- Resource packing to native distribution
- Support @Preview annotation in desktopMain sourceSet's (when the Compose MPP plugin is installed in IDEA)
- New features for Composable menu (icons, shortcuts, mnemonics, radiob buttons, checkboxes
- Adaptive window size
- Support Linux on ARM64
- Support hidpi on some Linux distros
- Support resizing of undecorated resizable windows (Window(undecorated=true, resizable=true, ...))
API changes
- new Window API is no longer experimental
- old Window API is deprecated
- classes from
android.compose.desktop.*
moved toandroidx.compose.ui.awt.*
(ComposeWindow, ComposePanel, etc) svgResource
/vectorXmlResource
/imageResource
replaced by painterResource
API breaking changes:
- Window level keyboard API for the old Window API removed
- Window(icon: BufferedImage) replaced by Window(icon: Painter)
- ContextMenu renamed to CursorDropdownMenu
Web
API changes
- classes behave cumulatively
- removed content builder for empty elements
- Introduce CSS arithmetic operations
- Improved the types of Inputs and input events
- All event types expose native properties
- Added a complete list of HTML color aliases
- Introduce support for CSS Grid API
- Deprecate Color.RGB, Color.HSL etc. functions in favor of top-level rgb, hsl an so on
- negate CSSNumeric value directly
API breaking changes
- boolean like attributes don't have any parameters anymore
- removed input type specific event listeners
- replaced maxWidth/minWidth media queries with prefixed names
- Remove CSSVariables context and introduce specialized methods for adding String- and Number-valued CSS variables
- inline style builder was moved into AttributeBuilder scope
1.0.0-alpha1
v1.0.0-alpha1 Templates. Fix MPP template
1.0.0-alpha1-rc5
Updated imageviewer example to use CoroutineScope (loading and proces… …sing images).
1.0.0-alpha1-rc4
Templates. Use currentOs in common MPP module Temporary (?) workaround for Preview
1.0.0-alpha1-rc3
v1.0.0-alpha1-rc3 Update Compose
1.0.0-alpha1-rc2
Templates. Update versions Revert to 6.9 as 7.1.1 doesn't properly work with com.android.tools.build:gradle:4.0.1 com.android.tools.build:gradle:7.0.0 doesn't supported by IDEA yet
1.0.0-alpha1-rc1
v1.0.0-alpha1-rc1 Add google()
0.5.0-build270
Desktop
Changes
- new Window API is no longer experimental
- old Window API is deprecated
- classes from android.compose.desktop.* moved to androidx.compose.ui.awt.* (ComposeWindow, ComposePanel, etc)
svgResource
/vectorXmlResource
/imageResource
replaced bypainterResource
Breaking changes
- Window level keyboard API for the old Window API removed
Window(icon: BufferedImage)
replaced byWindow(icon: Painter)
ContextMenu
renamed toCursorDropdownMenu
Web
Declare CSS Variables in wherever you want
We removed CSSVariables completely, so that one can declare CSS variables directly (we recommend to do it in Stylesheets)
Changes in CSS Color API
Any CSS API method that works with color does not accept strings as
arguments. Instead color("white")
use color(Color.white)
. Instead
of color("#cefcef")
write color(Color("#cefcef"))
.
This might seem like an overkill and too verbose for a frontend
development, but in fact, we are going to deprecate any String signature in CSS API in
favour of specialized "enums" (not necessarily technically enums, but
you got it) and helper builder/functions - and we want color-related
subset to be consistent with the rest of API. It seems to us (at least now)
that benefits of such approach overweight the verbosity concerns.
However one can alays use "raw" syntax for setting any property and
assigning arbitrary String value.
We also deprecated Color.RGBA
, Color.RBG
, Color.HSL
, Color.HSLA
in
favour of their less verbose counterparts, namely, rgba
, rgb
, hsl
,
hsla
. Please, move to them (IDE makes it possible to perform such refactoring
automatically), since we are going to remove this functions somewhere in
August.
Use mediaMaxWidth, mediaMinWidth, mediaMaxHeight, mediaMinHeight
maxWidth/Height, minWidth/Height in mediaQueries renamed to mediaMaxWidth/Height, mediaMinWidth/Height so they won't clash with "regular" maxWidth, minWidth etc. CSS API properties.
New Input functions
We have introduced a number of additional functions for creating inputs of different types:
TextInput(value = "text", attrs = {
onInput { } // all these components have attrs same as HTMLInputElement
})
CheckboxInput(checked = false)
RadioInput(checked = false)
NumberInput(value = 0, min = 0, max = 10)
DateInput(value = "2021-10-10")
TelInput(value = "0123456")
EmailInput()
// and other input types
Unified onInput and onChange event listeners
In the previous versions it was important to carefully choose a proper input or change listener, so it matches the type of the input.
In the new version, onInput
and onChange
can be used regardless of the input type and the value of the input will have a proper type. Here is an example:
Input(type = InputType.Text, attrs = {
onInput { event ->
val inputValue: String = event.value
}
})
Input(type = InputType.Checkbox, attrs = {
onInput { event ->
val isChecked: Boolean = event.value
}
})
New SyntheticEvent exposes native event properties
That means there is no need to access nativeEvent
or eventTarget
.
Here is an example with SyntheticMouseEvent and its properties x
and y
.
Div(attrs = {
onClick { event -> // SyntheticMouseEvent
val x = event.x
val y = event.y
event.preventDefault() // The same goes for methods, like `preventDefault()`
}
})