github lukeed/polka v0.4.0

latest releases: v1.0.0-next.28, v1.0.0-next.27, v1.0.0-next.26...
6 years ago

Minor Changes

  • Add new opts.server option: 276056c, e93ae66, d2f5f96
    This allows Polka to attach to predefined, existing servers. It's an alternative approach to booting Polka and wrapping it with another parent server.

  • Initialize server only when needed: 276056c
    Without this, all sub-applications were preemptively booting up http servers. This meant that all servers were just utilizing memory & never served a purpose, since only the main application's server mattered.

    This change means that the following code sample no longer works:

    let { server } = polka();
    //=> before: "server" was http.Server
    //=> current: "server" is undefined
  • Rename req.pathname to req.path (#29): 7d467f3
    This is for Express compatibility. A lot of popular apps/middlewares rely on req.path (like webpack-dev-server) & it doesn't make to maintain req.pathname and req.path values.

Patches

  • Push root-based middleware group into global middleware: 46285f9
    This is mostly a Express-compatibility thing; funky but a needed workaround for some.

Chores

  • Fix readme docs: 37fe875, 46086ae
  • Rewrite tests with async for convenience / sanity: c17440f
  • Fix tests after trouter@1.1.0 update: 8af07b5

Examples

  • Added examples/with-nuxtjs: ff27865
  • Added examples/with-graphql: b929ada
  • Added examples/with-sirv: 1284606

Don't miss a new polka release

NewReleases is sending notifications on new releases.