Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
@storybook/source-loader
Advanced tools
The @storybook/source-loader package is a loader for webpack that allows you to load the source code of a story into Storybook. This enables you to display the source code in a live code editor or snippet for documentation purposes, which can be helpful for developers to understand how to use a component. It is part of the Storybook ecosystem, which is a tool for developing UI components in isolation for React, Vue, Angular, and more.
Load story source code
This webpack configuration snippet shows how to include the @storybook/source-loader as a pre-loader for files that match the `.stories.js` or `.stories.jsx` pattern. This allows Storybook to display the source code of these stories.
module.exports = {
module: {
rules: [
{
test: /\.stories\.jsx?$/,
loaders: [require.resolve('@storybook/source-loader')],
enforce: 'pre',
},
],
},
};
The raw-loader package is similar to @storybook/source-loader in that it allows you to import files as a string. However, it is not specific to Storybook and does not have the capability to integrate with Storybook's UI to display source code alongside component stories.
While not a webpack loader, highlight.js is a syntax highlighter that can be used to display source code in a formatted way on web pages. It is similar to @storybook/source-loader in that it helps with displaying readable source code, but it does not have the Storybook integration for loading story sources automatically.
The storybook-addon-code package is an addon for Storybook that allows you to show code samples in your stories. It is similar to @storybook/source-loader in its purpose of displaying source code for documentation, but it works as an addon that you can configure within Storybook rather than a webpack loader.
FAQs
Source loader
The npm package @storybook/source-loader receives a total of 1,021,801 weekly downloads. As such, @storybook/source-loader popularity was classified as popular.
We found that @storybook/source-loader 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
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.