Releases: marblejs/marble
Releases · marblejs/marble
v1.0.0 - official release
v1.0.0-rc.3
Whats new?
- Integration with path-to-regexp library
- Support for wildcard parameter, eg.
/foo/:param*
. For more details see: example implementation
const getFile$ = EffectFactory
.matchPath('/:dir*')
.matchType('GET')
.use(req$ => req$
.pipe(
map(req => req.params.dir as string),
switchMap(readFile(STATIC_PATH)),
map(body => ({ body }))
));
- Fixed a problem with incorrectly generated declaration files for
@marblejs/middleware-joi
package.
v1.0.0-rc.2
Whats new?
- Fixed problem with incorrectly concatenated wildcard endpoint when combined with parametrized route.
const notFound$ = EffectFactory
.matchPath('*')
.matchType('*')
.use(req$ => req$.pipe(
switchMap(() =>
throwError(new HttpError('Route not found', HttpStatus.NOT_FOUND))
)
));
export const api$ = combineRoutes(
'/api/:version',
[ notFound$ ],
);
- For non-TypeScript developers there was no validation made during app startup, eg.
EffectFactory
methods were not validated if developer provided wrong HTTP method to thematchType
. Going to the expectations we introduced dedicatedCoreError
type used for throwing an package related error messages, eg. for notifying non-TypeScript developers if they made a mistake in the method arguments.
- TypeScript v.3.0.x support
- RxJS v6.2.2 support
- Lerna v3.3.0 support
- Introduced Webpack based build process - from now builds are optimized and properly compressed
v1.0.0-rc.1
Breaking changes
- Changed
httpListener
error handler attribute fromerrorMiddleware
👉errorEffect
. There was an inconsistency with previous error handler definition and naming. We had to correct this because error handler acts as an Effect instead of Middleware.
old bootstrapping API:
const app = httpListener({
middlewares,
effects,
errorMiddleware, 👈
});
new bootstrapping API:
const app = httpListener({
middlewares,
effects,
errorEffect, 👈
});
Whats new?
- Exposed
res.send
method - from now you don't have to send response manually via dedicated Node.jshttp.OutgoingMessage
API. Theres.send
method returns an empty stream, thus it can be easily composed inside middleware pipeline.
const middleware$: Middleware = (req$, res) =>
req$.pipe(
switchMap(() => res.send({ body: 💩, status: 304, headers: /* ... */ }),
);
- Exposed type aliases for common Marble.js architectural blocks:
const effect$: Effect = req$ =>
req$.pipe(
// ...
);
const middleware$: Middleware = (req$, res) =>
req$.pipe(
// ...
);
const error$: ErrorEffect = (req$, res, err) =>
req$.pipe(
// ...
);
v1.0.0-rc.0
Breaking changes
- In order to factorize the routing table statically, we need to introduce the breaking change in Effect API definition.
Old Effect API:
const getUsers$: Effect = request$ =>
request$.pipe(
matchPath('/'),
matchType('GET'),
// ...
);
New Effect API:
const getUsers$ = EffectFactory
.matchPath('/')
.matchType('GET')
.use(req$ => req$.pipe(
// ...
));
- separately imported
matchPath
andmatchType
stream operators are removed and are part ofEffectFactory
instead.
Whats new?
@marblejs/core
- internals - refactored + rebuilt routing resolving mechanism. Thanks to the latest changes we gained hudge performance boost.@marblejs/core
- internals - improved performance for middleware resolving flow@marblejs/core
- internals - rewritten URL params intercepting mechanism@marblejs/middleware-body
- added support for x-www-form-urlencoded Content-Type