Skip to content

Releases: marblejs/marble

v1.0.0 - official release

18 Sep 19:34
Compare
Choose a tag to compare

🚀 We made it! 🎉

celebrate

v1.0.0-rc.3

17 Sep 09:17
Compare
Choose a tag to compare
v1.0.0-rc.3 Pre-release
Pre-release

Whats new?

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

10 Sep 10:51
Compare
Choose a tag to compare
v1.0.0-rc.2 Pre-release
Pre-release

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 the matchType. Going to the expectations we introduced dedicated CoreError type used for throwing an package related error messages, eg. for notifying non-TypeScript developers if they made a mistake in the method arguments.

45175504-e9b3e500-b20d-11e8-8e9a-7eebec47ea55

  • 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

13 Aug 18:45
Compare
Choose a tag to compare
v1.0.0-rc.1 Pre-release
Pre-release

Breaking changes

  • Changed httpListener error handler attribute from errorMiddleware 👉 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.js http.OutgoingMessage API. The res.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

07 Jul 18:31
Compare
Choose a tag to compare
v1.0.0-rc.0 Pre-release
Pre-release

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 and matchType stream operators are removed and are part of EffectFactory 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

v0.5.0

13 Jun 15:41
Compare
Choose a tag to compare
v0.5.0 Pre-release
Pre-release

Whats new?

  • combineRoutes() API allows to compose middlewares for grouped routes (feature request: #36)
  • corrected @marblejs/middleware-logger response time logging (issue: #48)

v0.4.2

10 Jun 18:30
Compare
Choose a tag to compare
v0.4.2 Pre-release
Pre-release

Whats new?

  • fixed an issue with not matched routes in case of reordered matchType and matchPath operators for the same routes but with different methods (PR #46)

v0.4.1

03 Jun 14:25
Compare
Choose a tag to compare
v0.4.1 Pre-release
Pre-release

Whats new?

  • resolved an issue with TypeScript compiler flag responsible for strict function types (issue: #43)
  • added support for TypeScript v2.9.1

v0.4.0

30 May 22:18
Compare
Choose a tag to compare
v0.4.0 Pre-release
Pre-release

Whats new?

  • fixed an issue with Effects matching hazard (issue: #35)
  • ability to create 404 handlers using matchType('*') and matchPath('*') (issue: #27)
  • HttpError constructor now can take data: object as optional third argument

v0.3.2

29 May 21:20
Compare
Choose a tag to compare
v0.3.2 Pre-release
Pre-release

Whats new?

  • support for non-JSON Effect return types (issue: #33)
  • mime-type/content-type auto detection (PR: #37)

Thanks @couzic!