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/server
Advanced tools
@storybook/server is a Storybook addon that allows you to integrate server-rendered components into your Storybook environment. It is particularly useful for testing and developing components that rely on server-side data or rendering.
Server-rendered components
This feature allows you to add server-rendered components to your Storybook. The code sample demonstrates how to define a story for a server-rendered component using the `storiesOf` API.
import { storiesOf } from '@storybook/server';
storiesOf('ServerComponent', module)
.add('default', () => {
return {
template: '<div>Server-rendered content</div>',
context: { /* server-side context */ }
};
});
Integration with server-side data
This feature allows you to integrate server-side data into your components. The code sample shows how to pass server-side data to a component in Storybook.
import { storiesOf } from '@storybook/server';
storiesOf('DataComponent', module)
.add('with data', () => {
return {
template: '<div>{{data}}</div>',
context: { data: 'Server-side data' }
};
});
storybook-addon-next is an addon for Storybook that provides support for Next.js applications. It allows you to render Next.js pages and components within Storybook, similar to how @storybook/server handles server-rendered components. However, it is specifically tailored for Next.js, whereas @storybook/server is more generic.
storybook-addon-apollo-client is an addon that integrates Apollo Client with Storybook, allowing you to mock GraphQL queries and mutations. While @storybook/server focuses on server-rendered components, storybook-addon-apollo-client is more about integrating GraphQL data fetching into your Storybook stories.
FAQs
Storybook Server renderer
The npm package @storybook/server receives a total of 18,157 weekly downloads. As such, @storybook/server popularity was classified as popular.
We found that @storybook/server demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 12 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.