Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Feb 12 22:57
    sanity labeled #177
  • Feb 12 22:36
    Aivean opened #177
  • Feb 12 22:07
    Derek52 synchronize #176
  • Feb 11 01:46
    Derek52 synchronize #176
  • Feb 11 01:11
    Derek52 synchronize #176
  • Feb 10 01:50
    Derek52 commented #176
  • Feb 10 01:15
    Derek52 synchronize #176
  • Feb 09 03:51
    sanity commented #176
  • Feb 09 01:27
    Derek52 commented #176
  • Feb 09 00:33
    Derek52 synchronize #176
  • Feb 08 23:20
    Derek52 synchronize #176
  • Feb 08 23:14
    Derek52 synchronize #176
  • Feb 08 23:00
    Derek52 synchronize #176
  • Feb 08 20:55
    Derek52 commented #176
  • Feb 08 18:05
    sanity commented #176
  • Feb 08 15:51
    Derek52 commented #176
  • Feb 08 01:17
    sanity commented #176
  • Feb 07 21:05
    Derek52 commented #176
  • Feb 07 20:56
    Derek52 commented #176
  • Feb 07 20:54
    Derek52 synchronize #176
Raphael Panic
@rpanic
I don´t neccecarily need it at the moment, but I guess it has to be implemented at some point in the future
Should I create an issue for it?
Ian Clarke
@sanity
@rpanic Yes, please create an issue, it will be easy enough to add this functionality, we just need to decide on how best to do it
Raphael Panic
@rpanic
@sanity Ok, perfect
Ian Clarke
@sanity
FYI - work-in-progress, cleaning up Kweb "god" class: https://github.com/kwebio/core/pull/63/files
Ethan Davidson
@ethanmdavidson
@sanity re: #64 (people searching for validation)
just curious, how do you know this?
Ian Clarke
@sanity
@ethanmdavidson It's through an analytics tool called Inspectlet which I have on the user manual, it tracks search terms among other things.
@ethanmdavidson I'm not sure of the priority, but I try to note when I see people are searching for something and not finding it in the user manual - it can be a good indicator of what needs improvement.
Benjamin Dupont
@Benjozork
hello, do you accept donations/bounties ?
Ian Clarke
@sanity
@Benjozork We haven't done that before, but we're certainly open to it. Did you have something specific in mind?
Patrick Cousins
@patrickcousins
(posted in kotlinlang slack as well) anyone get an error like this?
22:19:38.858 [qtp2129221032-26] ERROR io.kweb.WebBrowser - JavaScript message: 'Cannot read property 'parentNode' of null' Caused by executing: 'document.getElementById("Kg").parentNode.removeChild(document.getElementById("Kg"));': at io.kweb.Kweb.execute(Kweb.kt:323) at io.kweb.WebBrowser.execute(WebBrowser.kt:48) at io.kweb.dom.element.Element.execute(Element.kt:40) at io.kweb.dom.element.Element.delete(Element.kt:290)
for reference I am trying to do something like this
render(boolKVar) { if (boolKVar.value) { div().new { p().text("Loaded.") } } else { div().new { p().text("Loading...") } } }
Ian Clarke
@sanity
@patrickcousins I'm not sure if this is the cause of your problem, but that should be render(boolKVar) { bool -> if (bool) {...

A more idiomatic and slightly more efficient version would be something like:

    div().new {
      p().text(boolKVar.map { if (it) "Loaded." else "Loading..." })
    }

If that doesn't fix it, could you file an issue, with as much relevant info as you can provide? https://github.com/kwebio/core/issues/new - I'll look into it ASAP.

Patrick Cousins
@patrickcousins
that looks much cleaner thank you. I had wondered if I should be using .map but got confused by the reversable function stuff. I ended up finding a different hacky work around but I will try .map next time I dig in. Thanks again for the reply! kweb is amazing!
Ian Clarke
@sanity
@patrickcousins Hmm, it should be rare that library users need to use reversible mappings - it's mostly useful for internal stuff. Perhaps I'll add a note to the docs to that effect.
Raphael Panic
@rpanic
@sanity as we discussed a few weeks ago, there are a lot of cases where you need reversible mapping. Thats why you added it to the docs in the first place 😏
Ian Clarke
@sanity
@rpanic Don't worry, it's still documented :)
Linus Brimstedt
@brimstedt_twitter
Hi! One question I'm missing on the faq is if you (keen)
(keen) handles web server failovers. For example, if one server dies and use is forwarded to another backend node
(#
(sorry for the bad writing, my phone is playing tricks on me .. keen=kweb above)
Linus Brimstedt
@brimstedt_twitter
(sorry for the bad writing, my phone is playing tricks on me .. keen=kweb above)
Linus Brimstedt
@brimstedt_twitter
I.e. how important is the server session and what is kept in it? I see you compare a bit to vaadin, where session is quite heavy
Ian Clarke
@sanity
@brimstedt_twitter Kweb’s architectural approach means that you can hit “reload” in your browser and rarely lose anything of importance. This is because, while it does maintain session state, this state can be “reconstructed” automatically in the event that the session is lost.
@brimstedt_twitter For this to work well it’s important to represent the important state of the UI (eg. what part are you looking at) in the URL, but Kweb’s routing makes that easy, and that’s best practice anyway.
@brimstedt_twitter You can try it out by going to the demo at http://demo.kweb.io:7659/, making some edits - and then refresh the page, note how it is reconstructed identically.
@brimstedt_twitter Does that answer your question?
Linus Brimstedt
@brimstedt_twitter
No, not really.. the question was more about how dependent kweb is on server session
I.e. do I need sticky sessions and shared session storage of some sort?
If one webserver crashes and another one takes over, will the end user notice?
Ian Clarke
@sanity
The page would refresh when the websocket is broken, but assuming the page routing had been implemented intelligently - that should be barely noticeable.
So the simple answer to your question is: No, you shouldn’t need to worry about persisting sessions across servers, sessions in Kweb are assumed to be quite transient.
Linus Brimstedt
@brimstedt_twitter
Ok, thanks :-)
Ian Clarke
@sanity
Announcement: New version, I've reworked the render mechanism to make it more robust, by wrapping the rendered content in a <span>: https://github.com/kwebio/kweb-core/releases/tag/0.4.26
Ian Clarke
@sanity
I'm a little concerned about "silently" inserting a "span", but avoiding it would require doing a lot of housekeeping to allow elements to be replaced in-place (something that wasn't working previously)
Damian Lall
@PotatoCurry
How do I generate head/meta HTML via the DSL?
Ian Clarke
@sanity

@PotatoCurry Something like this should work:

Kweb(port = 7659) {

        doc.head.new {
            title().text("Hello")
        }

You can also add stuff to the <head> by creating a simple plugin to add to the <head> element by overriding KwebPlugin.decorate().

Raphael Panic
@rpanic
Hello,
Im not quite sure if thats duplicate or not.
But is there a way to use static files like images?
Damian Lall
@PotatoCurry
How can I handle file uploads?
Vikrant Sagar
@hellcoderz
hello all, qq is there an autoreload mode .. i cant seem to find the option but i see message [main] INFO Application - Autoreload is disabled because the development mode is off.
thanks
Sergey Kokorin
@kokorins
Hi, is there any example how to make oauth2 with kweb?
Ian Clarke
@sanity
@kokorins I'm not aware of any I'm afraid. I don't have much experience with oauth2 but I can't think of any reason that it wouldn't work with Kweb - and there does appear to be some Kotlin libraries for oauth2 - like this one: https://github.com/mazine/oauth2-client-kotlin
Sergey Kokorin
@kokorins
Yes, this is all for server side authorization, the issue with kweb that I would like to have client side one
but external redirection doesnt work with kweb
Ian Clarke
@sanity
@kokorins I'm afraid I'm not familiar enough with oath2 to offer advice, my suggestion is to ask a question here: https://github.com/kwebio/kweb-core/issues, it's a lot more widely read by Kweb users than this chat room.