v2.0.0
The Racer codebase is now in TypeScript, with bundled type definitions in the package!
There are only a few breaking changes, and preparation for them can be done on racer@1, prior to upgrading.
Breaking changes
- The
Model
class is now an abstract class, so it should no longer be directly constructed. UsecreateModel()
instead.- For example,
new racer.Model()
->racer.createModel()
- Directly trying to construct
Model
can result in errors likeCannot set properties of undefined (setting 'socket')
fromModel.createConnection
- For example,
- Drop support for Node 10-14
- When using
backend.modelMiddleware()
,req
objects will no longer have the deprecatedgetModel()
function.- Switch to the
req.model
reference added by the middleware, if you haven't already.
- Switch to the
- The root module
racer
now individually exports functions and classes, instead of the entire module export being an instance of a Racer class.- It should be functionally equivalent, but this change is documented for completeness.
- For the
model.bundle()
called used in Derby's server-side rendering, a customized default time limit can no longer be set via a staticModel.BUNDLE_TIMEOUT
property.- The only way to set a custom timeout now is passing the
{ bundleTimeout: timeoutInMs }
option tocreateModel()
. - If no custom timeout is provided, a system default of 10 seconds will be applied.
- The only way to set a custom timeout now is passing the
What's Changed
- Racer 2 by @craigbeck in #302
Full Changelog: v1.1.0...v2.0.0