Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@liveblocks/core

Package Overview
Dependencies
Maintainers
0
Versions
313
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@liveblocks/core - npm Package Versions

1
32

1.1.0-yjs4

Diff

guillaumesalles
published 1.1.0-yjs3 •

guillaumesalles
published 1.1.0-yjs2 •

guillaumesalles
published 1.1.0-yjs1 •

guillaumesalles
published 1.1.0 •

Changelog

Source

v1.1.0

This release improves the client’s internals to ensure a more reliable connection with Liveblocks servers.

@liveblocks/client

  • New APIs:
    • room.getStatus(): returns the current status of the WebSocket connection: "initial", "connecting", "connected", "reconnecting", or "disconnected"
    • room.subscribe("status"): subscribe to changes of the connection status.
    • room.subscribe("lost-connection"): high-level API to get informed when Liveblocks’ automatic reconnection process is taking longer than usual, so you can show a toast message on screen. (See this example for an illustration.)
  • New behavior:
    • The client will stop retrying to establish a connection in cases where retrying would not help. For example an explicit 403 forbidden response from your backend, or a configuration error.
    • The client will more quickly reconnect even after long periods of sleep.

@liveblocks/react

  • New APIs:
    • useStatus() - React hook version of room.getStatus()
    • useLostConnectionListener() - React hook version of room.subscribe("lost-connection") (See this example for an illustration.)

Bugs fixed

  • Reconnection would sometimes not work after long periods of sleep. Waking up is now instant.
  • React clients using Suspense could sometimes incorrectly bounce back to the Suspense boundary after a successful load. No longer!
  • Client could sometimes not load storage after reconnecting. Not anymore!
  • Others array will no longer flash during an internal reconnect.
  • DevTools now keeps working even when the client goes offline.

Deprecated APIs

These APIs still work, but are replaced by newer APIs. The old APIs will be removed in a future release of Liveblocks.

Old connection status codes are replaced by the new ones:

| ❌ Old statuses | ✅ New statuses | | --------------- | --------------- | | closed | initial | | authenticating | connecting | | connecting | connecting | | open | connected | | unavailable | reconnecting | | failed | disconnected |

Recommended steps to upgrade:

  • room.getConnectionState() → ✅ room.getStatus()
  • room.subscribe('connection') → ✅ room.subscribe('status')
  • Old client options:
    • clientOptions.fetchPolyfill
    • clientOptions.WebSocketPolyfill → ✅ clientOptions.polyfills: { fetch, WebSocket }
guillaumesalles
published 1.1.0-beta6 •

guillaumesalles
published 1.1.0-beta5 •

guillaumesalles
published 1.1.0-beta4 •

guillaumesalles
published 1.0.12-yjs3 •

guillaumesalles
published 1.0.12-yjs2 •

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc