Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
Dmitrii 'Mamut' Dimandt
@dmitriid
@staltz I have to use all this while I'm still inspired, or I'll end up like the dog in @SteveALee's presentation :)
André Staltz
@staltz
Cycle Diversity works, it's not incomplete, but it's release candidate because we don't have docs yet
Dmitrii 'Mamut' Dimandt
@dmitriid
cool
André Staltz
@staltz
but the migration is rather simple. most of the code stays unchanged
Dmitrii 'Mamut' Dimandt
@dmitriid
I like the sound of that :)
André Staltz
@staltz
I'd recommend people at least try to convert their codebases to Diversity
I already did with power-ui and it worked...
Raphael Mu
@edge
haven't been keeping up with Diversity but I assume if I use xstream-run and some other driver uses rx, both xstream and rx would be in the final bundle?
André Staltz
@staltz
yes
We will change the stream library in the official drivers to be xstream
Without anyone noticing that (apart from the fact of the dependency in package.json)
Steve Lee
@SteveALee
Eh. Hm. :) so the rx dependency in the diverse branch of examples I'd for drivers?. Would-be fantastic to lose it completely to get bundle size down.
Alex
@whitecolor
why people care so much about bundle size? I think this it is really ephemeral advantage
André Staltz
@staltz
@whitecolor depends really on the case. On mobile it's a big constraint
Also, if you can easily have a smaller bundle, why not?
Alex
@whitecolor
I mean I don't consider this a factor when choosing library, if it comes with it - that is nice
Tylor Steinberger
@TylorS
@SteveALee Thanks! Wish I could have been there.
Churchill Lee
@FeliciousX
anyone knows a good repo as an example for implementing a cycleJS app + testing?
Steve Lee
@SteveALee
+1. Plus an example using ASCII marble please! :)
@whitecolor it matters for those not on Firstworld standard connections usually experienced by us luck folks. That includes me travelling on a train trying to access a web site via really bad mobile signal :)
Michal Vanko
@michalvankodev
How do you get HTTP driver to work with xstream-run?
For me it says that request$.map(...).replay is not a function
And I've updated to "@cycle/http": "^9.0.0-rc2",
Laszlo Korte
@laszlokorte
@michalvankodev how does your code look like? especially the replay call?
Adam Wendell
@AdamWendell
It's in the http driver I think.
Michal Vanko
@michalvankodev
the replay call is in the http driver.. xstream doesn't have replay functionality
Laszlo Korte
@laszlokorte
Oh I see
In xstream it's called remember.
Adam Wendell
@AdamWendell
let response$$ = request$
      .map(request => {
        const reqOptions = normalizeRequestOptions(request)
        let response$ = createResponse$(reqOptions)
        if (typeof reqOptions.eager === `boolean` ? reqOptions.eager : eager) {
          response$ = response$.replay(null, 1)
          response$.connect()
        }
        Object.defineProperty(response$, `request`, {
          value: reqOptions,
          writable: false,
        })
        return response$
      })
      .replay(null, 1)
Michal Vanko
@michalvankodev
@AdamWendell Exactly there
In that point of time the request$ is a MemoryStream of xstream
Laszlo Korte
@laszlokorte
I guess the drivers need to be ported in order to support xstream?
André Staltz
@staltz
The official drivers versioned as x.x.x-rc already support xstream
And they also support rxjs v4 and v5
Michal Vanko
@michalvankodev
And I've updated to "@cycle/http": "^9.0.0-rc2",
the driver is called before it is adapted with streamAdapter
André Staltz
@staltz
ok, and did you also import rx 4.x ?
because the http driver in diversity uses that, you need to install it too
check this example how it has both rx (uses v4 in the driver, v5 in the app)
Michal Vanko
@michalvankodev
rx": "^4.1.0",
André Staltz
@staltz
we're going to migrate all official drivers to xstream (should be simple to do actually)
and what problem are you getting as symptom?
Michal Vanko
@michalvankodev
For me it says that request$.map(...).replay is not a function
request$ is a xs MemoryStream coming from application
it happens in callDrivers function of cycle/base
Alex
@whitecolor
@staltz I don't get a little how are drivers supposed to work with diversity will there be differeent version for each lib?
Michal Vanko
@michalvankodev
the driver is ran before the adaptation thats's why it is happening
André Staltz
@staltz
@michalvankodev are you using xstream-run?