Releases: lukeed/polka
v0.3.3
v0.3.2
Patches
-
FIX: Defer
request
property mutations until a sub-group is actually called: 3120116, df98c4cPreviously, given a global logger, any
bware
-path would instantly mutate the request object. This means that the information is changed before any part of the loop begins.For example, when the global logger actually runs, the wrong URL/pathname is printed.
-
Tests: Chain
axios
deeply for easier debugging in the future: b0c9c6e -
Update README benchmarks after
polka.handler
changes: a9c8d4a
Examples
v0.3.1
Patches
-
FIX: Only mutate
req.url
andreq.pathname
if sub-group is known: f4e62bfThis is an important fix! Any cases of
serve-static
that were mounted without abasename
path were behaving unexpectedly. This is becausereq.url
was mutated as soon as a route-handler was not found, turning incoming assets like/app.js
into/
, which meant that the target directory'sindex.html
content was always sent. -
Ensure that sub-groups &
basenames
always include a leading slash: 531c92dThis makes it easier & quicker to mutate the
req.url
andreq.pathname
values once a sub-group is found. -
Update README benchmarks after
polka.handler
changes: d8016cc
Examples
v0.3.0
Features
-
Add
onError
andonNoMatch
options: e431583 -
Mount middleware groups & sub-applications to specific base pathnames (#8): e3c6966
-
Execute sub-applications' included middleware: e3c6966, b23d29f
We pass off the entire request to the sub-app directly, rather than stealing & reconstructing its routes in the main Polka instance.
-
Offer
@polka/send
and@polka/send-type
response helpers (#5): 815aaef, 2dac7a0
Breaking
-
Remove
app.send
prototype: 11052b7Use
@polka/send
or@polka/send-type
instead. -
Remove
app.start
prototype: a24fae2Use
app.listen
instead. -
Require a
base
path to mount sub-applications: e3c6966- Mutates the
req.url
once abase
app or middleware group has been found
_ Includes areq.originalUrl
value once abase
has been matched
- Mutates the
Patches
-
Allow asynchronous or dynamically-routed middleware to terminate the response: e3c6966
A middleware like
serve-static
can't know ahead of time if it will find a file. Now theapp.handler
gives it a chance to, rather than exiting immediately. -
Respond with
404
instead of405
if no route definition.
Examples
- Added
examples/with-body-parser
: 00d997f - Added
examples/with-https
: 2ecb748 - Added
examples/with-serve-static
: 7a04093, cacc5be - Added
examples/with-uws
: 9965f8a - Updated
async-json
&sub-app
demos: b338d75, 90c1fd2
Misc
v0.2.3
v0.2.2
v0.2.1
v0.2.0
Minor Changes
-
Add support for sub-applications 🎉 (#1): 17f1e85
This was a core chunk for releasing
1.0
. Still not quite ready as there are a few other API decisions to be made, but this takes us most of the way there. -
Reverted
app.handler
's signautre to(req, res, parsed)
: ddbf15c, d72cd14Exposing a
next
callback was completely useless as it would never be called, unless by accident — even though, it shouldn't have been allowed. 😆Instead, an optional
parsed
parameter allows the developer to parse the URL on their own terms, do whatever they want with the info, and then pass down the same information to the (nested?) app handler. Althoughparseurl
is super fast, the fastest function is the one you never call~ 😉