Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dependency polka to v0.5.2 #14

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Sep 18, 2018

Mend Renovate

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
polka 0.4.0 -> 0.5.2 age adoption passing confidence

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 underling server.listen, which is arguably more "in tune" with the rest of Polka's ideology around native http integration.

    The new method will now rerun the current Polka instance directly, allowing you to continue chaining from it, or allowing you to grab the server or handler values immediately. Previously, .listen() always had to be last in your chain & resolved to nothing.

    // Could not do this before 0.5.0
    const { server, handler } = polka().listen();
    
    // Or this!
    const app = polka().listen(PORT, onAppStart);
    
    app.use('users', require('./users'))
      .get('/', (req, res) => {
        res.end('Pretty cool!');
      });
  • Removed built-in .METHOD() prototype methods for all 34 http.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 -> .get()
    • POST -> .post()
    • OPTIONS -> .options()
    • DELETE -> .delete()
    • PATCH -> .patch()
    • PUT -> .put()
    • HEAD -> .head()
    • CONNECT -> .connect()
    • TRACE -> .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:

    const app = polka();
    
    app.post('/login', 
      // This "guards" this route, executing first
      passport.authenticate('local', { failureRedirect: '/login' }),
      // This is the "main" function of this route
      function (req, res) {
        res.redirect('/');
      });
  • NEW @polka/url package: 44a5757, da00320, 87bac82, 17c54a7
    Super lightweight URL parser built specifically for Node.js servers.

Patches

  • (send-type) Lowercase all custom headers keys before parsing (#​57): 83731c5

Examples

Chores


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.


  • If you want to rebase/retry this PR, check this box

This PR has been generated by Mend Renovate. View repository job log here.

@renovate renovate bot changed the title Update dependency polka to v0.5.0 Update dependency polka to v0.5.1 Sep 25, 2018
@renovate renovate bot changed the title Update dependency polka to v0.5.1 Update dependency polka to v0.5.2 Feb 8, 2019
@renovate
Copy link
Contributor Author

renovate bot commented Mar 24, 2023

Edited/Blocked Notification

Renovate will not automatically rebase this PR, because it does not recognize the last commit author and assumes somebody else may have edited the PR.

You can manually request rebase by checking the rebase/retry box above.

⚠️ Warning: custom changes will be lost.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant