https://kotlinlang.org logo
Join the conversationJoin Slack
Channels
100daysofcode
100daysofkotlin
100daysofkotlin-2021
advent-of-code
aem
ai
alexa
algeria
algolialibraries
amsterdam
android
android-architecture
android-databinding
android-studio
androidgithubprojects
androidthings
androidx
androidx-xprocessing
anime
anko
announcements
apollo-kotlin
appintro
arabic
argentina
arkenv
arksemdevteam
armenia
arrow
arrow-contributors
arrow-meta
ass
atlanta
atm17
atrium
austin
australia
austria
awesome-kotlin
ballast
bangladesh
barcelona
bayarea
bazel
beepiz-libraries
belgium
berlin
big-data
books
boston
brazil
brikk
budapest
build
build-tools
bulgaria
bydgoszcz
cambodia
canada
carrat
carrat-dev
carrat-feed
chicago
chile
china
chucker
cincinnati-user-group
cli
clikt
cloudfoundry
cn
cobalt
code-coverage
codeforces
codemash-precompiler
codereview
codingame
codingconventions
coimbatore
collaborations
colombia
colorado
communities
competitive-programming
competitivecoding
compiler
compose
compose-android
compose-desktop
compose-hiring
compose-ios
compose-mp
compose-ui-showcase
compose-wear
compose-web
connect-audit-events
corda
cork
coroutines
couchbase
coursera
croatia
cryptography
cscenter-course-2016
cucumber-bdd
cyprus
czech
dagger
data2viz
databinding
datascience
dckotlin
debugging
decompose
decouple
denmark
deprecated
detekt
detekt-hint
dev-core
dfw
docs-revamped
dokka
domain-driven-design
doodle
dsl
dublin
dutch
eap
eclipse
ecuador
edinburgh
education
effective-kotlin
effectivekotlin
emacs
embedded-kotlin
estatik
event21-community-content
events
exposed
failgood
fb-internal-demo
feed
firebase
flow
fluid-libraries
forkhandles
forum
fosdem
fp-in-kotlin
framework-elide
freenode
french
fritz2
fuchsia
functional
funktionale
gamedev
ge-kotlin
general-advice
georgia
geospatial
german-lang
getting-started
github-workflows-kt
glance
godot-kotlin
google-io
gradle
graphic
graphkool
graphql
graphql-kotlin
graviton-browser
greece
grpc
gsoc
gui
hackathons
hacktoberfest
hamburg
hamkrest
helios
helsinki
hexagon
hibernate
hikari-cp
hire-me
hiring
hongkong
hoplite
http4k
hungary
hyderabad
image-processing
india
indonesia
inkremental
intellij
intellij-plugins
intellij-tricks
internships
introduce-yourself
io
ios
iran
israel
istanbulcoders
italian
jackson-kotlin
jadx
japanese
jasync-sql
java-to-kotlin-refactoring
javadevelopers
javafx
javalin
javascript
jdbi
jhipster-kotlin
jobsworldwide
jpa
jshdq
juul-libraries
jvm-ir-backend-feedback
jxadapter
k2-early-adopters
kaal
kafka
kakao
kalasim
kapt
karachi
karg
karlsruhe
kash_shell
kaskade
kbuild
kdbc
kgen-doc-tools
kgraphql
kinta
klaxon
klock
kloudformation
kmdc
kmm-español
kmongo
knbt
knote
koalaql
koans
kobalt
kobweb
kodein
kodex
kohesive
koin
koin-dev
komapper
kondor-json
kong
kontent
kontributors
korau
korean
korge
korim
korio
korlibs
korte
kotest
kotest-contributors
kotless
kotlick
kotlin-asia
kotlin-beam
kotlin-by-example
kotlin-csv
kotlin-data-storage
kotlin-foundation
kotlin-fuel
kotlin-in-action
kotlin-inject
kotlin-latam
kotlin-logging
kotlin-multiplatform-contest
kotlin-mumbai
kotlin-native
kotlin-pakistan
kotlin-plugin
kotlin-pune
kotlin-roadmap
kotlin-samples
kotlin-sap
kotlin-serbia
kotlin-spark
kotlin-szeged
kotlin-website
kotlinacademy
kotlinbot
kotlinconf
kotlindl
kotlinforbeginners
kotlingforbeginners
kotlinlondon
kotlinmad
kotlinprogrammers
kotlinsu
kotlintest
kotlintest-devs
kotlintlv
kotlinultimatechallenge
kotlinx-datetime
kotlinx-files
kotlinx-html
kotrix
kotson
kovenant
kprompt
kraph
krawler
kroto-plus
ksp
ktcc
ktfmt
ktlint
ktor
ktp
kubed
kug-leads
kug-torino
kvision
kweb
lambdaworld_cadiz
lanark
language-evolution
language-proposals
latvia
leakcanary
leedskotlinusergroup
lets-have-fun
libgdx
libkgd
library-development
linkeddata
lithuania
london
losangeles
lottie
love
lychee
macedonia
machinelearningbawas
madrid
malaysia
mathematics
meetkotlin
memes
meta
metro-detroit
mexico
miami
micronaut
minnesota
minutest
mirror
mockk
moko
moldova
monsterpuzzle
montreal
moonbean
morocco
motionlayout
mpapt
mu
multiplatform
mumbai
munich
mvikotlin
mvrx
myndocs-oauth2-server
naming
navigation-architecture-component
nepal
new-mexico
new-zealand
newname
nigeria
nodejs
norway
npm-publish
nyc
oceania
ohio-kotlin-users
oldenburg
oolong
opensource
orbit-mvi
osgi
otpisani
package-search
pakistan
panamá
pattern-matching
pbandk
pdx
peru
philippines
phoenix
pinoy
pocketgitclient
polish
popkorn
portugal
practical-functional-programming
proguard
prozis-android-backup
pyhsikal
python
python-contributors
quasar
random
re
react
reaktive
realm
realworldkotlin
reductor
reduks
redux
redux-kotlin
refactoring-to-kotlin
reflect
refreshversions
reports
result
rethink
revolver
rhein-main
rocksdb
romania
room
rpi-pico
rsocket
russian
russian_feed
russian-kotlinasfirst
rx
rxjava
san-diego
science
scotland
scrcast
scrimage
script
scripting
seattle
serialization
server
sg-user-group
singapore
skia-wasm-interop-temp
skrape-it
slovak
snake
sofl-user-group
southafrica
spacemacs
spain
spanish
speaking
spek
spin
splitties
spotify-mobius
spring
spring-security
squarelibraries
stackoverflow
stacks
stayhungrystayfoolish
stdlib
stlouis
strife-discord-lib
strikt
students
stuttgart
sudan
swagger-gradle-codegen
swarm
sweden
swing
swiss-user-group
switzerland
talking-kotlin
tallinn
tampa
teamcity
tegal
tempe
tensorflow
terminal
test
testing
testtestest
texas
tgbotapi
thailand
tornadofx
touchlab-tools
training
tricity-kotlin-user-group
trójmiasto
truth
tunisia
turkey
turkiye
twitter-feed
uae
udacityindia
uk
ukrainian
uniflow
unkonf
uruguay
utah
uuid
vancouver
vankotlin
vertx
videos
vienna
vietnam
vim
vkug
vuejs
web-mpp
webassembly
webrtc
wimix_sentry
wwdc
zircon
Powered by Linen
squarelibraries
  • h

    hfhbd

    09/26/2022, 3:36 PM
    I don't know if there is another issue but here is one with one option to overload the cast function (in sqldelight dialect): https://github.com/cashapp/sqldelight/issues/3421#issuecomment-1214295014
  • l

    Landry Norris

    09/28/2022, 1:30 PM
    I’m running into a strange error with okio on iOS. I need to create a folder if it doesn’t exist, so I have a line that says
    if(!fileSystem.exists(path)) fileSystem.createDirectory(path, true)
    . I also have a log on the line before printing the value of the exists check. In my logs, I see
    Does it exist yet? false
    Uncaught Kotlin exception: okio.IOException: File exists
    I know that this function will only run on the main thread, so it’s not a threading issue, and I’m using FileSystem.SYSTEM on iOS. If I set mustCreate to false, then it runs the createDirectory line, but no folder is created. Logs also show that the parent path exists and is definitely in my app’s folder.
    • 1
    • 3
  • g

    grahamborland

    09/29/2022, 3:00 PM
    Playing around with Molecule (0.5.0-beta01) in a KMP lib. I can write
    @Composable
    functions in my
    commonMain
    ,
    iosMain
    and
    jsMain
    sourceSets, but not in
    androidMain
    (Unresolved reference: Composable). Do I need to add an explicit Compose dependency to
    androidMain
    but not the others?
  • e

    eygraber

    09/29/2022, 8:16 PM
    I started discussing zipline with some of my colleagues on the iOS side of the company, and their immediate concern was that Apple would remove our app because of Guideline 2.4.5:
    (iv) They may not download or install standalone apps, kexts, additional code, or resources to add functionality or significantly change the app from what we see during the review process.
    I think there were a few mentions of this in https://www.droidcon.com/2022/09/29/dynamic-code-with-zipline/; is it as simple as interpreting the js that makes Apple OK with it, or is there still a risk of getting removed from the App Store over using Zipline?
  • j

    jw

    09/29/2022, 8:31 PM
    the guidelines used to carve out explicitly interpreted content such as JS engines and Lua. we're mostly relying on the fact that React Native ships their Hermes engine to a million apps and there's already quite a few embedding QuickJS themselves. you don't need a JS engine to significantly change the functionality of your apps, you can do that with plain code. I think users of JS engines are overly careful to ensure they don't violate that rule so as to not draw undue attention on themselves. what's the difference between an interpreting JS engine and some "native" code which iterates a series of JSON and protos and conditionally performs operations and displays content? very little.
  • j

    jw

    09/29/2022, 8:33 PM
    you can read about it a little at https://dev.to/alastaircoote/to-jsc-or-not-to-jsc-running-javascript-on-ios-in-2020-44ba and https://www.theregister.com/2017/06/07/apple_relaxes_developer_rules/
  • j

    jw

    09/29/2022, 8:34 PM
    @grahamborland should not be required. do you have the
    google()
    repo available? The Android variant uses the Google runtime which comes from Google Maven. if it failed to resolve it may not work in Android-specific source sets
    g
    • 2
    • 1
  • e

    eygraber

    09/30/2022, 2:48 AM
    Are there any redwood artifacts published, or if I want to play around with it I need to build and publish locally?
  • j

    jw

    09/30/2022, 2:48 AM
    only snapshots
  • j

    jw

    09/30/2022, 2:50 AM
    there's no reason why we cannot make a release, though. i guess the big problem is that it's hard to know when. things are constantly in flux right now as big things are still landing and we don't have a lot of spare capacity for writing up change logs and migration guides
  • e

    eygraber

    09/30/2022, 2:50 AM
    You could take the CfD approach and just not do change logs or migration guides :trollface:
  • e

    eygraber

    09/30/2022, 2:59 AM
    So until there's a stable release the snapshots will always just be the tip of trunk?
  • j

    jw

    09/30/2022, 3:11 AM
    yep. we pubilsh releases internally as needed for now which can be anywhere from once a week to a few times a week. but that's also because we're still establishing the boundaries and responsibilities of its APIs
  • e

    eygraber

    09/30/2022, 3:29 AM
    Are the snapshots supposed to be published with the build workflow? Looks like that is just publishing to maven local, and the latest snapshot in nexus is from 09/08/2022
    c
    • 2
    • 1
  • j

    jw

    09/30/2022, 3:31 AM
    ah yeah someone updated the publish plugin and broke it
  • d

    Djaka Pradana Jaya Priambudi

    10/03/2022, 10:41 AM
    Hi I have a question regarding how you guys use molecule Suppose you have a interactable state (can be changed by user inputs)
    search
    I see in all of your presentation that you guys declared inside the composable like this:
    @Composable
    fun present(event: Flow<Foo>) {
       var search by remember { mutableStateOf(") }
       ...
    }
    Why do this? Won't this make it hard to split the code into smaller chank? Suppose we have lot of events that modify
    search
    like
    CollectEffect(event) {
     when (it) {
         Event A -> search = it.query
         Event B -> {
             saveToRecentSearch()
             search = ""
         }
         Event C -> ...
      }
    }
    We can't extract event B into a completly different function because
    search
    is inside the
    present
    function I'm a bit confused about this, thank you
  • b

    Benoit Quenaudon

    10/03/2022, 10:42 AM
    Just pass what you need as parameters?
  • d

    Djaka Pradana Jaya Priambudi

    10/03/2022, 10:43 AM
    @Benoit Quenaudon but the new function won't be able to modify the
    search
    ? except if i put lamda parameter
    fun bar(search: String) {
      saveToRecentSearch(search)
      search = "" // Can't do
    }
    fun bar(search: String, changeSerch: (String) -> Unit { // Possible but a bit painful as I need to write `search = it` in the collect efect
      saveToRecentSearch(search)
      changeSearch("")
    }
  • b

    Benoit Quenaudon

    10/03/2022, 10:49 AM
    I cannot think of something else right now but you could pass a lambda as you said
    fun something(searchSetter: (String) -> Unit)
    and call that. I don’t really know how to set a mutableState field manually but if that’s easy, you woudn’t use the delegate on search and would be able to pass
    MutableState<String>
    to the method.
  • b

    Benoit Quenaudon

    10/03/2022, 10:50 AM
    That’s maybe why lots of Android examples are using lambdas
    • 1
    • 1
  • d

    Djaka Pradana Jaya Priambudi

    10/03/2022, 10:52 AM
    There's other option where we can do this if we put the state declaration in the class level:
    class Presenter: MoleculePresenter {
      var search by mutableStateOf(")
    
       @Composable
       fun present(event: Event): State {
          CollectEffect(event) {
             when(event) {
                eventB()
             }
          }
    
          ...
       }
       
       private fun eventB() {
          saveToRecentSearch(search)
          search = ""
       }
    }
    But after seeing lot of presentation from cashapp or regarding molecule, none of them are doing this so I'm curious why they didn't do this
  • b

    Benoit Quenaudon

    10/03/2022, 10:52 AM
    That won’t compile I think. You cannot do
    search = ""
    without delegates.
  • d

    Djaka Pradana Jaya Priambudi

    10/03/2022, 10:53 AM
    updated, but my points still stand
  • b

    Benoit Quenaudon

    10/03/2022, 10:54 AM
    I don’t think so?
  • b

    Benoit Quenaudon

    10/03/2022, 10:54 AM
    There’s no lifecycle outside of the composable method
  • d

    Djaka Pradana Jaya Priambudi

    10/03/2022, 10:55 AM
    the recomposition also works normally just like when we put inside function declaration with remember
  • b

    Benoit Quenaudon

    10/03/2022, 10:57 AM
    Got it, then why not
  • d

    Djaka Pradana Jaya Priambudi

    10/03/2022, 10:58 AM
    thats my question, why not, why not do this in cashapp? I was wondering if there's a gotcha or benefit if we put inside the composable function
  • b

    Benoit Quenaudon

    10/03/2022, 11:01 AM
    The only thing I could think of and which I’m not sure about is around potential problems if the lifecycle of the presenter is different from the calling site of the composable method. Molecule presenters are still pretty recent so we’re still discovering edge cases, so it’s totally possible none of us ran into this yet or didn’t notice it
  • j

    jessewilson

    10/03/2022, 11:08 AM
    I think in practice it can be nice to have exhaustive
    when
    clauses on events, and that outweighs the benefits of decomposing things into different places
Powered by Linen
Title
j

jessewilson

10/03/2022, 11:08 AM
I think in practice it can be nice to have exhaustive
when
clauses on events, and that outweighs the benefits of decomposing things into different places
View count: 4