LogoLogo
ChangelogGitHubTwitterGitter
v4.x
v4.x
  • Marble.js
  • Getting started
    • Installation
    • Quick setup
  • HTTP
    • Effects
    • Middlewares
    • Routing
    • Errors
    • Output
    • Context
    • Advanced
      • Logging
      • Validation
      • Server Events
      • Streaming
      • Continuous mode
  • Messaging
    • Core concepts
      • Events
      • Effects
    • Microservices
      • AMQP (RabbitMQ)
      • Redis Pub/Sub
    • CQRS
    • WebSockets
  • Testing
    • HTTP routes testing
  • Other
    • How does it glue together?
    • Migration guides
      • Migration from version 3.x
      • Migration from version 2.x
      • Migration from version 1.x
    • API reference
      • @marblejs/core
        • bindTo
        • bindEagerlyTo
        • createEvent
        • createContextToken
        • operator: matchEvent
        • operator: use
        • operator: act
      • @marblejs/http
        • httpListener
        • r.pipe
        • combineRoutes
        • createServer
      • @marblejs/messaging
        • eventBus
        • messagingClient
        • createMicroservice
        • reply
      • @marblejs/websockets
        • webSocketListener
        • operator: broadcast
        • operator: mapToServer
      • @marblejs/middleware-multipart
      • @marblejs/middleware-cors
      • @marblejs/middleware-io
      • @marblejs/middleware-logger
      • @marblejs/middleware-body
      • @marblejs-contrib/middleware-jwt
        • Token signing
      • @marblejs-contrib/middleware-joi
    • Style Guide
    • FAQ
Powered by GitBook
On this page
  • @marblejs/core
  • @marblejs/http
  • @marblejs/messaging
  • @marblejs/websockets
  • @marblejs-contrib/middleware-joi
  • @marblejs-contrib/middleware-jwt
  1. Other
  2. Migration guides

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.

PreviousMigration guidesNextMigration from version 2.x

Last updated 3 years ago

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 .

For more detailed info about more low-level improvements, please visit release candidate .

@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):

import { HttpRequest, HttpEffect, useContext } from '@marblejs/core';

✅ New (example):

import { useContext } from '@marblejs/core';
import { HttpRequest, HttpEffect } from '@marblejs/http';

HttpOutputEffect - Improved interface

❌ Old:

Observable<{ req, res: { status, body, headers } }>
  -> Observable<{ status, body, headers }>

✅ New:

Observable<{ status, body, headers, request }>
  -> Observable<{ status, body, headers, request }>

HttpErrorEffect - Improved interface

❌ Old:

Observable<{ req, error }>
  -> Observable<{ status, body, headers }>

✅ New:

Observable<{ error, request }>
  -> Observable<{ status, body, headers, request }>

@marblejs/messaging

❌ Old:

import { messagingClient, eventBus, eventBusClient } from '@marblejs/messaging';

✅ New:

import { MessagingClient, EventBus, EventBusClient } from '@marblejs/messaging';

@marblejs/websockets

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

@marblejs-contrib/middleware-joi

❌ Old:

npm i @marblejs/middleware-joi

✅ New:

npm i @marblejs-contrib/middleware-joi

@marblejs-contrib/middleware-jwt

❌ Old:

npm i @marblejs/middleware-jwt

✅ New:

npm i @marblejs-contrib/middleware-jwt
what has changed since the latest version
changelog