Skip to content

Commit fe7021c

Browse files
author
samgarasx
committed
Add Kotlin JS new IR compiler support
1 parent 4f4e61b commit fe7021c

File tree

203 files changed

+774
-703
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

203 files changed

+774
-703
lines changed

build.gradle.kts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,20 @@ subprojects {
2020

2121
plugins.withType<KotlinJsPluginWrapper> {
2222
extensions.configure<KotlinJsProjectExtension> {
23-
js {
24-
if (project.name.contains("samples")) {
23+
if (project.name.contains("samples")) {
24+
js(IR) {
2525
browser {
2626
commonWebpackConfig {
2727
cssSupport.enabled = true
2828
}
2929
}
3030

3131
binaries.executable()
32-
} else browser()
32+
}
33+
} else {
34+
js(BOTH) {
35+
browser()
36+
}
3337
}
3438
}
3539

buildSrc/src/main/kotlin/wrapper-publish.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ configure<PublishingExtension> {
1717
artifactId = project.name
1818
version = "${version(project.name)}-kotlin-${kotlinVersion()}"
1919

20-
artifact(tasks.getByName<Zip>("jsSourcesJar"))
20+
artifact(tasks.getByName<Zip>("jsLegacySourcesJar"))
2121

2222
from(components["kotlin"])
2323

gradle.properties

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ kotlin-react.version=17.0.2-pre.154
66
kotlin-react-dom.version=17.0.2-pre.154
77
kotlin-styled.version=5.2.3-pre.154
88

9-
kotlin-antd.version=4.8.6-pre.12
10-
kotlin-moment.version=2.27.0-pre.10
11-
kotlin-react-intl.version=5.8.1-pre.10
12-
kotlin-react-responsive.version=8.1.0-pre.10
13-
kotlin-uikit.version=3.5.7-pre.9
9+
kotlin-antd.version=4.8.6-pre.13
10+
kotlin-moment.version=2.27.0-pre.11
11+
kotlin-react-intl.version=5.8.1-pre.11
12+
kotlin-react-responsive.version=8.1.0-pre.11
13+
kotlin-uikit.version=3.5.7-pre.10

kotlin-antd/antd-samples/src/main/kotlin/samples/affix/Basic.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import react.*
66
import react.dom.*
77
import styled.*
88

9-
interface BasicDemoState : RState {
9+
external interface BasicDemoState : RState {
1010
var top: Number
1111
var bottom: Number
1212
}

kotlin-antd/antd-samples/src/main/kotlin/samples/alert/SmoothClosed.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import react.*
55
import react.dom.*
66
import styled.*
77

8-
interface SmoothClosedState : RState {
8+
external interface SmoothClosedState : RState {
99
var visible: Boolean
1010
}
1111

kotlin-antd/antd-samples/src/main/kotlin/samples/autocomplete/Basic.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ private val handleSelect = { value: Any, _: Any ->
99
console.log("onSelect", value)
1010
}
1111

12-
interface BasicCompleteState : RState {
12+
external interface BasicCompleteState : RState {
1313
var dataSource: Array<DataSourceItemType>
1414
}
1515

kotlin-antd/antd-samples/src/main/kotlin/samples/autocomplete/Custom.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ private val handleSelect = { value: Any, _: Any ->
1212
console.log("onSelect", value)
1313
}
1414

15-
interface CustomCompleteState : RState {
15+
external interface CustomCompleteState : RState {
1616
var dataSource: Array<DataSourceItemType>
1717
}
1818

kotlin-antd/antd-samples/src/main/kotlin/samples/autocomplete/NonCaseSensitive.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import styled.*
99
private val datasource = arrayOf("Burns Bay Road", "Downing Street", "Wall Street")
1010

1111
private val filter: FilterFunc<Any> = { inputValue, option ->
12-
option.asDynamic().props.children.unsafeCast<String>().toLowerCase().contains(inputValue.toLowerCase())
12+
option.asDynamic().props.children.unsafeCast<String>().lowercase().contains(inputValue.lowercase())
1313
}
1414

1515
fun RBuilder.nonCaseSensitiveComplete() {

kotlin-antd/antd-samples/src/main/kotlin/samples/autocomplete/Options.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import kotlinext.js.*
66
import react.*
77
import styled.*
88

9-
interface OptionsCompleteState : RState {
9+
external interface OptionsCompleteState : RState {
1010
var result: Array<String>
1111
}
1212

kotlin-antd/antd-samples/src/main/kotlin/samples/avatar/Badge.kt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ package samples.avatar
33
import antd.avatar.*
44
import antd.badge.*
55
import antd.icon.userOutlined
6-
import kotlinext.js.*
6+
import kotlinx.css.marginRight
7+
import kotlinx.css.px
78
import react.*
89
import react.dom.*
910
import styled.*
@@ -12,8 +13,8 @@ fun RBuilder.badge() {
1213
styledDiv {
1314
css { +AvatarStyles.badge }
1415
div {
15-
span {
16-
attrs.jsStyle = js { marginRight = 24 }
16+
styledSpan {
17+
css { marginRight = 24.px }
1718
badge {
1819
attrs.count = 1
1920
avatar {

0 commit comments

Comments
 (0)