Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 28e6f6b

Browse files
author
samgarasx
committedJun 11, 2022
Update Kotlin version to v1.7.0
1 parent 62a69d5 commit 28e6f6b

File tree

12 files changed

+465
-419
lines changed

12 files changed

+465
-419
lines changed
 

‎buildSrc/src/main/kotlin/Dependencies.kt

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,8 @@ import org.jetbrains.kotlin.gradle.targets.js.npm.NpmDependency
44
import org.jetbrains.kotlin.gradle.targets.js.npm.NpmDependencyExtension
55

66
fun Project.kotlinWrapperDependency(name: String) =
7-
"org.jetbrains.kotlin-wrappers:kotlin-$name:${wrapperVersion(name)}-kotlin-${kotlinVersion()}"
7+
"org.jetbrains.kotlin-wrappers:kotlin-$name:${wrapperVersion(name)}"
88

99
fun Project.npmPackage(name: String): NpmDependency {
10-
val npm = dependencies.the<NpmDependencyExtension>()
11-
12-
return npm(name, npmVersion(name))
13-
}
10+
return dependencies.the<NpmDependencyExtension>()(name, npmVersion(name))
11+
}

‎buildSrc/src/main/kotlin/Publication.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ fun Project.configurePublication() {
1313
publications.create<MavenPublication>("kotlinJsWrapper") {
1414
groupId = project.group.toString()
1515
artifactId = project.name
16-
version = "${version(project.name)}-kotlin-${kotlinVersion()}"
16+
version = version(project.name)
1717

1818
artifact(tasks.getByName<Zip>("jsLegacySourcesJar"))
1919

‎buildSrc/src/main/kotlin/Versions.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import org.gradle.api.Project
33
fun Project.kotlinVersion() = version("kotlin")
44

55
fun Project.wrapperVersion(name: String) = version("kotlin-$name")
6-
fun Project.npmVersion(name: String) = version("kotlin-$name")
6+
fun Project.npmVersion(name: String) = "^${version("kotlin-$name")}"
77
.replaceAfter("-", "")
88
.removeSuffix("-")
99

10-
fun Project.version(target: String) = property("${target}.version") as String
10+
fun Project.version(target: String) = property("${target}.version") as String

‎gradle.properties

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
kotlin.code.style=official
22

3-
kotlin.version=1.6.20
3+
kotlin.version=1.7.0
44

5-
kotlin-react.version=18.0.0-pre.331
6-
kotlin-react-dom.version=18.0.0-pre.331
7-
kotlin-emotion.version=11.9.0-pre.331
5+
kotlin-react.version=18.1.0-pre.343
6+
kotlin-react-dom.version=18.1.0-pre.343
7+
kotlin-emotion.version=11.9.0-pre.343
88

99
# kotlin-antd.version=4.8.6-pre.16 (Discontinued)
1010
# kotlin-moment.version=2.29.1-pre.15 (Discontinued)
1111

12-
kotlin-react-intl.version=5.24.8-pre.20
13-
kotlin-react-responsive.version=8.2.0-pre.18
14-
kotlin-uikit.version=3.13.7-pre.18
12+
kotlin-react-intl.version=5.24.8-pre.21
13+
kotlin-react-responsive.version=8.2.0-pre.19
14+
kotlin-uikit.version=3.13.7-pre.19

‎kotlin-js-store/yarn.lock

Lines changed: 400 additions & 354 deletions
Large diffs are not rendered by default.

‎kotlin-react-intl/react-intl-samples/src/main/kotlin/samples/Advanced.kt

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package samples
33
import csstype.px
44
import emotion.react.css
55
import kotlinext.js.*
6+
import kotlinx.js.Record
67
import react.*
78
import react.dom.html.ReactHTML.br
89
import react.dom.html.ReactHTML.p
@@ -36,62 +37,62 @@ val Advanced = FC<Props> {
3637
br {}
3738
FormattedMessage {
3839
id = "placeholder"
39-
values = js { name = "John" }
40+
values = js { name = "John" }.unsafeCast<Record<String, ReactNode>>()
4041
}
4142
br {}
4243
FormattedMessage {
4344
id = "date"
44-
values = js { ts = Date.now() }
45+
values = js { ts = Date.now() }.unsafeCast<Record<String, ReactNode>>()
4546
}
4647
br {}
4748
FormattedMessage {
4849
id = "time"
49-
values = js { ts = Date.now() }
50+
values = js { ts = Date.now() }.unsafeCast<Record<String, ReactNode>>()
5051
}
5152
br {}
5253
FormattedMessage {
5354
id = "number"
54-
values = js { num = Random.nextInt() * 1000 }
55+
values = js { num = Random.nextInt() * 1000 }.unsafeCast<Record<String, ReactNode>>()
5556
}
5657
br {}
5758
FormattedMessage {
5859
id = "plural"
59-
values = js { num = 1 }
60+
values = js { num = 1 }.unsafeCast<Record<String, ReactNode>>()
6061
}
6162
br {}
6263
FormattedMessage {
6364
id = "plural"
64-
values = js { num = 99 }
65+
values = js { num = 99 }.unsafeCast<Record<String, ReactNode>>()
6566
}
6667
br {}
6768
FormattedMessage {
6869
id = "select"
69-
values = js { gender = "male" }
70+
values = js { gender = "male" }.unsafeCast<Record<String, ReactNode>>()
7071
}
7172
br {}
7273
FormattedMessage {
7374
id = "select"
74-
values = js { gender = "female" }
75+
values = js { gender = "female" }.unsafeCast<Record<String, ReactNode>>()
7576
}
7677
br {}
7778
FormattedMessage {
7879
id = "selectordinal"
79-
values = js { order = 1 }
80+
values = js { order = 1 }.unsafeCast<Record<String, ReactNode>>()
8081
}
8182
br {}
8283
FormattedMessage {
8384
id = "selectordinal"
84-
values = js { order = 2 }
85+
values = js { order = 2 }.unsafeCast<Record<String, ReactNode>>()
8586
}
8687
br {}
8788
FormattedMessage {
8889
id = "selectordinal"
89-
values = js { order = 3 }
90+
values = js { order = 3 }.unsafeCast<Record<String, ReactNode>>()
9091
}
9192
br {}
9293
FormattedMessage {
9394
id = "selectordinal"
94-
values = js { order = 4 }
95+
values = js { order = 4 }.unsafeCast<Record<String, ReactNode>>()
9596
}
9697
br {}
9798
FormattedMessage {
@@ -101,7 +102,7 @@ val Advanced = FC<Props> {
101102
bold = fun(chunks: String): ReactNode {
102103
return strong.create { +chunks }
103104
}
104-
}
105+
}.unsafeCast<Record<String, ReactNode>>()
105106
}
106107
}
107108
}

‎kotlin-react-intl/react-intl-samples/src/main/kotlin/samples/Hooks.kt

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package samples
22

33
import kotlinext.js.*
4+
import kotlinx.js.Record
45
import kotlinx.js.jso
56
import react.*
67
import react.dom.html.ReactHTML.br
@@ -39,36 +40,36 @@ private val Demo = FC<DemoProps> {
3940
p {
4041
+intl.formatMessage(jso { id = "simple" })
4142
br {}
42-
+intl.formatMessage(jso { id = "placeholder" }, js { name = "John" })
43+
+intl.formatMessage(jso { id = "placeholder" }, js { name = "John" }.unsafeCast<Record<String, Any>>())
4344
br {}
44-
+intl.formatMessage(jso { id = "date" }, js { ts = Date.now() })
45+
+intl.formatMessage(jso { id = "date" }, js { ts = Date.now() }.unsafeCast<Record<String, Any>>())
4546
br {}
46-
+intl.formatMessage(jso { id = "time" }, js { ts = Date.now() })
47+
+intl.formatMessage(jso { id = "time" }, js { ts = Date.now() }.unsafeCast<Record<String, Any>>())
4748
br {}
48-
+intl.formatMessage(jso { id = "number" }, js { num = Random.nextInt() * 1000 })
49+
+intl.formatMessage(jso { id = "number" }, js { num = Random.nextInt() * 1000 }.unsafeCast<Record<String, Any>>())
4950
br {}
50-
+intl.formatMessage(jso { id = "plural" }, js { num = 1 })
51+
+intl.formatMessage(jso { id = "plural" }, js { num = 1 }.unsafeCast<Record<String, Any>>())
5152
br {}
52-
+intl.formatMessage(jso { id = "plural" }, js { num = 99 })
53+
+intl.formatMessage(jso { id = "plural" }, js { num = 99 }.unsafeCast<Record<String, Any>>())
5354
br {}
54-
+intl.formatMessage(jso { id = "select" }, js { gender = "male" })
55+
+intl.formatMessage(jso { id = "select" }, js { gender = "male" }.unsafeCast<Record<String, Any>>())
5556
br {}
56-
+intl.formatMessage(jso { id = "select" }, js { gender = "female" })
57+
+intl.formatMessage(jso { id = "select" }, js { gender = "female" }.unsafeCast<Record<String, Any>>())
5758
br {}
58-
+intl.formatMessage(jso { id = "selectordinal" }, js { order = 1 })
59+
+intl.formatMessage(jso { id = "selectordinal" }, js { order = 1 }.unsafeCast<Record<String, Any>>())
5960
br {}
60-
+intl.formatMessage(jso { id = "selectordinal" }, js { order = 2 })
61+
+intl.formatMessage(jso { id = "selectordinal" }, js { order = 2 }.unsafeCast<Record<String, Any>>())
6162
br {}
62-
+intl.formatMessage(jso { id = "selectordinal" }, js { order = 3 })
63+
+intl.formatMessage(jso { id = "selectordinal" }, js { order = 3 }.unsafeCast<Record<String, Any>>())
6364
br {}
64-
+intl.formatMessage(jso { id = "selectordinal" }, js { order = 4 })
65+
+intl.formatMessage(jso { id = "selectordinal" }, js { order = 4 }.unsafeCast<Record<String, Any>>())
6566
br {}
66-
+intl.formatMessage(jso { id = "unicode" }, js { this.placeholder = "world" })
67+
+intl.formatMessage(jso { id = "unicode" }, js { this.placeholder = "world" }.unsafeCast<Record<String, Any>>())
6768
br {}
6869
+intl.formatMessage(jso {
6970
id = "whatever"
7071
defaultMessage = "Hello\u0020{placeholder}"
71-
}, js { this.placeholder = "world" })
72+
}, js { this.placeholder = "world" }.unsafeCast<Record<String, Any>>())
7273
}
7374
}
7475

‎kotlin-react-intl/react-intl-samples/src/main/kotlin/samples/Main.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ package samples
22

33
import kotlinx.browser.*
44
import react.create
5-
import react.dom.*
5+
import react.dom.client.createRoot
66

77
fun main() {
8-
render(element = App.create(), container = document.getElementById("root")!!)
8+
createRoot(document.getElementById("root")!!).render(App.create())
99
}

‎kotlin-react-intl/react-intl-samples/src/main/kotlin/samples/Messages.kt

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package samples
22

33
import kotlinext.js.*
4+
import kotlinx.js.Record
45
import react.*
56
import react.dom.html.ReactHTML.br
67
import react.dom.html.ReactHTML.p
@@ -38,62 +39,62 @@ val Messages = FC<Props> {
3839
br {}
3940
FormattedMessage {
4041
id = "placeholder"
41-
values = js { name = "John" }
42+
values = js { name = "John" }.unsafeCast<Record<String, ReactNode>>()
4243
}
4344
br {}
4445
FormattedMessage {
4546
id = "date"
46-
values = js { ts = Date.now() }
47+
values = js { ts = Date.now() }.unsafeCast<Record<String, ReactNode>>()
4748
}
4849
br {}
4950
FormattedMessage {
5051
id = "time"
51-
values = js { ts = Date.now() }
52+
values = js { ts = Date.now() }.unsafeCast<Record<String, ReactNode>>()
5253
}
5354
br {}
5455
FormattedMessage {
5556
id = "number"
56-
values = js { num = Random.nextInt() * 1000 }
57+
values = js { num = Random.nextInt() * 1000 }.unsafeCast<Record<String, ReactNode>>()
5758
}
5859
br {}
5960
FormattedMessage {
6061
id = "plural"
61-
values = js { num = 1 }
62+
values = js { num = 1 }.unsafeCast<Record<String, ReactNode>>()
6263
}
6364
br {}
6465
FormattedMessage {
6566
id = "plural"
66-
values = js { num = 99 }
67+
values = js { num = 99 }.unsafeCast<Record<String, ReactNode>>()
6768
}
6869
br {}
6970
FormattedMessage {
7071
id = "select"
71-
values = js { gender = "male" }
72+
values = js { gender = "male" }.unsafeCast<Record<String, ReactNode>>()
7273
}
7374
br {}
7475
FormattedMessage {
7576
id = "select"
76-
values = js { gender = "female" }
77+
values = js { gender = "female" }.unsafeCast<Record<String, ReactNode>>()
7778
}
7879
br {}
7980
FormattedMessage {
8081
id = "selectordinal"
81-
values = js { order = 1 }
82+
values = js { order = 1 }.unsafeCast<Record<String, ReactNode>>()
8283
}
8384
br {}
8485
FormattedMessage {
8586
id = "selectordinal"
86-
values = js { order = 2 }
87+
values = js { order = 2 }.unsafeCast<Record<String, ReactNode>>()
8788
}
8889
br {}
8990
FormattedMessage {
9091
id = "selectordinal"
91-
values = js { order = 3 }
92+
values = js { order = 3 }.unsafeCast<Record<String, ReactNode>>()
9293
}
9394
br {}
9495
FormattedMessage {
9596
id = "selectordinal"
96-
values = js { order = 4 }
97+
values = js { order = 4 }.unsafeCast<Record<String, ReactNode>>()
9798
}
9899
br {}
99100
FormattedMessage {
@@ -103,7 +104,7 @@ val Messages = FC<Props> {
103104
bold = fun(chunks: String): ReactNode {
104105
return strong.create { +chunks }
105106
}
106-
}
107+
}.unsafeCast<Record<String, ReactNode>>()
107108
}
108109
br {}
109110
FormattedMessage {
@@ -113,18 +114,18 @@ val Messages = FC<Props> {
113114
bold = fun(chunks: String): ReactNode {
114115
return strong.create { +chunks }
115116
}
116-
}
117+
}.unsafeCast<Record<String, ReactNode>>()
117118
}
118119
br {}
119120
FormattedMessage {
120121
id = "unicode"
121-
values = js { this.placeholder = "world" }
122+
values = js { this.placeholder = "world" }.unsafeCast<Record<String, ReactNode>>()
122123
}
123124
br {}
124125
FormattedMessage {
125126
id = "whatever"
126127
defaultMessage = "Hello\u0020{placeholder}"
127-
values = js { this.placeholder = "world" }
128+
values = js { this.placeholder = "world" }.unsafeCast<Record<String, ReactNode>>()
128129
}
129130
}
130131
}

‎kotlin-react-intl/react-intl-samples/src/main/kotlin/samples/TimeZone.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ external interface TimeZoneProps : Props {
1818
}
1919

2020
val TimeZone = FC<TimeZoneProps> { props ->
21-
props.currentTime = Date()
2221
IntlProvider {
2322
locale = "en"
2423
timeZone = "Asia/Tokyo"

‎kotlin-react-responsive/react-responsive-samples/src/main/kotlin/samples/Main.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ package samples
22

33
import kotlinx.browser.*
44
import react.create
5-
import react.dom.*
5+
import react.dom.client.createRoot
66

77
fun main() {
8-
render(element = App.create(), container = document.getElementById("root")!!)
8+
createRoot(document.getElementById("root")!!).render(App.create())
99
}

‎kotlin-uikit/uikit-samples/src/main/kotlin/samples/Main.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ package samples
33
import kotlinext.js.*
44
import kotlinx.browser.*
55
import react.create
6-
import react.dom.*
6+
import react.dom.client.createRoot
77
import uikit.*
88

99
fun main() {
1010
require("uikit/dist/css/uikit.css")
1111

1212
UIkit.use(Icons)
1313

14-
render(element = App.create(), container = document.getElementById("root")!!)
14+
createRoot(document.getElementById("root")!!).render(App.create())
1515
}

0 commit comments

Comments
 (0)
Please sign in to comment.