Skip to content

Commit

Permalink
Update Kotlin, Compose, and Zipline to v2.1.0 (#2483)
Browse files Browse the repository at this point in the history
* Update Kotlin, Compose, and Zipline to v2.1.0

* KSP

* Burst 2.2.0

* Poko 0.18

* Zipline 1.19.0

* New FIR APIs

* Remove partial linkage disable due to coroutines bug

* Update Yarn lock

* API dump

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Jake Wharton <[email protected]>
  • Loading branch information
renovate[bot] and JakeWharton authored Dec 4, 2024
1 parent 72d1eb3 commit 0ee53c3
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 62 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,9 @@ class RedwoodBuildPlugin : Plugin<Project> {
tasks.withType(KotlinJsCompile::class.java) {
it.compilerOptions.freeCompilerArgs.addAll(
// https://github.com/JetBrains/compose-multiplatform/issues/3421
"-Xpartial-linkage=disable",
// Partial linkage temporarily required due to coroutines linking against unstable API.
// See https://github.com/Kotlin/kotlinx.coroutines/issues/4292.
// "-Xpartial-linkage=disable",
// https://github.com/JetBrains/compose-multiplatform/issues/3418
"-Xklib-enable-signature-clash-checks=false",
// Translate capturing lambdas into anonymous JS functions rather than hoisting parameters
Expand Down
10 changes: 5 additions & 5 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
[versions]
kotlin = "2.0.21"
kotlin = "2.1.0"
kotlinx-coroutines = "1.9.0"
kotlinx-serialization = "1.7.3"
androidx-activity = "1.9.3"
androidx-compose-ui = "1.7.5"
jbCompose = "1.7.1"
ksp = "2.0.21-1.0.28"
ksp = "2.1.0-1.0.29"
lint = "31.7.3"
paparazzi = "1.3.2"
zipline = "1.18.0"
zipline = "1.19.0"
coil = "3.0.4"
okio = "3.9.1"
burst = "2.1.0"
burst = "2.2.0"

[libraries]
kotlin-compiler = { module = "org.jetbrains.kotlin:kotlin-compiler", version.ref = "kotlin" }
Expand Down Expand Up @@ -98,6 +98,6 @@ turbine = "app.cash.turbine:turbine:1.2.0"
ktlint = "com.pinterest.ktlint:ktlint-cli:1.3.1"
ktlintComposeRules = "io.nlopez.compose.rules:ktlint:0.4.19"
googleJavaFormat = "com.google.googlejavaformat:google-java-format:1.25.0"
poko-gradlePlugin = "dev.drewhamilton.poko:poko-gradle-plugin:0.17.2"
poko-gradlePlugin = "dev.drewhamilton.poko:poko-gradle-plugin:0.18.0"

lint-core = { module = "com.android.tools.lint:lint", version.ref = "lint" }
59 changes: 22 additions & 37 deletions kotlin-js-store/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -122,27 +122,6 @@
dependencies:
"@types/node" "*"

"@types/eslint-scope@^3.7.3":
version "3.7.4"
resolved "https://registry.yarnpkg.com/@types/eslint-scope/-/eslint-scope-3.7.4.tgz#37fc1223f0786c39627068a12e94d6e6fc61de16"
integrity sha512-9K4zoImiZc3HlIp6AVUDE4CWYx22a+lhSZMYNpbjW04+YF0KWj4pJXnEMjdnFTiQibFFmElcsasJXDbdI/EPhA==
dependencies:
"@types/eslint" "*"
"@types/estree" "*"

"@types/eslint@*":
version "8.4.10"
resolved "https://registry.yarnpkg.com/@types/eslint/-/eslint-8.4.10.tgz#19731b9685c19ed1552da7052b6f668ed7eb64bb"
integrity sha512-Sl/HOqN8NKPmhWo2VBEPm0nvHnu2LL3v9vKo8MEq0EtbJ4eVzGPl41VNPvn5E1i5poMk4/XD8UriLHpJvEP/Nw==
dependencies:
"@types/estree" "*"
"@types/json-schema" "*"

"@types/estree@*":
version "1.0.0"
resolved "https://registry.yarnpkg.com/@types/estree/-/estree-1.0.0.tgz#5fb2e536c1ae9bf35366eed879e827fa59ca41c2"
integrity sha512-WulqXMDUTYAXCjZnk6JtIHPigp55cVtDgDrO2gHRwhyJto21+1zbVCtOYB2L1F9w4qCQ0rOGWBnBe0FNTiEJIQ==

"@types/estree@^1.0.5":
version "1.0.5"
resolved "https://registry.yarnpkg.com/@types/estree/-/estree-1.0.5.tgz#a6ce3e556e00fd9895dd872dd172ad0d4bd687f4"
Expand Down Expand Up @@ -199,7 +178,7 @@
dependencies:
"@types/node" "*"

"@types/json-schema@*", "@types/json-schema@^7.0.8", "@types/json-schema@^7.0.9":
"@types/json-schema@^7.0.8", "@types/json-schema@^7.0.9":
version "7.0.11"
resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.11.tgz#d421b6c527a3037f7c84433fd2c4229e016863d3"
integrity sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ==
Expand Down Expand Up @@ -971,7 +950,7 @@ engine.io@~6.5.2:
engine.io-parser "~5.2.1"
ws "~8.11.0"

enhanced-resolve@^5.17.0:
enhanced-resolve@^5.17.1:
version "5.17.1"
resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-5.17.1.tgz#67bfbbcc2f81d511be77d686a90267ef7f898a15"
integrity sha512-LMHl3dXhTcfv8gM4kEzIUeTQ+7fpdA0l2tUf34BddXPkz2A5xJ5L/Pchd5BL6rdccM9QGvu0sWZzK1Z1t4wwyg==
Expand Down Expand Up @@ -1621,10 +1600,10 @@ [email protected]:
minimatch "^9.0.3"
webpack-merge "^4.1.5"

[email protected].3:
version "6.4.3"
resolved "https://registry.yarnpkg.com/karma/-/karma-6.4.3.tgz#763e500f99597218bbb536de1a14acc4ceea7ce8"
integrity sha512-LuucC/RE92tJ8mlCwqEoRWXP38UMAqpnq98vktmS9SznSoUPPUJQbc91dHcxcunROvfQjdORVA/YFviH+Xci9Q==
[email protected].4:
version "6.4.4"
resolved "https://registry.yarnpkg.com/karma/-/karma-6.4.4.tgz#dfa5a426cf5a8b53b43cd54ef0d0d09742351492"
integrity sha512-LrtUxbdvt1gOpo3gxG+VAJlJAEMhbWlM4YrFQgql98FwF7+K8K12LYO4hnDdUkNjeztYrOXEMqgTajSWgmtI/w==
dependencies:
"@colors/colors" "1.5.0"
body-parser "^1.19.0"
Expand Down Expand Up @@ -1656,6 +1635,13 @@ kind-of@^6.0.2:
resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.3.tgz#07c05034a6c349fa06e24fa35aa76db4580ce4dd"
integrity sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==

[email protected]:
version "2.0.0"
resolved "https://registry.yarnpkg.com/kotlin-web-helpers/-/kotlin-web-helpers-2.0.0.tgz#b112096b273c1e733e0b86560998235c09a19286"
integrity sha512-xkVGl60Ygn/zuLkDPx+oHj7jeLR7hCvoNF99nhwXMn8a3ApB4lLiC9pk4ol4NHPjyoCbvQctBqvzUcp8pkqyWw==
dependencies:
format-util "^1.0.5"

launch-editor@^2.6.0:
version "2.8.1"
resolved "https://registry.yarnpkg.com/launch-editor/-/launch-editor-2.8.1.tgz#3bda72af213ec9b46b170e39661916ec66c2f463"
Expand Down Expand Up @@ -1807,10 +1793,10 @@ mkdirp@^0.5.5:
dependencies:
minimist "^1.2.6"

[email protected].0:
version "10.7.0"
resolved "https://registry.yarnpkg.com/mocha/-/mocha-10.7.0.tgz#9e5cbed8fa9b37537a25bd1f7fb4f6fc45458b9a"
integrity sha512-v8/rBWr2VO5YkspYINnvu81inSz2y3ODJrhO175/Exzor1RcEZZkizgE2A+w/CAXXoESS8Kys5E62dOHGHzULA==
[email protected].3:
version "10.7.3"
resolved "https://registry.yarnpkg.com/mocha/-/mocha-10.7.3.tgz#ae32003cabbd52b59aece17846056a68eb4b0752"
integrity sha512-uQWxAu44wwiACGqjbPYmjo7Lg8sFrS3dQe7PP2FQI+woptP4vZXSMcfMyFL/e1yFEeEpV4RtyTpZROOKmxis+A==
dependencies:
ansi-colors "^4.1.3"
browser-stdout "^1.3.1"
Expand Down Expand Up @@ -2723,12 +2709,11 @@ webpack-sources@^3.2.3:
resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-3.2.3.tgz#2d4daab8451fd4b240cc27055ff6a0c2ccea0cde"
integrity sha512-/DyMEOrDgLKKIG0fmvtz+4dUX/3Ghozwgm6iPp8KRhvn+eQf9+Q7GWxVNMk3+uCPWfdXYC4ExGBckIXdFEfH1w==

webpack@5.93.0:
version "5.93.0"
resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.93.0.tgz#2e89ec7035579bdfba9760d26c63ac5c3462a5e5"
integrity sha512-Y0m5oEY1LRuwly578VqluorkXbvXKh7U3rLoQCEO04M97ScRr44afGVkI0FQFsXzysk5OgFAxjZAb9rsGQVihA==
webpack@5.94.0:
version "5.94.0"
resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.94.0.tgz#77a6089c716e7ab90c1c67574a28da518a20970f"
integrity sha512-KcsGn50VT+06JH/iunZJedYGUJS5FGjow8wb9c0v5n1Om8O1g4L6LjtfxwlXIATopoQu+vOXXa7gYisWxCoPyg==
dependencies:
"@types/eslint-scope" "^3.7.3"
"@types/estree" "^1.0.5"
"@webassemblyjs/ast" "^1.12.1"
"@webassemblyjs/wasm-edit" "^1.12.1"
Expand All @@ -2737,7 +2722,7 @@ [email protected]:
acorn-import-attributes "^1.9.5"
browserslist "^4.21.10"
chrome-trace-event "^1.0.2"
enhanced-resolve "^5.17.0"
enhanced-resolve "^5.17.1"
es-module-lexer "^1.2.1"
eslint-scope "5.1.1"
events "^3.2.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,9 @@ import org.jetbrains.kotlin.cli.common.messages.MessageCollector
import org.jetbrains.kotlin.cli.jvm.compiler.EnvironmentConfigFiles
import org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment
import org.jetbrains.kotlin.cli.jvm.compiler.VfsBasedProjectEnvironment
import org.jetbrains.kotlin.cli.jvm.compiler.pipeline.IncrementalCompilationApi
import org.jetbrains.kotlin.cli.jvm.compiler.pipeline.ModuleCompilerInput
import org.jetbrains.kotlin.cli.jvm.compiler.pipeline.compileModuleToAnalyzedFir
import org.jetbrains.kotlin.cli.jvm.compiler.pipeline.compileModuleToAnalyzedFirViaLightTreeIncrementally
import org.jetbrains.kotlin.cli.jvm.config.addJvmClasspathRoots
import org.jetbrains.kotlin.com.intellij.openapi.util.Disposer
import org.jetbrains.kotlin.com.intellij.openapi.vfs.StandardFileSystems
Expand Down Expand Up @@ -72,6 +73,7 @@ import org.jetbrains.kotlin.fir.expressions.arguments
import org.jetbrains.kotlin.fir.expressions.impl.FirResolvedArgumentList
import org.jetbrains.kotlin.fir.references.FirNamedReference
import org.jetbrains.kotlin.fir.resolve.fqName
import org.jetbrains.kotlin.fir.resolve.toSymbol
import org.jetbrains.kotlin.fir.symbols.impl.FirValueParameterSymbol
import org.jetbrains.kotlin.fir.types.ConeClassLikeType
import org.jetbrains.kotlin.fir.types.ConeKotlinTypeProjection
Expand All @@ -81,19 +83,16 @@ import org.jetbrains.kotlin.fir.types.ConeTypeProjection
import org.jetbrains.kotlin.fir.types.classId
import org.jetbrains.kotlin.fir.types.customAnnotations
import org.jetbrains.kotlin.fir.types.isBasicFunctionType
import org.jetbrains.kotlin.fir.types.isNullable
import org.jetbrains.kotlin.fir.types.isMarkedNullable
import org.jetbrains.kotlin.fir.types.receiverType
import org.jetbrains.kotlin.fir.types.renderReadable
import org.jetbrains.kotlin.fir.types.toSymbol
import org.jetbrains.kotlin.fir.types.type
import org.jetbrains.kotlin.fir.types.variance
import org.jetbrains.kotlin.metadata.jvm.deserialization.JvmProtoBufUtil.DEFAULT_MODULE_NAME
import org.jetbrains.kotlin.modules.TargetId
import org.jetbrains.kotlin.name.ClassId
import org.jetbrains.kotlin.name.FqName
import org.jetbrains.kotlin.name.Name
import org.jetbrains.kotlin.platform.CommonPlatforms
import org.jetbrains.kotlin.platform.jvm.JvmPlatforms
import org.jetbrains.kotlin.text
import org.jetbrains.kotlin.types.Variance.INVARIANT
import org.jetbrains.kotlin.types.Variance.IN_VARIANCE
Expand Down Expand Up @@ -163,12 +162,10 @@ public fun parseProtocolSchema(
commonSources = emptyList(),
sourcesByModuleName = mapOf(DEFAULT_MODULE_NAME to sourceFiles),
),
commonPlatform = CommonPlatforms.defaultCommonPlatform,
platform = JvmPlatforms.unspecifiedJvmPlatform,
configuration = configuration,
)

val reporter = DiagnosticReporterFactory.createReporter()
val reporter = DiagnosticReporterFactory.createReporter(messageCollector)

val globalScope = GlobalSearchScope.allScope(project)
val packagePartProvider = environment.createPackagePartProvider(globalScope)
Expand All @@ -178,12 +175,14 @@ public fun parseProtocolSchema(
getPackagePartProviderFn = { packagePartProvider },
)

val output = compileModuleToAnalyzedFir(
input = input,
@OptIn(IncrementalCompilationApi::class)
val output = compileModuleToAnalyzedFirViaLightTreeIncrementally(
projectEnvironment = projectEnvironment,
previousStepsSymbolProviders = emptyList(),
incrementalExcludesScope = null,
messageCollector = messageCollector,
compilerConfiguration = configuration,
input = input,
diagnosticsReporter = reporter,
incrementalExcludesScope = null,
)
val platformOutput = output.outputs.first()
val firFiles = platformOutput.fir
Expand Down Expand Up @@ -431,7 +430,7 @@ private fun FirContext.parseWidget(
type = it.toFqType(),
)
},
isNullable = type.isNullable,
isNullable = type.isMarkedNullable,
defaultExpression = defaultExpression,
deprecation = deprecation,
)
Expand All @@ -454,7 +453,7 @@ private fun FirContext.parseWidget(
var arguments = typeArguments.dropLast(1) // Drop Unit return type.
val scope = type.receiverType(firSession)
if (scope != null) {
require(scope.typeArguments.isEmpty() && scope !is ConeTypeParameterType && !scope.isNullable) {
require(scope.typeArguments.isEmpty() && scope !is ConeTypeParameterType && !scope.isMarkedNullable) {
"@Children $memberType#$name lambda receiver can only be a non-null class. Found: ${scope.renderReadable()}"
}
arguments = arguments.drop(1)
Expand Down Expand Up @@ -874,7 +873,7 @@ private fun ConeTypeProjection.toFqType(): FqType {
}
type.lookupTag.classId.toFqType()
.copy(
nullable = type.isNullable,
nullable = type.isMarkedNullable,
parameterTypes = parameterTypes,
variance = variance,
)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
public final class app/cash/redwood/treehouse/composeui/ComposableSingletons$EmptyDynamicContentWidgetFactoryKt {
public static final field INSTANCE Lapp/cash/redwood/treehouse/composeui/ComposableSingletons$EmptyDynamicContentWidgetFactoryKt;
public static field lambda-1 Lkotlin/jvm/functions/Function2;
public static field lambda-2 Lkotlin/jvm/functions/Function2;
public fun <init> ()V
public final fun getLambda-1$redwood_treehouse_host_composeui_release ()Lkotlin/jvm/functions/Function2;
public final fun getLambda-2$redwood_treehouse_host_composeui_release ()Lkotlin/jvm/functions/Function2;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
public final class app/cash/redwood/treehouse/composeui/ComposableSingletons$EmptyDynamicContentWidgetFactoryKt {
public static final field INSTANCE Lapp/cash/redwood/treehouse/composeui/ComposableSingletons$EmptyDynamicContentWidgetFactoryKt;
public static field lambda-1 Lkotlin/jvm/functions/Function2;
public static field lambda-2 Lkotlin/jvm/functions/Function2;
public fun <init> ()V
public final fun getLambda-1$redwood_treehouse_host_composeui ()Lkotlin/jvm/functions/Function2;
public final fun getLambda-2$redwood_treehouse_host_composeui ()Lkotlin/jvm/functions/Function2;
Expand Down

0 comments on commit 0ee53c3

Please sign in to comment.