Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Tim Nieradzik
    @tindzk
    @drdozer We could add script to bindings.HTML. We probably hadn't added it in the first place because usually JavaScript dependencies are included in the HTML file.
    Would the jsdeps approach suggested by @mkotsbak work for you?
    I've responded to your other questions on the GitHub issue.
    keenz
    @kindlychung
    How does widok compare to udash? https://github.com/UdashFramework/udash-core
    Tim Nieradzik
    @tindzk
    Udash looks really nice. It's written in a modular way and relies on ScalaTags for rendering.
    Widok's DSL is slightly more succinct. Judging from Udash's TodoMVC example you may still need to use jQuery to manipulate nodes.
    keenz
    @kindlychung
    What would be the advantages/disadvantages for each of them?
    @tindzk
    Marius B. Kotsbak
    @mkotsbak
    Udash more batteries included (rpc etc)? While widok syntax maybe a bit cleaner?
    Tim Nieradzik
    @tindzk
    @kindlychung Widok is more lightweight in its design. For example, it has fewer external dependencies and there are some features in Udash that it is lacking (for example RPC or I18N)
    @kindlychung I would also recommend you to have a look at MetaWeb which is a complete redesign of Widok. The goal is to address some conceptual issues and have a smaller core.
    Matthew Pocock
    @drdozer
    so far I have a single page widok application -- how do I alter my code/build/html to convert to a site with mulptiple, independent widok pages?
    Marius B. Kotsbak
    @mkotsbak
    Matthew Pocock
    @drdozer
    OK, so this is in my fooJS sbt module?
    Marius B. Kotsbak
    @mkotsbak
    @tindzk time for a new release?
    Nothing new in sbt if you don't mind having all code available for all pages
    Matthew Pocock
    @drdozer
    is there a worked example of this? I'm running the server on akka-http, and I'm not quite seeing how the client-side routes marry up to the resources that I serve up.
    Marius B. Kotsbak
    @mkotsbak
    Else you probably need to make multiple submodules with different main classes
    Here is a routing example: https://github.com/widok/skeleton/blob/master/js/src/main/scala/io/widok/client/Application.scala This is a client side thing, nothing to do with server side routes
    Matthew Pocock
    @drdozer
    I want to have the URLs /sandpit.html and /tutorial.html work, along with some static content at /.
    Matthew Pocock
    @drdozer
    oh ... ok - I've fired up the skeleton application, and all the routing stuff is after the fragment in the URL
    Marius B. Kotsbak
    @mkotsbak
    Yes, I guess all is behind a #
    Why can't you do it like that?
    Matthew Pocock
    @drdozer
    that isn't going to make it through our group URL policy -- yes we do actually have such a thing
    Marius B. Kotsbak
    @mkotsbak
    Hehe ok, then it will be separate physical pages
    Maybe all could point to the same application, and get the widok router to read physical page urls too
    Matthew Pocock
    @drdozer
    yeah - but does that mean making separate widok client projects for each page? and then ending up with a whole bunch of large, nearly-identical javascript libraries? or would I end up with a per-application bla-launcher.js that is relatively small?
    Marius B. Kotsbak
    @mkotsbak
    If you want to optimize the size of the generated js for each page it has to be done like that. Each page might not use all of the code, so that the closure compiler could skip some part of it
    If size does not matter, I would say rather point to the exact same .js file (which could be cached by the client between each page)
    And then read the url for the app to react properly according to the page
    Or if you make your own Application class not extending JSApp you could launch it manually with parameters given from the html file
    Matthew Pocock
    @drdozer
    OK, I've looked in a launcher.js-- so one solution would be to have a bunch of object ABC extends PageApplication entry points, each of which produces its own launcher_ABC.js files that I can then load?
    Marius B. Kotsbak
    @mkotsbak
    Well, launcher is so simple that you just can make it yourself? Put the content in a script tag in each web page
    Matthew Pocock
    @drdozer
    What genertes -launcher.js? Is that standard sjs magic?
    Marius B. Kotsbak
    @mkotsbak
    object ABC extends PageApplication probably would not work with more than one in each module, as there should be just one main class
    The sjs sbt plugin I think, or the compiler
    Matthew Pocock
    @drdozer
    ok thanks - I've found the relevant bit of the sjs documentation
    Marius B. Kotsbak
    @mkotsbak
    ok
    Matthew Pocock
    @drdozer
    I'm using the ACE editor a lot. To hook it into a page, you call ace.edit(elementId) to attach the editor code to the div with that ID.
    So would I have to subclass View and over-ride render(parent, offset) to run the relevant javascript?
    and this will only work if the view is part of the page, so only if when you render a child, the parent is already added to the page
    Matthew Pocock
    @drdozer
    what I really need is an onAddedToPagecallback
    Matthew Pocock
    @drdozer
    OK, I've found a work-around
      override def render(parent: Node,
                          offset: Node) = {
        super.render(parent, offset)
        js.Dynamic.global.window.setTimeout(registerAce _, 0)
      }
    Marius B. Kotsbak
    @mkotsbak
    But it has issues: mkotsbak/widok-scalajs-react-wrapper#1
    Matthew Pocock
    @drdozer
    mm
    Marius B. Kotsbak
    @mkotsbak
    The widgets really should get callbacks when they are added and removed from the dom
    Matthew Pocock
    @drdozer
    I don't think you even need to use much magic for this, right? You just need to propagate it up from the root node when that is added
    Marius B. Kotsbak
    @mkotsbak
    Well when it is added you probably know because it is then constructed