Migration from version 3.x
This chapter provides a set of guidelines to help you migrate from Marble.js version 3.x to the latest 4.x version.
The newest iteration comes with some API breaking change, but don’t worry, these are not game-changers, but rather convenient improvements that open the doors to new future possibilities. During the development process, the goal was to notify and discuss incoming changes within the community as early as possible. You can check here what has changed since the latest version.
For more detailed info about more low-level improvements, please visit release candidate changelog.

@marblejs/core

Legacy EffectFactory builder is no longer available. Please user r builder instead.
Legacy switchToProtocol operator is no longer available.

@marblejs/http

Moved HTTP-related API's from @marblejs/core to new package @marblejs/http, eg.
❌ Old (example):
1
import { HttpRequest, HttpEffect, useContext } from '@marblejs/core';
Copied!
✅ New (example):
1
import { useContext } from '@marblejs/core';
2
import { HttpRequest, HttpEffect } from '@marblejs/http';
Copied!
HttpOutputEffect - Improved interface
❌ Old:
1
Observable<{ req, res: { status, body, headers } }>
2
-> Observable<{ status, body, headers }>
Copied!
✅ New:
1
Observable<{ status, body, headers, request }>
2
-> Observable<{ status, body, headers, request }>
Copied!
HttpErrorEffect - Improved interface
❌ Old:
1
Observable<{ req, error }>
2
-> Observable<{ status, body, headers }>
Copied!
✅ New:
1
Observable<{ error, request }>
2
-> Observable<{ status, body, headers, request }>
Copied!

@marblejs/messaging

❌ Old:
1
import { messagingClient, eventBus, eventBusClient } from '@marblejs/messaging';
Copied!
✅ New:
1
import { MessagingClient, EventBus, EventBusClient } from '@marblejs/messaging';
Copied!

@marblejs/websockets

Version 4.x removes deprecated legacy connection$ attribute. Please use HTTP upgrade event for checking connections.

@marblejs-contrib/middleware-joi

❌ Old:
1
npm i @marblejs/middleware-joi
Copied!
✅ New:
1
npm i @marblejs-contrib/middleware-joi
Copied!

@marblejs-contrib/middleware-jwt

❌ Old:
1
npm i @marblejs/middleware-jwt
Copied!
✅ New:
1
npm i @marblejs-contrib/middleware-jwt
Copied!
Last modified 16d ago