DylanPiercey on master
Update request.md chore: short… (compare)
DylanPiercey on master
Update response.md chore: upda… (compare)
DylanPiercey on master
Update request.md chore: updat… (compare)
DylanPiercey on master
Update README.md chore: update… (compare)
DylanPiercey on v7.0.4
DylanPiercey on master
Improve typings. 7.0.4 (compare)
DylanPiercey on v7.0.3
DylanPiercey on master
Add type definitions for tls op… 7.0.3 (compare)
DylanPiercey on platform-agnostic
DylanPiercey on file-size
DylanPiercey on add-code-of-conduct-1
DylanPiercey on v7.0.2
DylanPiercey on master
Update size in readme 7.0.2 (compare)
DylanPiercey on v7.0.1
DylanPiercey on master
* Update example links in readm… 7.0.1 (compare)
DylanPiercey on master
* Update changelog. * Release 7… 7.0.0 (compare)
DylanPiercey on v7.0.0
DylanPiercey on v7.0.0-rc.12
DylanPiercey on master
Remove default of 404 on status… 7.0.0-rc.12 (compare)
DylanPiercey on master
* Organize types in namespace. … 7.0.0-rc.11 (compare)
const server = rill()
.use(({ req }, next) => {
req.original.socket.server = server
return next()
})
// Rest of middleware.
.use(...)
.listen()
import { on, once } from '@rill/delegate'
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?
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.
onpopstate
to get the html of the last page and set it as the innerHTML
of my wrapper element
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.
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.