Skip to content

Instantly share code, notes, and snippets.

@jonchurch
Last active May 13, 2020 23:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jonchurch/3d964176a1e3062b04cfeb0a662a7226 to your computer and use it in GitHub Desktop.
Save jonchurch/3d964176a1e3062b04cfeb0a662a7226 to your computer and use it in GitHub Desktop.
Express v5 Changes by System as of 5.0.0-alpha.8

Changes By System

Application

Middleware

The Router changes also affect some aspects of middleware. Specifically, handling rejected promises returned from middleware or route handers, as well as next('router') bailing out of a router instance.

  • 5.0.0-alpha.4
    • remove:
      • Express 3.x middleware error stubs (trying to access middleware which was bundled in 3.x and removed in 4.x e.g. express.compress or express.bodyParser will no longer print a notice. Those values are just undefined without the explicit throw and notice)

Debugging

  • 5.0.0-alpha.7
    • deps: debug@3.1.0
      • Add DEBUG_HIDE_DATE environment variable
      • Change timer to per-namespace instead of global
      • Change non-TTY date format
      • Remove DEBUG_FD environment variable support
      • Support 256 namespace colors

Router

  • 5.0.0-alpha.7
  • 5.0.0-alpha.4
    • deps: router@~1.3.0
      • perf: add fast match path for * route
      • Add next("router") to exit from router (different from next('route') already available)
      • Fix case where router.use skipped requests routes did not
      • Skip routing when req.url is not set
      • Use %o in path debug to tell types apart
      • deps: debug@2.6.1
      • deps: setprototypeof@1.0.3
  • 5.0.0-alpha.2
    • Use router module for routing
  • 5.0.0-alpha.1

Req

Res

Branch 5.0 History.md File

This is the source material where the above was pulled from

5.0.0-alpha.8 / 2020-03-25

This is the sixth Express 5.0 alpha release, based off 4.17.1 and includes changes from 5.0.0-alpha.7.

5.0.0-alpha.7 / 2018-10-26

This is the seventh Express 5.0 alpha release, based off 4.16.4 and includes changes from 5.0.0-alpha.6.

The major change with this alpha is the basic support for returned, rejected Promises in the router.

  • remove:
    • path-to-regexp dependency
  • deps: debug@3.1.0
    • Add DEBUG_HIDE_DATE environment variable
    • Change timer to per-namespace instead of global
    • Change non-TTY date format
    • Remove DEBUG_FD environment variable support
    • Support 256 namespace colors
  • deps: router@2.0.0-alpha.1
    • Add basic support for returned, rejected Promises
    • Fix JSDoc for Router constructor
    • deps: debug@3.1.0
    • deps: parseurl@~1.3.2
    • deps: setprototypeof@1.1.0
    • deps: utils-merge@1.0.1

5.0.0-alpha.6 / 2017-09-24

This is the sixth Express 5.0 alpha release, based off 4.15.5 and includes changes from 5.0.0-alpha.5.

  • remove:
    • res.redirect(url, status) signature - use res.redirect(status, url)
    • res.send(status, body) signature - use res.status(status).send(body)
  • deps: router@~1.3.1
    • deps: debug@2.6.8

5.0.0-alpha.5 / 2017-03-06

This is the fifth Express 5.0 alpha release, based off 4.15.2 and includes changes from 5.0.0-alpha.4.

5.0.0-alpha.4 / 2017-03-01

This is the fourth Express 5.0 alpha release, based off 4.15.0 and includes changes from 5.0.0-alpha.3.

  • remove:
    • Remove Express 3.x middleware error stubs
  • deps: router@~1.3.0
    • Add next("router") to exit from router
    • Fix case where router.use skipped requests routes did not
    • Skip routing when req.url is not set
    • Use %o in path debug to tell types apart
    • deps: debug@2.6.1
    • deps: setprototypeof@1.0.3
    • perf: add fast match path for * route

5.0.0-alpha.3 / 2017-01-28

This is the third Express 5.0 alpha release, based off 4.14.1 and includes changes from 5.0.0-alpha.2.

  • remove:
    • res.json(status, obj) signature - use res.status(status).json(obj)
    • res.jsonp(status, obj) signature - use res.status(status).jsonp(obj)
    • res.vary() (no arguments) -- provide a field name as an argument
  • deps: array-flatten@2.1.1
  • deps: path-is-absolute@1.0.1
  • deps: router@~1.1.5
    • deps: array-flatten@2.0.1
    • deps: methods@~1.1.2
    • deps: parseurl@~1.3.1
    • deps: setprototypeof@1.0.2

5.0.0-alpha.2 / 2015-07-06

This is the second Express 5.0 alpha release, based off 4.13.1 and includes changes from 5.0.0-alpha.1.

  • remove:
    • app.param(fn)
    • req.param() -- use req.params, req.body, or req.query instead
  • change:
    • res.render callback is always async, even for sync view engines
    • The leading : character in name for app.param(name, fn) is no longer removed
    • Use router module for routing
    • Use path-is-absolute module for absolute path detection

5.0.0-alpha.1 / 2014-11-06

This is the first Express 5.0 alpha release, based off 4.10.1.

  • remove:
    • app.del - use app.delete
    • req.acceptsCharset - use req.acceptsCharsets
    • req.acceptsEncoding - use req.acceptsEncodings
    • req.acceptsLanguage - use req.acceptsLanguages
    • res.json(obj, status) signature - use res.json(status, obj)
    • res.jsonp(obj, status) signature - use res.jsonp(status, obj)
    • res.send(body, status) signature - use res.send(status, body)
    • res.send(status) signature - use res.sendStatus(status)
    • res.sendfile - use res.sendFile instead
    • express.query middleware
  • change:
    • req.host now returns host (hostname:port) - use req.hostname for only hostname
    • req.query is now a getter instead of a plain property
  • add:
    • app.router is a reference to the base router
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment