Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Jan 15 09:45

    dependabot[bot] on npm_and_yarn

    (compare)

  • Jan 15 09:45

    dependabot[bot] on npm_and_yarn

    (compare)

  • Jan 15 09:44

    kevinresol on master

    Bump path-parse from 1.0.6 to 1… Merge pull request #16 from MVC… (compare)

  • Jan 15 09:44
    kevinresol closed #16
  • Jan 15 09:44

    kevinresol on master

    Bump postcss from 7.0.35 to 7.0… Merge pull request #20 from MVC… (compare)

  • Jan 15 09:44
    kevinresol closed #20
  • Jan 15 09:40
    dependabot[bot] edited #16
  • Jan 15 09:40
    dependabot[bot] edited #16
  • Jan 15 09:40
    dependabot[bot] synchronize #16
  • Jan 15 09:40

    dependabot[bot] on npm_and_yarn

    Bump path-parse from 1.0.6 to 1… (compare)

  • Jan 15 09:40
    dependabot[bot] edited #16
  • Jan 15 09:40

    dependabot[bot] on npm_and_yarn

    (compare)

  • Jan 15 09:40
    dependabot[bot] closed #14
  • Jan 15 09:40
    dependabot[bot] edited #14
  • Jan 15 09:40
    dependabot[bot] commented #14
  • Jan 15 09:40
    dependabot[bot] labeled #20
  • Jan 15 09:40
    dependabot[bot] opened #20
  • Jan 15 09:40

    dependabot[bot] on npm_and_yarn

    Bump postcss from 7.0.35 to 7.0… (compare)

  • Jan 15 09:40
    dependabot[bot] edited #16
  • Jan 15 09:40
    dependabot[bot] edited #14
Emugel
@emugel
right but then you need as many @:editable and @:computed entries as your variable X can take. So for 3 values you end up with 6 lines
or same in the second example. If you loaded a table, and you want to select a cell from this table, then you have to use a function
Kevin Leung
@kevinresol
you need to keep track of the selection somewhere anyway
I mean you will need a @:editable or @:observable for the cell address anyway
Emugel
@emugel
in my case they are not editable, it is simply like multiplication of tables based on rates
and i am wondering if it is ok to use Observable, or if i missed something
Kevin Leung
@kevinresol
In my experience, normally I don't need to use Observable manually
Emugel
@emugel
I will try your approach, one cell, one view. It's probably the simplest
Kevin Leung
@kevinresol
@back2dos is it possible to create a custom/adhoc reconciler+render in coconut?
like https://github.com/pmndrs/react-three-fiber which has a <Canvas> component and everything inside that has its own reconciler+render
Juraj Kirchheim
@back2dos
Anything is possible ... fundamentally, the view base class is something that accepts an Observable<RenderResult> (and a few callbacks) and then how that renders is the implementators business
but perhaps I don't quite understand your question
Juraj Kirchheim
@back2dos
what I can say is that conceptually, coconut.ui has no notion of a reconciler ... indeed coconut.html has none
Kevin Leung
@kevinresol
I don't fully understand it too, but what I guess is that I want to receive a sub-tree of the react virtual dom (coconut.react.RenderResult), perform custom reconcilation on it and render custom stuff with it. With all these happening within a larger react app.
but I now believe this shouldn't really involve coconut
Juraj Kirchheim
@back2dos
if it's react on both ends, I guess react can take care of it ^^
Rudy Ges
@kLabz
Emugel
@emugel
how do you guys make unit tests with coconut? first of all i'm interested in testing models. But let's say in general , what is your opinion of unit tests and coconut apps
Emugel
@emugel
maybe first i will see if i can have something simple with travix
Kevin Leung
@kevinresol
I wish to know too
Currently I have some tests for Models
and I want to make some UI tests using automation engines such as cypress.io
Emugel
@emugel

So, I discovered puppeteer with lix run travix run js, this seems like what I was dreaming of :).

Now however I am getting ReferenceError: require is not defined at this line var coconut_react_internal_NativeComponent = require("react").Component;. Is there anything I can do? (for now, all I see is ask the question and go grab some beers)

Emugel
@emugel
think this is the answer https://github.com/kLabz/haxe-react/blob/next/README.md#react-js-dependency (second compile with browserify or download from CDN). With travix though I don't know how
Emugel
@emugel
If someone knows, please help! For now will sleep...
Juraj Kirchheim
@back2dos
uhm, I suppose the easiest way to deal with it is by bundling a CDN version of react with the build using https://github.com/back2dos/embed-js
(and setting -D react_global)
Emugel
@emugel
Yay!! it works, thanks a lot!
Emugel
@emugel
Applying idea of https://github.com/MVCoconut/coconut.data#injecting-services (modularize models to reduce dependencies).
Imagine a Model with @:constant var server : { function foo():Promise<String>; }.
Called from travix or for unit test, this Model will be given a dummy function like ()->"Foo".
But when compiled in an App, the Model would receive a tink_web proxy, like tink.web.proxy.Remote<Something>.
While this Something has a function foo, it won't unite (because there seem to be subtleties in the macro), giving this error: tink.web.proxy.Remote1 should be { foo : () -> tink.Promise<String> }.
Any idea? It is not a big problem in itself, but I am trying to develop good habits and this is why I ask for the best way
Kevin Leung
@kevinresol
you cant really create a remote with method returning Promise<String>
because String is converted to IncomingResponse on client side
Emugel
@emugel
yes it was an example
Kevin Leung
@kevinresol
what happens if you put {foo: remote.foo}?
or even {foo: () -> remote.foo()}?
Emugel
@emugel
\o/ (both work, thanks!)
Emugel
@emugel

Better I type here than add garbage to MVCoconut/coconut.ui#92. So after updating +tink state (1.0.0-beta.3) and core (2.0.2), the JS fails at the last line with process:

    var wasUpdating = tink_state_Observable.isUpdating;
        tink_state_Observable.isUpdating = true;
        return tink_core_TypedError.tryFinally(function() {
            var hrtime = process.hrtime();

process is not defined

that may be js.Node.process but why is it undefined?
Emugel
@emugel
:eyes: forget it. if I try to run it from a browser of course process is not defined...
Juraj Kirchheim
@back2dos
but shouldn't you get an exception instead of nothing?
Kevin Leung
@kevinresol
A question on patterns for async data source, which one is better?
class OverviewPage extends View {

    @:attr var data1:Promised<Data1>;

    @:attr var getData2:()->Promise<Data2>;
    @:loaded var data2:Data2 = getData2();

    @:attr var getData3:()->Promise<Data3>;

    @:attr var data4:Model4;


    function render() '
        <Widget1 data=${data1} />
        <Widget2 data=${data2} />
        <Widget3 getData=${getData3} />
        <Widget4 data=${data4} />
    ';
}

class Model4 implements Model {
    @:attr var getData:()->Promise<Data4>;
    @:loaded var data:Data4 = getData();
}
Juraj Kirchheim
@back2dos
phew ... it depends ^^
Kevin Leung
@kevinresol
yeah I am using each of them all over the place....
serjek
@serjek
attr is allowed in Model?
Kevin Leung
@kevinresol
should be @:constant
but you get the idea
serjek
@serjek
yeah. so I tend to use 1 and 4, because I believe services should belong to model
Juraj Kirchheim
@back2dos
myeah, ideally your application should be able to run without a view
although to create a model only for the sake of having one piece of loaded data is a bit overkill ^^
Kevin Leung
@kevinresol
yeah I think my app can run without a view. but my views can't run without the app data.