Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
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?
can you show your package.json?
Michal Vanko
@michalvankodev
"devDependencies": {
    "babel-cli": "^6.7.7",
    "babel-core": "*",
    "babel-eslint": "^6.0.3",
    "babel-preset-es2015": "^6.6.0",
    "babel-preset-stage-0": "^6.5.0",
    "babel-tape-runner": "^2.0.1",
    "babelify": "^7.2.0",
    "browserify": "^13.0.0",
    "browserify-hmr": "^0.3.1",
    "eslint": "^2.8.0",
    "eslint-config-cycle": "^3.2.0",
    "faucet": "0.0.1",
    "less": "^2.6.1",
    "nodemon": "^1.9.1",
    "supertest": "^1.2.0",
    "tape": "^4.5.1",
    "watchify": "^3.7.0"
  },
  "dependencies": {
    "@cycle/dom": "^10.0.0-rc7",
    "@cycle/history": "*",
    "@cycle/http": "^9.0.0-rc2",
    "@cycle/isolate": "^1.2.0",
    "@cycle/xstream-run": "^1.0.0",
    "bcrypt": "^0.8.6",
    "cycle-snabbdom": "^1.2.1",
    "cyclic-router": "^1.0.0",
    "dejavu-fonts-ttf": "^2.35.5",
    "history": "^2.1.0",
    "jsonwebtoken": "^5.7.0",
    "koa": "^1.2.0",
    "koa-bodyparser": "^2.0.1",
    "koa-favicon": "^1.2.1",
    "koa-jwt": "^1.2.0",
    "koa-logger": "^1.3.0",
    "koa-mount": "^1.3.0",
    "koa-route": "^2.4.2",
    "koa-router": "^5.4.0",
    "koa-watchify": "^1.1.1",
    "mongoose": "^4.4.13",
    "normalize.css": "^4.1.1",
    "ramda": "^0.21.0",
    "rx": "^4.1.0",
    "switch-path": "^1.1.6",
    "winston": "^2.2.0",
    "xstream": "^1.0.8"
  }
André Staltz
@staltz
Adaptation between stream libraries should happen smoothly because the http driver tells run() that it uses rx and run() will convert the xstream sink before giving it to the http driver
Michal Vanko
@michalvankodev
In callDrivers driverOutput is run first .. there it crashes and then it wants to check for validation .isValidStream
Michal Vanko
@michalvankodev
yea the source code in http-driver looks different then in chrome debugger
ok I had to restart watchify as it doesnt track node_modules
ok now I have an issue with makeHTMLDriver
André Staltz
@staltz
did it work now?
ok, what's the issue there?
Michal Vanko
@michalvankodev
runStreamAdapter.adapt is not a function
André Staltz
@staltz
hmm
Michal Vanko
@michalvankodev
yea I'm not using xstream run on the server side edit : yet!
Tylor Steinberger
@TylorS
Oh hey, I hadn't even thought about it, but @cycle/history should be automatically converted as well :+1:
Michal Vanko
@michalvankodev
Is @cycle/history adaptable?
Right now I have an issue with
TypeError: sink$.subscribe is not a function
      at historyDriver (/home/mvanko/Projects/cycle-blog/node_modules/@cycle/history/lib/makeHistoryDriver.js:97:11)
      at Object.routerDriver [as router] (/home/mvanko/Projects/cycle-blog/node_modules/cyclic-router/lib/makeRouterDriver.js:32:20)
Tylor Steinberger
@TylorS
It returns just a single stream, so it should get converted automatically I think.
@staltz I can't remember now :( lol
cyclic-router isn't ready for conversion though :(
Let me open an issue for that
Michal Vanko
@michalvankodev

@TylorS

cyclic-router isn't ready for conversion though :(

NOooooooooooooooooo

Tylor Steinberger
@TylorS
I want to rewrite it in TS and XStream
Definitely high on my todo list
Michal Vanko
@michalvankodev
Thank you.. My todays journey is therefore in the end.. If there is any way to help you I'd like to :)
Tylor Steinberger
@TylorS
If you'd like to submit a patch for simple conversion before it gets rewritten that'd be very welcomed, but I don't expect it from anyone. Not many people are familiar with how to do the conversions inside of drivers just yet
Michal Vanko
@michalvankodev
What is your estimate for a rewrite?