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)

Dylan Piercey
@DylanPiercey
At every point in the design of Rill's api's and middleware I have been conscious of both browser side ergonomics and server side, while ensuring optimal code is delivered to each environment.
Constance Okoghenun
@okoghenun
@DylanPiercey I agree that using just any express middleware on the browser may not be the best idea but I'm of the opinion that the decision should be left to the developer. For our use case we had already invested a lot in our express codebase and wanted a to reuse the bulk of the components we had written for the server but that would work well on the client
Dylan Piercey
@DylanPiercey
That's fair enough and I'm glad to hear that solution made things easier for you. This is exactly why Rill has the #setup method, where you can do stuff like app.setup(expressAdapter) which is essentially your transformer. I just wouldn't add something like that to the org because I can see it being far to easy for developers (whom in my experience seem to already have a hard time distinguishing client and server with this approach) to shoot themselves in the foot.
Constance Okoghenun
@okoghenun

:laughing:

...whom in my experience seem to already have a hard time distinguishing client and server with this approach

Dylan Piercey
@DylanPiercey
:p
Constance Okoghenun
@okoghenun
We all need to shoot ourselves from time to time :joy:
Dylan Piercey
@DylanPiercey
True, you don't learn otherwise. But I try not to promote it :p.
Lon Ilesanmi
@lon-io
Hi @DylanPiercey
rill-js/delegate#1
Dylan Piercey
@DylanPiercey
This is a bug, I haven't used the delegate module in a while. Will fix today, thanks for bringing it up!
Lon Ilesanmi
@lon-io
Great, thanks!
Lon Ilesanmi
@lon-io
@DylanPiercey That was a very fast 5.0 ship :shipit: :shipit:
Dylan Piercey
@DylanPiercey
😃 I don't mess around 😎
Always feel free to reach out if you have any issues 😄
Lon Ilesanmi
@lon-io
Sure, thanks
Lon Ilesanmi
@lon-io
Hi @DylanPiercey , is this the only way to trigger a page reload routed through rill rather than the server?
https://github.com/DylanPiercey/submit-form/blob/master/client/index.js#L30
Dylan Piercey
@DylanPiercey
Since you are using @rill/delegate you can also use ctx.go('/my-page', { method: 'GET' }). I think I'm going to separate out that functionality into its own module though or perhaps add it to Rill core.
If you just want a reload you can do ctx.go(ctx.req.href)
Lon Ilesanmi
@lon-io
Ah, but what of a situation where I don't have access to ctx; for example in an event listener added to the DOM?
Dylan Piercey
@DylanPiercey
Thats actually why I added it to @rill/delegate, because you typically want this functionality in client side events.
See the example from the readme:
  // Here we listen for `keyup` events that match a `.verification-code` element.
  delegate.on('keyup', '.verification-code', (ev, go) => {
      // `currentTarget` will be the element that matched the selector.
      const input = ev.currentTarget;
      const code = input.value

      // The second argument is the 'go' utility, which is much like native fetch but tells Rill to navigate.
      if (code.length === 5) {
        // In this case when we have 5 characters, we navigate to the submission page.
        go('/submit', {
          method: 'POST',
          body: { code }
        })
      }
  })
Also I was wrong, it's not 'ctx.go' it is passed in to event handlers.
Lon Ilesanmi
@lon-io
Okay, that's great, thanks!
Dylan Piercey
@DylanPiercey
Np.
One other thing to note though is that with @rill/delegate you need to bind the event handler for each request because all event handlers get reset (so that if you navigate to a new page it doesn't take all the old handlers). Let me know if that doesn't make sense.
Lon Ilesanmi
@lon-io
Okay, I think it makes sense, I'll take note of that and get back to you if I have any issues
Dylan Piercey
@DylanPiercey
Sounds good :).
Just curious, what module bundler are you using? Webpack/Browserify/Rollup/Lasso?
Lon Ilesanmi
@lon-io
Webpack
Dylan Piercey
@DylanPiercey
Cool, and which front end framework? React?
Or @rill/html?
Lon Ilesanmi
@lon-io
None, just rendering dust templates
Dylan Piercey
@DylanPiercey
Gotcha, are you using @rill/html to do that?
Sorry, just trying to get an idea of how people are using Rill :).
Lon Ilesanmi
@lon-io
Nah, dustjs-helpers :)
Dylan Piercey
@DylanPiercey
Oh interesting. Thanks for the info!
Didn't know dust did client side rendering.
Lon Ilesanmi
@lon-io
Sure, thanks for communicating often
Dylan Piercey
@DylanPiercey
Np 👍
Lon Ilesanmi
@lon-io
Hi @DylanPiercey , I have errors (http://take.ms/hwExX
, http://take.ms/wWJt5)

Dylan Piercey
@DylanPiercey
Do you have any more info? The error stack trace is a bit cryptic without source maps.
What are you doing when this happens?
Lon Ilesanmi
@lon-io
Just these:
const delegate = require('@rill/delegate')
app.use(delegate())
Dylan Piercey
@DylanPiercey
Gotcha, I think I know the issue, I'll dig into it now.
Lon Ilesanmi
@lon-io
Thanks, it looks like it can't find ctx.req.original.socket.server within this:
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()
  }
}
Dylan Piercey
@DylanPiercey
What version of Rill are you using?
Because that should work as far as I can tell atm
Lon Ilesanmi
@lon-io
2.5.1
Dylan Piercey
@DylanPiercey
Ah, ctx.req.original.socket.server was added after that version I believe, let me find what version exactly.
Any reason you are tied to the old version?
Lon Ilesanmi
@lon-io
So, there's several people working on the project and we lock-down versions and whenever we need to update package versions there are discussions and a general agreement :)