Security News
New Python Packaging Proposal Aims to Solve Phantom Dependency Problem with SBOMs
PEP 770 proposes adding SBOM support to Python packages to improve transparency and catch hidden non-Python dependencies that security tools often miss.
@storybook/react-vite
Advanced tools
Storybook for React and Vite: Develop React components in isolation with Hot Reloading.
@storybook/react-vite is a package that integrates Storybook with Vite for React projects. It allows developers to build and test UI components in isolation with the fast and modern build tool Vite.
Setup Storybook with Vite
This command initializes a new Storybook configuration in your React project using Vite as the builder. It sets up the necessary files and dependencies to get started with Storybook and Vite.
npx sb init --builder @storybook/react-vite
Writing Stories
This code demonstrates how to write a story for a Button component in a React project. It defines a default export with metadata about the component and creates a template for the story. The `Primary` story is an instance of the template with specific arguments.
import React from 'react';
import { Button } from './Button';
export default {
title: 'Example/Button',
component: Button,
};
const Template = (args) => <Button {...args} />;
export const Primary = Template.bind({});
Primary.args = {
primary: true,
label: 'Button',
};
Running Storybook
This command starts the Storybook development server, allowing you to view and interact with your stories in the browser. It uses Vite for fast builds and hot module replacement.
npm run storybook
@storybook/react is the standard Storybook package for React projects. It uses Webpack as the default builder, which may be slower compared to Vite but is more mature and has broader plugin support.
storybook-builder-vite is another package that integrates Vite with Storybook. It is an alternative to @storybook/react-vite and offers similar performance benefits by leveraging Vite's fast build times.
See documentation for installation instructions, usage examples, APIs, and more.
FAQs
Storybook for React and Vite: Develop React components in isolation with Hot Reloading.
We found that @storybook/react-vite 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
PEP 770 proposes adding SBOM support to Python packages to improve transparency and catch hidden non-Python dependencies that security tools often miss.
Security News
Socket CEO Feross Aboukhadijeh discusses open source security challenges, including zero-day attacks and supply chain risks, on the Cyber Security Council podcast.
Security News
Research
Socket researchers uncover how threat actors weaponize Out-of-Band Application Security Testing (OAST) techniques across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.