Andromadus Naruto
08/06/2022, 9:08 AMWilliam Persall
10/02/2022, 6:00 PMgammax
10/08/2022, 7:22 AMFlorent Martin
10/21/2022, 7:11 AMMagnus Nilsson
10/24/2022, 5:19 PMstyled()
from mui (https://mui.com/system/styled) using kotlin-wrappers? I tried this but it does not seem to work (I guess because the imported styled is emotion.styled.styled
).
val MyBox = Box.styled { props, _ ->
<http://props.sx|props.sx> {
display = responsive(
<http://Breakpoint.sm|Breakpoint.sm> to Display.none,
Breakpoint.md to Display.flex,
)
flexGrow = responsive(
Breakpoint.md to number(1.0),
Breakpoint.lg to number(3.0),
)
}
}
Joffrey
11/06/2022, 3:37 PMRBuilder
-> ChildrenBuilder
), but I find no migration guide. Where can I find information apart from the very succinct summary from the CHANGELOG.md
?
For instance, how should I define the react entrypoint now? I used to use:
val store = initRedux()
render(rootElement) {
provider(store) {
application()
}
}
With application
being an extension function on RBuilder
. However I get a deprecation warning on render()
, but with no ReplaceWith
nor explanation about what I should use instead. Any hints?Sam Gammon
11/10/2022, 4:07 AMSam Gammon
11/10/2022, 4:07 AMSam Gammon
11/10/2022, 4:07 AMRobert Jaros
11/11/2022, 1:43 PMdom.html.*
external classes? Is dom.html.HTMLDivElement
the same as org.w3c.dom.HTMLDivElement
? Can I safely cast one to the other? @turanskyHaruki
11/14/2022, 7:10 PMi("fa-light fa-trash-can"){}
as we implement it on static HTML by <i class="fa-light fa-trash-can"></i>
. However, this doesn't work since it seems like the way I added the class attribute doesn't work. I would like to know how you usually add fancy icons and class attributes on kotlin react.
import react.*
import kotlinx.coroutines.*
import react.dom.html.ReactHTML.h1
import <http://react.dom.html.ReactHTML.li|react.dom.html.ReactHTML.li>
import react.dom.html.ReactHTML.ul
val App = FC<Props> {
h1 {
+"Full-Stack Shopping List"
}
}
Dmitriy Malayev
11/17/2022, 8:10 PMPiotr Krzemiński
11/18/2022, 2:20 PMType mismatch: inferred type is org.w3c.dom.Element but dom.Element was expected
with this code:
fun main() {
createRoot(document.createElement("div").also { document.body!!.appendChild(it) })
.render(App.create())
}
when bumping from kotlin-wrappers pre.430 to pre.431. What’s the new API? could you update kotlin-mui-showcase?Partho Paul
11/19/2022, 11:55 AMbrowserProductionWebpack
, but not able to figure out how to start the app.Leon
11/23/2022, 2:09 PMReact.lazy
in kotlin/JS?
Thank you for any advise and providing reference.Mark Vogel
11/29/2022, 9:33 PMdiv
to Kotlin React? I can post the package.json dependencies if needed as well
return (
<div
style={
isDraggedOver
? {
border: "dashed 2px #abcdef",
borderRadius: "5px",
minHeight: "5rem",
boxSizing: "border-box",
gridColumn: `span ${size}`
}
: { gridColumn: `span ${size}` }
}
onDrop={onDrop}
onDragEnter={onDragEnter}
onDragLeave={onDragLeave}
onDragOver={(e) => e.preventDefault()}
>
{!isDraggedOver && children}
</div>
);
Mark Vogel
11/30/2022, 4:34 PMreact-icon
components is?
import { AiOutlineClose } from "react-icons/ai";
import { FiMinimize2 } from "react-icons/fi";
<FiMinimize2 className="rounded-circle hand-style" color="white" onClick={() => { handleTriggerClick(index) }} />
<AiOutlineClose className="rounded-circle" color="white" />
Perhaps using MUI?Piotr Krzemiński
12/01/2022, 1:46 PMDmitriy Malayev
12/12/2022, 4:34 PMLeon
12/20/2022, 3:15 PMreact-redux
wrapper for my project.
I am referring this example project.
But in the main.kt
file, I noticed that the provider
component is RBuilder
.
But I am using react.FC
component from kotlin-react
wrapper.
Can anyone please let me know how to place provider
component with my store
prop inside createRoot(container).render(//root FC component)
?
import browser.document
import react.create
import react.dom.client.createRoot
fun main() {
val container = document.getElementById("root") ?: error("Couldn't find root container!")
createRoot(container).render(AppRouter.create{})
}
My main.kt
file looks like this
But I couldn’t put provider
component..Cheick Kante
12/28/2022, 8:32 PM@file:JsModule("react-markdown")
@file:JsNonModule
package <http://components.blog|components.blog>
import react.ComponentClass
import react.Props
import react.PropsWithChildren
@JsName("default")
external val ReactMarkdown: ComponentClass<MarkdownProps>
external interface MarkdownProps : PropsWithChildren{
var remarkPlugins : Array<dynamic>
}
and my remark file looks like (but won't get picked up by react-markdown)
@file:JsModule("remark-gfm")
@file:JsNonModule
package <http://components.blog|components.blog>
@JsName("default")
external val RemarkGfm: dynamic
I hook them up as below, and as stated earlier, I get the rendered content however remark does not get applied.
ReactMarkdown {
remarkPlugins = arrayOf(RemarkGfm)
+content
}
Sam Gammon
01/01/2023, 2:50 AMnative-image
is supported out of the box.
• 🚀 Trying it out
curl -sSL --tlsv1.2 dl.elide.dev/cli/install.sh | bash -s -
👆 the one liner works on Darwin (amd64/arm64), and Linux (amd64) so far.If you prefer NPX:
npx @elide-dev/elide@alpha shell
:kotlin-intensifies-purple: Building Kotlin apps with it
•
Elide can be used as a plain library with a regular Micronaut server, and Ktor support is on the way. There are Maven artifacts in a custom repository which is easy to use during the alpha; you can see a sample here.
• :gradle: Gradle plugin
You can easily install the Gradle plugin to build your frontend assets and your Kotlin/JS, and package it into your server binary. It will handle building for SSR and CSR both, so you can easily switch between browser rendering modes. Check it out here. Maven and Bazel support are planned.
• 🖥️ Using the shell
elide shell
drops you into a shell just like Node (see attached screenshot), the difference being the URL
class we're using here is implemented in Kotlin, backed by the road-tested power of Micronaut, KotlinX, Netty, and the Java standard library. It has simply been adapted for use in JavaScript, according to the WhatWG URL Spec.
• :js: Use Kotlin/JS or regular Node stack
Elide packages and consumes your JS/TS with built-in support for esbuild
, so you can use a standard Node toolchain or the Kotlin/JS stack.
• 💨 Super fast React SSR
Because Elide is basically Kotlin with a super-fast JS runtime attached, it can do JS SSR without leaving the JVM. This can soon be drop-in compatible with many React apps. You can see a live sample here to confirm it is fast and server-rendered. The code for that sample is pasted below to show how simple it is to call back and forth between Kotlin and your React app:
@Page class Index : PageWithProps<YourProps>(YourProps.serializer()) {
// Serve React SSR.
@Get("/") suspend fun indexPage(request: HttpRequest<*>) = ssr(request) { // 1: tell the server we're going to do SSR for this request
head {
title { +"Hello, Elide!" }
stylesheet("/styles/base.css")
stylesheet("/styles/main.css")
script("/scripts/ui.js", defer = true) // <-- 2: serve the CSR bundle so it can hydrate the react SSR response
}
body {
injectSSR(this@Index, request) // <-- 3: execute the JS VM to produce the SSR response, and splice it into the server response
}
}
}
• 🐙 Contributors needed
The future of software is much more polyglot than today's paradigm: developers love to fight about frameworks, but at the end of the day, we're all writing code, and eliminating barriers between languages means easier collaboration and more value for all of us. It shouldn't be a Node vs. The World or a Rust vs. The World argument; we should get to pick and pull the best code we want from anywhere and use it to build our apps, especially from a multi-platform language like Kotlin.
This runtime and framework are designed for that future. *If you agree, join us and make a dent in the universe*; you'll have a chance to be impactful and shape a brave new idea from the ground up.
• 🙏 Thank you
We chose Kotlin because of the fantastic community. 2023 will be a massive year for Kotlin, and we think that betting the farm on it is reasonable and smart. We are super excited about what JetBrains and Kotlin have in store for us with K2, context receivers, value classes... just so much to look forward to.
Cheers and happy new year, Kotlin devs,
:kotlin-intensifies-purple: sam
Posted in #feedspierce7
01/01/2023, 6:04 PMWietlol
01/01/2023, 11:18 PMDirk
01/02/2023, 8:29 PMandylamax
01/03/2023, 1:30 AMLuc Girardin
01/10/2023, 9:35 PMModule not found: Error: Can't resolve '@mui/system' in '/Users/luc/kotlin/macrofocus/build/js/node_modules/@mui/x-date-pickers/MonthPicker'
Module not found: Error: Can't resolve '@mui/system/Box' in '/Users/luc/kotlin/macrofocus/build/js/packages/macrofocus-eflux-app/kotlin'
Any idea what could be the cause and a possible fix?!?Salman
01/11/2023, 1:15 PMDirk
01/18/2023, 2:16 PMBegum Turan
01/20/2023, 2:45 PMBegum Turan
01/20/2023, 2:45 PMCLOVIS
01/20/2023, 5:17 PMmain
function client-side? You say it's "not rendering", what do you see exactly, is there an error message in the console?Begum Turan
01/20/2023, 5:45 PMCLOVIS
01/21/2023, 7:56 PMindex.html
look like?Begum Turan
01/22/2023, 11:00 PMCLOVIS
01/23/2023, 8:49 AM<project-name>-<module-name>.js
, for example https://gitlab.com/opensavvy/decouple/-/blob/main/demo/web/src/main/resources/index.html#L12Begum Turan
01/23/2023, 3:34 PMCLOVIS
01/23/2023, 4:22 PMbuild/js/packages/<module name>
Begum Turan
01/23/2023, 5:57 PMCLOVIS
01/23/2023, 6:43 PMprintln
at the start of your main and check the console to see if it gets executed at all?type="module"
is necessaryBegum Turan
01/23/2023, 7:45 PM