![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
@storybook/channel-websocket
Advanced tools
Storybook Websocket Channel is a channel for Storybook that can be used when the Storybook Renderer should communicate with the Storybook Manager over the network. A channel can be created using the `createChannel` function.
The @storybook/channel-websocket npm package is used within the Storybook ecosystem to facilitate communication between the Storybook UI and the server or between different frames of the UI using WebSockets. This package is particularly useful for enabling real-time updates and interactions in the Storybook UI, which is a tool for developing UI components in isolation for React, Vue, Angular, and more.
Establishing WebSocket connection
This code sample demonstrates how to establish a WebSocket connection using the WebSocketTransport class provided by @storybook/channel-websocket. This is essential for enabling real-time communication between the Storybook UI and the server.
import { WebSocketTransport } from '@storybook/channel-websocket';
const transport = new WebSocketTransport({ url: 'ws://localhost:9001' });
const channel = createChannel({ transport });
Sending messages
This code sample shows how to send messages over the established WebSocket connection. This is useful for triggering events or sending data from one part of the UI to another or to the server.
channel.emit('event-name', { payload: 'data' });
Receiving messages
This code sample illustrates how to listen for messages on the WebSocket channel. This allows the UI to react to data or events sent from the server or other parts of the UI.
channel.on('event-name', (data) => {
console.log('Received data:', data);
});
Socket.IO-client is a popular WebSocket library that enables real-time, bidirectional and event-based communication. It is similar to @storybook/channel-websocket but is more general-purpose and not specifically tailored for Storybook.
The 'ws' package is a simple to use, blazing fast, and thoroughly tested WebSocket client and server implementation. Unlike @storybook/channel-websocket, 'ws' provides both client and server-side capabilities, making it more versatile for different WebSocket needs.
Storybook Websocket Channel is a channel for Storybook that can be used when the Storybook Renderer should communicate with the Storybook Manager over the network.
A channel can be created using the createChannel
function.
import createChannel from '@storybook/channel-websocket';
const channel = createChannel({ url: 'ws://localhost:9001' });
For more information visit: storybook.js.org
7.0.0-alpha.6 (June 21, 2022)
index.json
for composition (#18521)extract
script works and SBs can be composed into v6 storybooks (#18409)FAQs
Unknown package
We found that @storybook/channel-websocket demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 8 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.