-
Notifications
You must be signed in to change notification settings - Fork 81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add atomicfu plugin and use it to implement all atomics #963
Conversation
9b1cc64
to
fe2ac4e
Compare
fe2ac4e
to
7738b42
Compare
|
||
actual class AtomicLong actual constructor(value: Long) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's add ## Breaking change
to the PR description. It will be added manually to the changelog later (or via some future script)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actual was a (public) class (not a typealias) and it was using the declaration
We should write it from the user perspective. The user sees only available classes, not that there are aliases/actuals. We should enumarate all removed classes and sourceSets (jsMain, iosMain, wasmMain).
@eymar, could you also look at the PR?
|
import kotlinx.atomicfu.atomic | ||
|
||
internal actual class AtomicReference<V> actual constructor(value: V) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see the source set here named jbMain
. I understand that we added jbMain
in runtime module, because skikoMain
name doesn't fit runtime purpose and it doesn't depend on skiko.
Since animation-core depends on ui, then it depends on skiko:
implementation(project(":compose:ui:ui"))
And the name can be skikoMain to not introduce a new name beside runtime. Not a big thing though. No skiko code is used here directly, so skikoMain
name here is arguable.
compose/runtime/runtime/build.gradle
Outdated
jvmMain.dependsOn(jbMain) | ||
jsMain.dependsOn(jbMain) | ||
jsNativeMain.dependsOn(jbMain) | ||
nativeMain.dependsOn(jbMain) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if suggestion by Igor above to be applied, then here it's similar:
desktopdMain.dependsOn(jbMain)
jsNativeMain.dependsOn(jbMain)
Intereseting. Wasn't https://android-review.googlesource.com/c/platform/frameworks/support/+/2875994 a breaking change? I see no api files changes in it. |
Only for native/js. For desktop/Android it was internal. It was available in commonMain, but it wouldn't compile, because the actual was internal. Discussion |
7738b42
to
9fc3e71
Compare
Proposed Changes
As atomicfu atomics are now stable, we can use them to implement AtomicReference, AtomicInt etc.
I made the changes module-by-module, so it could be more convenient to review commit-by-commit.
Breaking change
This will break code in the specific source-sets that was using the public
actual
.The list of types that were public and are now internal:
androidx.compose.runtime.AtomicReference
in JS, native and WASM source-sets.androidx.compose.foundation.AtomicLong
in JS, WASM and native source-sets.androidx.compose.material.InternalAtomicReference
in JS and native source-sets.Testing
Test: Waiting to see the tests in CI.