https://kotlinlang.org logo
Docs
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
compose-web
  • d

    Daniele B

    11/22/2020, 5:14 PM
    Here some thoughts about Compose-Web. In my opinion it’s irrelevant if it’s DOM-based or Skia-based. What I believe the goals should be: • the smallest file size • SEO-friendly
    👍 3
    a
    a
    • 3
    • 2
  • d

    Dmitry Romanov [JB]

    11/23/2020, 10:38 AM
    Hey folks! During one of the JetBrains Hackathons we tried to adapt Jetpack Compose for the JavaScript world. The main idea was to allow you to share code/expertise between platforms and to build web applications in pure Kotlin. And we would like to collect your feedback before continuing our experiments with this technology. Please take a look at the compose-for-web-demos and join the #compose-web channel. Note: Please read the description and disclaimer carefully.
    ❤️ 19
    :kotlin-intensifies: 7
    s
    • 2
    • 2
  • r

    Robert Jaros

    11/23/2020, 12:13 PM
    This repository contains only the sources of the demo apps. Are the sources of the framework itself (compiler plugin, libraries) available somewhere?
    o
    b
    • 3
    • 2
  • j

    John O'Reilly

    11/23/2020, 3:58 PM
    Looks like above repo makes use of snapshot version of
    multiplatform
    plugin...is that definitely also needed to get this to work?
    b
    • 2
    • 2
  • f

    Foso

    11/23/2020, 6:18 PM
    The disclaimer on the Github Page says: "and the JetBrains team doesn't have any plans to support or develop it", but at the bottom is written "P.S. JetBrains plans to continue experimenting with this technology and we are looking for UI Framework Developer". I find this a bit confusing
    a
    r
    +4
    • 7
    • 10
  • d

    Daan

    11/29/2020, 12:39 PM
    @bashor and @Dmitry Romanov [JB], did you guys literally add web support to compose within 48 hours (and had time to write 6 demos)? This is the real story here IMO. You're making me feel like a 0.1x programmer.
    :godmode: 10
    j
    b
    +2
    • 5
    • 4
  • d

    Daan

    11/29/2020, 1:16 PM
    Could compose web be implemented without a virtual DOM? Because vdom is one of the reasons why I eschew frameworks like React. It makes development easier but produces slower, more memory intensive applications.
    j
    d
    r
    • 4
    • 7
  • s

    shikasd

    12/29/2020, 5:07 PM
    Good news, everyone! After couple of months of working on the compiler plugin, compose actually compiles and works in the browser! It is, obviously, only the beginning for the web version, as we don't have any proper API for building the DOM or anything else. Feel free to contribute/create something your own on top, if you want to! 😅 See the original tweet for the announcement and the repo links: https://twitter.com/shikasd_/status/1343350375248760832?s=20
    :kotlin-intensifies: 9
    👍 21
    🚀 1
    🎉 32
    r
    d
    +4
    • 7
    • 14
  • a

    altavir

    01/12/2021, 5:23 PM
    @shikasd I got really sick and tired of React and thinging about other systems. I would like to try compose, but I have some reservations. I need to include external element-bound components like canvas. Is there a simple way to add it to compose-web. The second question is about compiler: do I still need to use unstable compiler version?
    s
    t
    • 3
    • 7
  • s

    spierce7

    02/10/2021, 8:27 PM
    So is this actively being worked on?
    j
    t
    s
    • 4
    • 3
  • j

    jw

    02/10/2021, 8:33 PM
    I have a vested interest in making the compiler and runtime work on JS and native and have landed some CLs to ensure the runtime will work. Others have sent small changes to the compiler to enable JS. It should be pretty close to usable. I don't particularly care about Compose UI
    s
    a
    +2
    • 5
    • 20
  • d

    Didier Villevalois

    02/26/2021, 3:03 PM
    Hi everyone! Where can I find the latest version of the compose compiler plugin to use for a test compose for web test project? Is it compatible with kotlinc 1.4.30? Also where can I find the compose runtime for js? Thanks for your help!
    j
    s
    • 3
    • 4
  • n

    note8g2018

    03/03/2021, 10:13 AM
    Please tell Google to update the code lab for jetpack compose https://developer.android.com/courses/pathways/compose It is not working now Because the code is old and there are many huge changes in the framework jetpack compose Google should update the code
    j
    j
    +2
    • 5
    • 10
  • e

    eygraber

    03/03/2021, 9:41 PM
    Will canvas kit have any impact on this project https://skia.org/user/modules/canvaskit
    j
    c
    +6
    • 9
    • 19
  • l

    Lazard

    03/08/2021, 8:37 AM
    Hi ! I had a naïve thought and I would love if someone could tell me about it. I get that Compose Web currently uses Skia to draw on a HTML canvas (do I make a mistake here ?) Some people (myself included) would prefer sticking to DOM elements for accessibility reasons etc. What about writing a Kotlin/React wrapper using Compose API ? Making
    Box
    render divs,
    Column
    render divs with
    flex-direction: column
    and so on. If it was possible, we could theoretically use Compose components in browser environnement, using the DOM right ? Obviously it cannot be so easy, but I would like to know why. I've never worked on Compose before so surely there's something misunderstood. Thanks for you answers 🙏
    o
    m
    • 3
    • 3
  • d

    Didier Villevalois

    03/16/2021, 5:56 PM
    @shikasd (and others), I've been playing with your demo (https://github.com/ShikaSD/compose-browser-demo) a bit. My current plan for now is to build on it to integrate some MDC components (https://github.com/material-components/material-components-web) to build a small material layer (I don't need much: button, select, ...) and some base layout components (Row and Column using flex, Box and maybe Layout using absolute positioning). Could we extract/publish your prelude and runtime binaries as a temporary project so that we can work together ?
    ❤️ 3
    s
    b
    • 3
    • 11
  • a

    Abdalla Hassanin

    03/22/2021, 1:08 PM
    Hi everyone! I want to know how to do collapsing-toolbar layout in jetpack compose android
    d
    • 2
    • 1
  • e

    ESchouten

    03/23/2021, 2:05 PM
    Jetbrains is working on Compose Web! https://schahen.github.io/compose-web-demos-showcase/ https://github.com/Schahen/compose-web-demos-showcase
    👍 5
    :kotlin-intensifies: 24
    👍🏼 1
    m
    s
    d
    • 4
    • 5
  • s

    Slackbot

    03/27/2021, 5:44 PM
    This message was deleted.
    :lol: 2
    c
    s
    • 3
    • 6
  • a

    altavir

    04/07/2021, 3:14 PM
    https://twitter.com/shikasd_/status/1379757917893722114?s=20
    🎉 32
    ❤️ 10
    :party-parrot: 11
    :kotlin-intensifies: 47
    👏 12
    b
    s
    +3
    • 6
    • 7
  • a

    Alex Nabrozidis

    04/09/2021, 9:15 AM
    Given this ^ awesome news, is there a way for me to start toying with compose-web? I'm rebuilding parts of an app I'm working on with jetbrains/jetpack compose and I'd love to enable js support even if it's unoptimal. I want it to include it early on so at least it gives me a hint on how to go around designing the common UI parts. I've already done that part with the non-ui layer (I can't wait for kotlinx-datetime to go a bit more stable <3) In the meantime I'm waiting for a js sample in this repo https://github.com/JetBrains/compose-jb/ very exciting stuff and kudos to everyone involved ❤️
    a
    j
    +2
    • 5
    • 6
  • o

    olonho

    05/04/2021, 11:15 AM
    Today we’re announcing a Technology Preview of Compose for Web – an experimental Kotlin UI framework for web programming! For details and information to get started, read the announcement blog post at https://blog.jetbrains.com/kotlin/2021/05/technology-preview-jetpack-compose-for-web/. We hope you’ll enjoy Compose for Web – and please do not forget to share your feedback!
    🎉 48
    :kotlin-intensifies: 68
    🔥 4
    h
    • 2
    • 2
  • j

    jw

    05/04/2021, 11:43 AM
    Are you looking into isomorphic rendering? One of the things I couldn't get working (with my own Compose DOM implementation) was to render an initial tree on the server and resume it on the client without re-emitting the initial DOM tree. Maybe that initial re-render isn't terrible, but it'd be nice to skip it.
    o
    s
    +4
    • 7
    • 12
  • a

    altavir

    05/04/2021, 11:48 AM
    Does it support exposing DOM elements? Like in this issue. If it is I can start using it in our visualization projects
    o
    o
    • 3
    • 4
  • s

    spierce7

    05/04/2021, 2:34 PM
    I love that you guys are experimenting with 2 separate APIs for compose web. Have you considered a canvas rendered API that can very accurately render the same widget across desktop, android and web? I’ve found I typically work on teams that create private websites behind an auth barrier, where SEO isn’t relevant. In a lot of these cases, I’d prefer a canvas rendering between Desktop, Mobile, and Web, where I had some level of confidence that there was consistency between the platforms. Have you guys considered providing a canvas solution?
    👍🏻 1
    👍 6
    j
    o
    +2
    • 5
    • 7
  • s

    spierce7

    05/04/2021, 2:44 PM
    Compose for web is only available with the JS IR compiler, which doesn’t support source-maps, right?
    o
    b
    c
    • 4
    • 8
  • j

    John O'Reilly

    05/04/2021, 3:26 PM
    All the Compose Web samples seem to use
    multiplatform
    plugin......is that necessary or can you just have module containing compose web code with dependency then on a separate multiplatform module?
    j
    o
    • 3
    • 17
  • g

    Greg Steckman

    05/05/2021, 3:30 AM
    Trying out the "multiplatform widgets" I see that for the web they are in a different package than on desktop, e.g. org.jetbrains.compose.common.material.Button vs androidx.compose.material.Button. The function signatures are also not the same. IntelliJ isn't finding the source code, and I can't find it in https://github.com/jetbrains/compose-jb. Where can I find the source code to see what other widgets currently have an implementation?
    o
    • 2
    • 2
  • s

    spierce7

    05/05/2021, 2:26 PM
    What is the intended purpose of the jvm source set inside of web module? https://github.com/JetBrains/androidx/tree/compose-web-main/compose/web/src
    o
    • 2
    • 1
  • e

    Equilat

    05/06/2021, 12:47 PM
    Hi ! I'm discovering the new Jetpack Compose for web. I discovered the ability to write Stylesheets in Kotlin. For non Kotlin supported properties, there is the property(propertyName: String, value: StylePropertyValue). I would like to be able to add a font family from ttf file to my style. I know there is the @font-face in css but how could I manage to use it with the property(...) thing ?
    ✅ 2
    s
    • 2
    • 2
Powered by Linen
Title
e

Equilat

05/06/2021, 12:47 PM
Hi ! I'm discovering the new Jetpack Compose for web. I discovered the ability to write Stylesheets in Kotlin. For non Kotlin supported properties, there is the property(propertyName: String, value: StylePropertyValue). I would like to be able to add a font family from ttf file to my style. I know there is the @font-face in css but how could I manage to use it with the property(...) thing ?
✅ 2
s

SerVB

05/06/2021, 12:51 PM
Hi! You can at least use this one: https://youtrack.jetbrains.com/issue/KT-34124
e

Equilat

05/06/2021, 2:52 PM
Thanks for your help ! It worked 😉
🚀 1
View count: 3