by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Feb 28 2018 04:17

    DylanPiercey on v7.0.4

    (compare)

  • Feb 28 2018 04:17

    DylanPiercey on master

    Improve typings. 7.0.4 (compare)

  • Feb 27 2018 07:44

    DylanPiercey on v7.0.3

    (compare)

  • Feb 27 2018 07:44

    DylanPiercey on master

    Add type definitions for tls op… 7.0.3 (compare)

  • Feb 27 2018 05:51

    DylanPiercey on platform-agnostic

    (compare)

  • Feb 27 2018 05:51

    DylanPiercey on file-size

    (compare)

  • Feb 27 2018 05:51

    DylanPiercey on add-code-of-conduct-1

    (compare)

  • Nov 20 2017 03:11

    DylanPiercey on v7.0.2

    (compare)

  • Nov 20 2017 03:11

    DylanPiercey on master

    Update size in readme 7.0.2 (compare)

  • Nov 19 2017 02:31

    DylanPiercey on v7.0.1

    (compare)

  • Nov 19 2017 02:31

    DylanPiercey on master

    * Update example links in readm… 7.0.1 (compare)

  • Nov 18 2017 04:31

    DylanPiercey on master

    * Update changelog. * Release 7… 7.0.0 (compare)

  • Nov 18 2017 04:31

    DylanPiercey on v7.0.0

    (compare)

  • Nov 18 2017 04:00

    DylanPiercey on v7.0.0-rc.12

    (compare)

  • Nov 18 2017 04:00

    DylanPiercey on master

    Remove default of 404 on status… 7.0.0-rc.12 (compare)

  • Nov 12 2017 18:53

    DylanPiercey on master

    * Organize types in namespace. … 7.0.0-rc.11 (compare)

  • Nov 12 2017 18:53

    DylanPiercey on v7.0.0-rc.11

    (compare)

  • Nov 11 2017 18:34

    DylanPiercey on master

    * Switch back to default export… 7.0.0-rc.10 (compare)

  • Nov 11 2017 18:34

    DylanPiercey on v7.0.0-rc.10

    (compare)

  • Oct 24 2017 00:00

    DylanPiercey on v7.0.0-rc.9

    (compare)

Lon Ilesanmi
@lon-io
Thanks @DylanPiercey it all works fine now
Dylan Piercey
@DylanPiercey
👍
Lon Ilesanmi
@lon-io

Hi @DylanPiercey I get this error on calling go within delegate.on('some_action', (ev, go) => {...}):

index.js:161 Uncaught TypeError: @rill/delegate: Could not navigate because Rill server was missing.
    at assert (index.js:161)
    at go (index.js:147)
    at catalog.js:58
    at HTMLDocument.onEvent (index.js:128)

Apparently, it relates back to the previous error where socket was undefined. Now, socket is defined, but _server is not defined on socket like this line expects:

function delegate (options) {
  return function delegateMiddleware (ctx, next) {
    // Store reference to server for later.
    _server = ctx.req.original.socket.server
    // Clear all listeners.
    for (var type in _listeners) _listeners[type] = []
    // Continue request.
    return next()
  }
}
function go (url, options) {
  assert(_server, 'Could not navigate because Rill server was missing.')
  fetch(_server, url, options)
}

I know it's all tied to using an outdated Rill version, but any work around for this?

Dylan Piercey
@DylanPiercey
When you are setting the server on the context are you using the rill app or the result of calling rill().listen()? The latter is a @rill/http server which is what is needed.
Lon Ilesanmi
@lon-io
Ah, I see, I've been using just rill(), I'll change to rill().listen(). Thanks
Dylan Piercey
@DylanPiercey
Let me know if that works :)
Lon Ilesanmi
@lon-io

Yeah it works, Sorry to bother you man @DylanPiercey , but I've got another question. I need to override the onpopstate handler you have registered

function onHistory () {
  fetch(this, { url: location.href, scroll: false, history: false })
}

in version 2.5.1, it's registered specifically as:

function onPopState () {
  this.navigate(location.href, { popState: true })
}

I registered my own handler, called e.preventDefault() and e.stopImmediatePropagation(), but your handler gets called first.

Dylan Piercey
@DylanPiercey
What's the use case here? Not 100% sure how we'd achieve this
Lon Ilesanmi
@lon-io
The use case is to prevent a complete route but rather update the html using state from the previous page. Before routing, I call history.replaceState() to set the state of the current page to the html inside my wrapper element
Then I add a listener on for onpopstate to get the html of the last page and set it as the innerHTML of my wrapper element
Dylan Piercey
@DylanPiercey
Why not add a rill middleware that does this and attach it first?
Dylan Piercey
@DylanPiercey
FWIW It probably wouldn't be a bad idea to add a 'preventDefault' check in the 'onHistory' function, however it wouldn't resolve your problem since you'd have to upgrade Rill anyway.
Lon Ilesanmi
@lon-io
Ah, trying the middleware route, does not seem to even call the handler, maybe I'm doing something wrong. Thanks, though. I'll check my code and get back to you if need be.
Lon Ilesanmi
@lon-io
Thanks @DylanPiercey , taking the middleware route worked! :smile:
Dylan Piercey
@DylanPiercey
😃👍
Dylan Piercey
@DylanPiercey
@lon-albert could be cool if you open sourced that middleware, could be handy for some people :).
Lon Ilesanmi
@lon-io

Hi @DylanPiercey , sorry I had to bring this back. I assumed this worked then, but it turns out it didn't. It appeared to work because I temporarily upgraded to v 5.0.0 on my local machine. One obvious reason is that trying to call

app.use(({ req }, next) => {
    req.original.socket.server = server
    return next()
  })

where app = rill() and server === app.listen() does not seem to evaluate at all.
Basically, any middleware I try to register after calling rill)().listen() doesn't get registered

When you are setting the server on the context are you using the rill app or the result of calling rill().listen()? The latter is a @rill/http server which is what is needed.

Dylan Piercey
@DylanPiercey
Yes that is the case you have to register all middleware before calling listen but store a reference to listen and you can use that in the middleware. Does that make sense?
Lon Ilesanmi
@lon-io
@DylanPiercey Ah, right. I'll try that asap
Lon Ilesanmi
@lon-io
It works like charm @DylanPiercey ! say again, it works like charm!
Dylan Piercey
@DylanPiercey
Glad to hear 😄.
Dylan Piercey
@DylanPiercey
Hey everyone! If you're using VSCode with Rill@6 you will now get autocomplete for most of the api thanks to improved JSDoc!
Lon Ilesanmi
@lon-io
Nice :clap:
Andrew Smith
@silentworks
I cant seem to find any solid example of using rill on the client
I am trying to set it up with Svelte, but all I can seem to find is server side setups
Dylan Piercey
@DylanPiercey
@silentworks can you point me to the example you are referring too? I don’t believe I have a good svelte example but planning on making a todo-mvc for svelte and Marko soonish. The @rill/svelte middleware is isomorphic though, and if you need any help setting things up I can help you out.
Dylan Piercey
@DylanPiercey
Are you meaning using Rill standalone on the client without server side rendering?
Andrew Smith
@silentworks
@DylanPiercey yes I want to use Rill standalone on the client without server side rendering at the moment, but later I am likely to use the server side rendering also
Dylan Piercey
@DylanPiercey
Then basically you would want to use the svelte middleware without using the @rill/page anywhere. If your having trouble feel free to post what you have setup (build step or otherwise) and I can try to help.
Andrew Smith
@silentworks
The problem I don't even know where to start, the website seem to cover server side rendering much, but not client side
Dylan Piercey
@DylanPiercey
@silentworks if you show me some code snippets to illustrate what you mean I could probably help further.
Yekeen Ajeigbe
@klummy
Hello @DylanPiercey, does Rill has any built in handling for debouncing requests? For example, where a new request cancels the pending/previous request
Dylan Piercey
@DylanPiercey
@klummy it does not currently, however I’m sure this could easily be achieved via middleware. Want to point me to an Express or koa equivalent and I’ll see if I can whip something up?
Dylan Piercey
@DylanPiercey
@klummy you may find the @rill/rate-limit middleware useful though.
Dylan Piercey
@DylanPiercey

Hey @/all. I have been working on improving Rill's documentation. One thing I would love help on is the FAQ section. Please let me know of anything you think belongs there and I will work on extending the list.

Also I am currently working on improving the test coverage for all of Rill's dependencies and switching much of the project to typescript. If you have any feedback that would be great and you can review the changelog here. You can try out the current RC by using npm i rill@next, the official release may take some time.

Yekeen Ajeigbe
@klummy
Thanks @DylanPiercey, I will take a look at rate-limit. Have a great day
Andrew Smith
@silentworks
@DylanPiercey I am getting this error when I try to use the page module TypeError: page.html is not a function
Dylan Piercey
@DylanPiercey
Want to post a code snippet and I’ll see if I can figure it out when I get some time later today?
Andrew Smith
@silentworks
@DylanPiercey are you on Glitch? If yes can I PM you a link so you can go to the code directly
Dylan Piercey
@DylanPiercey
@silentworks I haven’t heard of glitch but if you pm me a link I’ll check it out.
Hafiz Suara
@hafbau
Hi @DylanPiercey could you please point me to an example where Rill has been used with websockets?
Hafiz Suara
@hafbau
Oh, I figured it out!
Dylan Piercey
@DylanPiercey
Glad to hear! Feel free to reach out if you need any further help.
Dylan Piercey
@DylanPiercey
Rill 7.0.0 has been released! Please notify me of any issues and I'll try to resolve ASAP. Should be a non-breaking change for most people though.
Dylan Piercey
@DylanPiercey
@silentworks you may be interested In the new isomorphic svelte todo-mvc app. Sorry for being late, have been busy lately!
Andrew Smith
@silentworks
Thanks @DylanPiercey
Andrew Smith
@silentworks
Is Passport compatible with rill?
Dylan Piercey
@DylanPiercey
@silentworks it could be compatible (if you wanted to make it work you could look at a koa adapter and a Rill adapter would be very similar.). I personally ran into issues with it (not integration with Rill) so liked to manually setup my oauth. I could revisit making a middleware for it though.
Evan Hahn
@EvanHahn
Hi! I maintain Helmet and I found @rill/helmet. Let me know if I can do anything to help there.
Some of the documentation looked a little out of data to me.