by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • May 24 22:09

    Bobris on master

    Allow to override `b.asset`. (compare)

  • May 21 19:59

    Bobris on master

    Added `useCallback` hook. Added `useReducer`. (compare)

  • May 20 07:43
    YossiBenZaken commented #106
  • May 20 07:42
    YossiBenZaken closed #106
  • May 20 07:31
    Bobris commented #106
  • May 20 07:18
    YossiBenZaken reopened #106
  • May 20 07:18
    YossiBenZaken commented #106
  • May 20 07:18
    YossiBenZaken commented #106
  • May 17 09:33

    Bobris on master

    Fixed missing handler in chain … (compare)

  • May 15 23:06

    Bobris on master

    Fixed JSX compatibility with Ty… (compare)

  • May 13 22:46

    Bobris on master

    Fixed bug in router when routes… (compare)

  • Apr 14 22:24

    Bobris on master

    Fixed `vdomPath` search for Por… (compare)

  • Apr 14 19:32
    Bobris closed #107
  • Apr 14 19:32

    Bobris on master

    Failing tests (#107) for Portal… (compare)

  • Apr 14 13:53
    krewi1 opened #107
  • Apr 13 18:57
    Bobris commented #106
  • Apr 13 18:22
    YossiBenZaken closed #106
  • Apr 13 18:19
    YossiBenZaken commented #106
  • Apr 13 16:16
    Bobris commented #106
  • Apr 13 11:22
    YossiBenZaken edited #106
David Johnson
@dmjio
@Bobris yes, now I just need to write it :) My constraints are a little unique since I need to share the types of the client and the server in one place, then implement the virtual dom stuff on the client project (then compile it with ghcjs), and share the controllers / routes with the server code (compile it w/ ghc). So I can't (as of right now) store references to javascript objects in the virtual dom since the server code wouldn't know what to do with them.
@Bobris sorry for all the questions :), but I was also curious, react says it turned an O(n^3) algorithm into a O(n) algorithm using "heuristics", can you speak to what heuristics they are using? It seems that if the only diffs you're detecting are styles, classes, and attribute changes you can apply the changes in constant time. At what point does the diff algorithm spiral into O(n^3) ? And what assumptions does bobril make to keep this from happening?
Boris Letocha
@Bobris
@dmjio Does something prevents you to have 2 implementations of "same" library? for sever and client. Then you can have identical code for your application, that's what counts.
heuristics are "key" fields which helps to match children order. You as developer has to provide this heuristic.
David Johnson
@dmjio
@bobris, yes the goal is to have some identical code. To share controllers, routes, types. The models will need to be different, so the plan is to use an interface (typeclass in haskell). And implement it differently on server vs. client. So model . getPerson on the client issues ajax to the server, and on the server does a db lookup.
I want the virtual dom on the server to generate HTML to send to client, and on the client it should do a diff. I'm trying to model this based off of elm
@Bobris, react says "heuristics" it just means they don't try to diff structures that are too different. They'll just recreate from scratch. Kind of cheating :) They make it sound all scientific
David Johnson
@dmjio
@Bobris Does bobril copy react's event delegation mechanism?
Boris Letocha
@Bobris
@dmjio Yes it really sounds like cheating, but it looks like very usefull simplification which solves most of real world usecases. Bobril event delegation is similiar to react, but still very different. Bobril abstracts events much more compared to React.
Boris Letocha
@Bobris
Bobril 3.0.0 released. Removed IE8 support, saved 12% on size.
Boris Letocha
@Bobris
Bobril published on npm!
Matt
@maxpen
nice does it also have a UI library like jquiry UI?
Boris Letocha
@Bobris
@master412160 Sorry, it has nearly two, but both are closed source.
Matt
@maxpen
why?
Boris Letocha
@Bobris
It is not so simple to find somebody working for free :-)
David Johnson
@dmjio
lol
Boris Letocha
@Bobris
Andrew Gaydenko
@gaydenko
Hi! Is it possible to to remove a virtual DOM subtree asynchronously, say, for fading out?
Boris Letocha
@Bobris
@gaydenko See example http://bobris.github.io/Bobril/router2/index.html#/planets - planets are animated exactly using "async" fade out, althrough it is done from client code - this is not needed to have it core
Client code for this animation is generic it does not know what "router" wants to show next and it remebers old virtual dom so it can display both versions old and new together
Andrew Gaydenko
@gaydenko
@Bobris , hi! An animation is just an example. There can be other operations on node removing (AJAX call, some asynchronous cleanup using external API based on promises, and so on). Imagine fading out with random period and a condition the next planet can be shown only when the previous one is completed (that is removed from the real DOM).
Boris Letocha
@Bobris
@gaydenko I mean by it, that after deep thinking about async clean up, it must be solved by client code in model (Flux). It is impossible to reasonably solve it VirtualDom itself. One of problems in really simple case is order of children. Say you have one child you don't want to show it, but it has async destroy so it stay in DOM. Then you add new child, and question is should it shown before or after that async destroying node, there is no way how to define it for parent because it does not know about async destroying node.
Animation was really just sample, its completely in Javascript in client code, you can do there what ever you need. Even use promises, or support resurrection (like my animation sample).
Andrew Gaydenko
@gaydenko
@Bobris , there is a common idiom: onDestroy hook is provided with additional parameter - a function (say, done()) the hook must call after own work is done. And it is the done() call where real node removing takes place.
Boris Letocha
@Bobris
@gaydenko Problem still is that to do in between if new render is requested - this makes virtual dom unsynced to real dom - something you don't want ...
I could be probably somehow implemented but again IMHO this is better to solve by your code in specific case...
Andrew Gaydenko
@gaydenko
@Bobris , yes, the problem to avoid inappropriate rerendering exists, but it would be lifted from low (nodes) level to hight (virtual DOM rescan) level.
Marko Biškup
@Helidium
@Bobris I have a situation, where I want to display a component within component and the update the view
what happens is the component gets destroyed without context
if I remove the whole view it works perfectly, but updates make errors
can you please check, why updating the dom would give a different result
Boris Letocha
@Bobris
@Helidium Trust me there is no such problem in Bobril. Usually this points to missing key. So some new component just switch to its place. You can try to add id to component so it is recognized as different even without key. Of course if you have small repro I can have a look.
Marko Biškup
@Helidium
@Bobris So even if the id is the same, the component will be replaced
because now I added keys to all internal components and the error persists
what is interesting is that when existing components, the ones which are replaced are destroyed without supplied context and node
I mean destroy function is called without context and node
Marko Biškup
@Helidium
I workedaround this issue
but one more question
if the view is invalidated
what happens with components
do they get destroyed and new ones initialized or not?
Boris Letocha
@Bobris
@Helidium b.invalidate just schedules next "render" - components are then follow their livecycle
ekkl
@ekkl
What is the function addRoot? What it means a third option? (parent)
Для чего нужна функция addRoot?И что в ней значит третий параметр? (parent)
Boris Letocha
@Bobris
@ekkl: It is probably you how asked on Stack Overflow. Sorry I don't have enough reputation to answer you. Hopefully it will be enough here :-). Parent is totally optional and if useful for remembering logical component tree hierarchy. addRoot is usually used for "modal" dialogs, or tooltips and similiar. So by providing parent to addRoot, in getRoots you can find out who created every new root. So for example you can animate it together with logical parent.
Also it is perfectly ok to ask by creating GitHub issue.
JakubJecminek
@JakubJecminek
I have question about bobril-build. If I have sample app like here https://github.com/Bobris/bobril-build/tree/master/examples/simpleApp and I want to add another System.import()
with css path, what is the best way to do it?
or is there any other way how to add css to generated index.html?
Boris Letocha
@Bobris
Css inclusion is not currently supported. I see CSS as obsolete compared to b.styleDef. But definitely taking patches.
Boris Letocha
@Bobris
THIS IS DEAD. USE GITHUB ISSUES INSTEAD.