Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
0.4.0
->0.5.2
Release Notes
lukeed/polka
v0.5.2
Compare Source
v0.5.1
Compare Source
v0.5.0
Compare Source
Breaking
Remove Promise around
app.listen
(#19):dc56b9d
,e34a2a4
The previous
polka.listen
was a Promise & had structured input, both of which made it unique from existing frameworks. However, it was also a gotcha for projects migrating from existing frameworks.Instead,
polka.listen
now passes all arguments directly to the underlingserver.listen
, which is arguably more "in tune" with the rest of Polka's ideology around nativehttp
integration.The new method will now rerun the current
Polka
instance directly, allowing you to continue chaining from it, or allowing you to grab theserver
orhandler
values immediately. Previously,.listen()
always had to be last in your chain & resolved to nothing.Removed built-in
.METHOD()
prototype methods for all 34http.METHODS
:6d5d094
The large majority of these are never used; eg:
ACL
,MKCOL
,MKCALENDAR
, etc.These HTTP/1.1 verbs are supported / available to your Polka applications:
.get()
.post()
.options()
.delete()
.patch()
.put()
.head()
.connect()
.trace()
Features
Polka now supports multiple route-specific handlers! (#18):
42574ac
,aac1859
,a82f571
This was the most anticipated & most request feature for Polka 🎉
Put simply, variadic route handlers allows you to chain middleware for specific paths. This was only feasible before through
req.path
filters on sub-application or global middleware. Routes can now be modular, allowing you to compose/reuse your server route-by-route instead of group-by-group.Supporting this dramatically improves compatibility between Express and Polka applications. Most importantly, though, this did not come at the expense of performance~!
Here's a very basic example using
passport
, which was often a driver for this feature request:NEW
@polka/url
package:44a5757
,da00320
,87bac82
,17c54a7
Super lightweight URL parser built specifically for Node.js servers.
Patches
send-type
) Lowercase all customheaders
keys before parsing (#57):83731c5
Examples
examples/with-apollo
(#48):a7a38c4
examples/with-nextjs
(#48):a7a38c4
Thanks @jerolan!
examples/with-socketio
:a9f0f58
Chores
req.path
instead ofreq.pathname
(#62):a4d96b9
Thanks @antoineneff!
d6296ed
d6296ed
,99f4fe9
734ee31
,35fb3d8
,e43bf6f
Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR has been generated by Mend Renovate. View repository job log here.