Skip to content
Menu
Open World News Open World News
  • Privacy Policy
Open World News Open World News

Author: Michael G

Specbee: Integrating Single Directory Components (SDC) and Storybook in Drupal

Posted on July 30, 2024 by Michael G
While one lets you organize your UI components, the other lets you interact with them. Yes, we’re talking about Single Directory Components (SDC) and Storybook. Integrating them transforms your development process, making it revolutionary in how UI components are built and tested.
Let’s dive straight into this intriguing article and discover how leveraging the power of SDC and Storybook can accelerate build time and boost your efficiency.

What is SDC
Did you know that SDC was a contributed module but it is now included in Core from version Drupal 10.3?! SDC, also known as Single Directory Components, represents a new way of structuring and organizing components. What are components? Components in Drupal are reusable building blocks of code that can include Twig templates, metadata, styles, and scripts that needs to be embedded in Drupal templates.
With SDC, developers can easily create components that are swappable and modular, enhancing the overall flexibility and reusability of their codebase.
What is Storybook
Storybook serves as a frontend workshop that helps developers and designers see and test everything in one place before using them in the actual site. What’s better, it is opensource, extremely popular and has a user-friendly interface, making it a tool for modern development workflows!
Storybook lets you develop and test components in isolation. This ensures they work independently before integration. It offers a visual catalog of components so it is easy to see and understand each component’s functionality.
Why integrate SDC with Storybook in Drupal
Integrating SDC with Storybook in Drupal brings many benefits.

It keeps components organized and easy to manage JS and css files, templates, and data flow within components.
You can see and test components in isolation, enhancing the overall maintainability and scalability of UI components.
Speeds up development and ensures everything works perfectly.
Improves collaboration between teams.
Helps maintain a consistent design across the site.

How to integrate SDC with Storybook in Drupal
Setting up and configuring Storybook with Drupal is a straightforward process that involves creating SDC, enabling them, and installing the necessary dependencies. By following a series of steps, developers can seamlessly integrate SDC with Storybook, leveraging tools like Twig and Webpack5 to enhance the templating and rendering capabilities of their components.
Step 1: Setting Up SDC
Enable the SDC core module. It comes out of the box from Drupal 10.1 & above.

If you want to learn how to create SDCs, you can follow this in depth article we wrote previously.
Step 2: Configure Storybook

Install composer require ‘drupal/storybook:^1.0@beta’
Setting up development.service.yml

parameters:
  # …
  twig.config:
    debug: true
    cache: false
  # Disable development mode in production!
  storybook.development: true
  cors.config:
    enabled: true
    allowedHeaders: [‘*’]
    allowedMethods: [‘*’]
    allowedOrigins: [‘*’]
    exposedHeaders: false
    maxAge: false
    supportsCredentials: true
Run the command:drush role:perm:add anonymous ‘render storybook stories’
Under the root folder, run the below commands to set up the storybook:yarn set version berry   echo ‘nodeLinker: node-modules’ >> .yarnrc.yml# Install and configure stock Storybook.   yarn dlx sb init –builder webpack5 –type serverCheck out the Storybook Drupal module to learn more.

Step 3: Create Stories for Components

Develop stories for each SDC component to showcase its functionality and variations.
Utilize Twig files to define the structure and content of each component story.
Ensure that each story accurately represents the behavior and appearance of the corresponding component.

Try it out with an example
Here’s an example of the file structure to create an SDC component with Storybook integration. The component here is “formatted-text”.

Here, the atomic component-driven approach is chosen. So, under atoms, we have placed the formatted-text component.Note: SDC components must be placed under the components/ folder.
Coding snippets for the above component:
1. formatted-text.component.yml

2. formatted-text.css
We can create an SCSS file and then compile it into a CSS file. Here’s how to do that in a gulp.js file:
gulp.src([‘.components/**/*.scss’]).pipe(gulpSass()).pipe(gulp.dest([‘./components’]))

3. formatted-text.stories.twig

Here, we create the stories by adding them using the {% story <name> with { args } %} syntax. The {% stories %} tag serves as the wrapper for all {% story %} tags, as outside of it, the stories have no context.
4. formatted-text.twig
The main template file of the SDC component.

Step 4: Generate Component Stories
The Storybook application doesn’t understand stories in Twig format. The stories must be compiled into *.stories.json files. To do so you can run:         drush storybook:generate-all-stories
If you want to generate stories while watching for files. You can run this command:
    watch –color drush storybook:generate-all-stories
Step 5: Test and iterate

Run the command to start the storybook server and test components:  yarn storybook
Iterate on the design and functionality of components based on feedback and testing results.
Continuously refine and improve the SDC components to enhance their usability and performance.

This is how your storybook page will look like:

Final Thoughts
While integrating SDC with Storybook offers numerous advantages, it’s important to consider potential drawbacks. Some systems may experience performance issues, and not all add-ons may work seamlessly with decorators (controllers of different viewport parameters). Complexities may arise when dealing with multi-nested embeds or higher-order components, requiring careful consideration during development.
Despite these challenges, the integration of SDC and Storybook opens up a new level of possibilities for developers. By creating agnostic components that can be used across different platforms, developers can enhance component visibility via Drupal UI and explore future opportunities, such as integrating components via the layout builder API.

https://www.smily.com/engineering/rds-database-migration-series—integrating-ruby-on

Posted on July 30, 2024 by Michael G
In the previous blog post, we covered our story of migrating a giant database of almost 11 TB. Here comes the last part of the series—making Ruby on Rails applications work with RDS Proxy.

Possible future vmm(4)/vmd(8) on arm64

Posted on July 30, 2024 by Michael G

In an exciting move,
Mike Larkin (mlarkin@)
has
requested
hardware for
vmm(4)
development on the arm64 platform:

CVSROOT:	/cvs
Module name:	www
Changes by:	mlarkin@cvs.openbsd.org	2024/07/27 18:31:12

Modified files:
	.              : want.html 

Log message:
Mac mini M2 needed for vmm(4) development.

This follows
several
earlier
commits
[by Dave Voutila (dv@)]
splitting
vmm(4)/vmd(8)
into
MI
and MD
parts.

FSF Events: Don’t miss Craig Topham’s talk at FOSSY 2024 in Portland, OR on August 2

Posted on July 30, 2024 by Michael G

Author: Source Read more

Microsoft’s CrowdStrike post-mortem

Posted on July 30, 2024 by Michael G
Microsoft has published a post-mortem of the CrowdStrike incident, and goes into great depths to describe where, exactly, the error lies, and how it could lead to such massive problems. I can’t comment anything insightful on the technical details and code they show to illustrate all of this – I’ll leave that discussion up to you – but Microsoft also spends considerable amount of time explaining why security vendors are choosing to use kernel-mode drivers. Microsoft lists three major reasons why security vendors opt for using kernel modules, and none of them will come as a great surprise to OSNews readers: kernel drivers provide more visibility into the system than a userspace tool would, there are performance benefits, and they’re more resistant to tampering. The downsides are legion, too, of course, as any crash or similar issue in kernel mode has far-reaching consequences. The goal, then, according to Microsoft, is to balance the need for greater insight, performance, and tamper resistance with stability. And while the company doesn’t say it directly, this is clearly where CrowdStrike failed – and failed hard. While you would want a security tool like CrowdStrike to perform as little as possible in kernelspace, and conversely as much as possible in userspace, that’s not what CrowdStrike did. They are running a lot of stuff in kernelspace that really shouldn’t be there, such as the update mechanism and related tools. In total, CrowdStrike loads four kernel drivers, and much of their functionality can be run in userspace instead. It is possible today for security tools to balance security and reliability. For example, security vendors can use minimal sensors that run in kernel mode for data collection and enforcement limiting exposure to availability issues. The remainder of the key product functionality includes managing updates, parsing content, and other operations can occur isolated within user mode where recoverability is possible. This demonstrates the best practice of minimizing kernel usage while still maintaining a robust security posture and strong visibility. Windows provides several user mode protection approaches for anti-tampering, like Virtualization-based security (VBS) Enclaves and Protected Processes that vendors can use to protect their key security processes. Windows also provides ETW events and user-mode interfaces like Antimalware Scan Interface for event visibility. These robust mechanisms can be used to reduce the amount of kernel code needed to create a security solution, which balances security and robustness. ↫ David Weston, Vice President, Enterprise and OS Security at Microsoft In what is surely an unprecedented event, I agree with the CrowdStrike criticism bubbling under the surface of this post-mortem by Microsoft. Everything seems to point towards CrowdStrike stuffing way more things in kernelspace than is needed, and as such creating a far larger surface for things to go catastrophically wrong than needed. While Microsoft obviously isn’t going to openly and publicly throw CrowdStrike under the bus, it’s very clear what they’re hinting at here, and this is about as close to a public flogging we’re going to get. Microsoft’s post-portem further details a ton of work Microsoft has recently done, is doing, and will soon be doing to further strenghthen Windows’ security, to lessen the need for kernelspace security drivers even more, including adding support for Rust to the Windows kernel, which should also aid in mitigating some common problems present in other, older programming languages (while not being a silver bullet either, of course).

Renault – Apache Technology for road conditions – Less noise, more sound

Posted on July 29, 2024 by Michael G

Video by via Dailymotion Source With the advent of electric vehicles, one might think that the noise pollution generated by automobiles is on its way out. Yet 80% of a car’s noise is generated by its contact with the road, and poor road conditions exponentially increase noise pollution both inside and outside the vehicle. It’s…

Curso de JavaScript y jQuery = J2 – 3.- Sumadora Simple – 12.- jQuery – val()

Posted on July 29, 2024 by Michael G

Video by via Dailymotion Source Para obtener el valor de un control, será diferente con jQuery, ya que por medio de JavaScript, accedíamos a uno de sus atributos y era tan simple como poner .value.En jQuery será diferente, ya que lo obtendremos por medio de un método o función, esto, después de haber obtenido la…

Mercado projeta inflação maior para 2024 e 2025; Alan Ghani analisa

Posted on July 29, 2024 by Michael G

Video by via Dailymotion Source Analistas consultados pelo Banco Central elevaram a expectativa para a alta do IPCA para 2024 e 2025, de acordo com a mais recente pesquisa Focus divulgada nesta segunda-feira (29). Alan Ghani analisou. Assista ao Jornal da Manhã completo: https://youtube.com/live/w0gAtmHrSfM Baixe o app Panflix: https://www.panflix.com.br/ Inscreva-se no nosso canal:https://www.youtube.com/c/jovempannews Siga o…

How to Edit Monetizable Shorts for TikTok

Posted on July 29, 2024 by Michael G

Video by via Dailymotion Source How to Edit Monetizable Shorts for TikTok As tarah k agr video edit karthay hai to TikTok pr ap copyright content b upload kar sakthay hai koyi issue apko nahi aye ga. TikTok video editing, TikTok Monetizable Shorts, TikTok viral shorts Go to Source

Ika-2 tanker na lumubog sa Bataan kasunod ng MT Terra Nova, pinalibutan ng oil spill boom | 24 Oras

Posted on July 29, 2024 by Michael G

Video by via Dailymotion Source Dalawang lumubog na motor tanker na ang binabantayan ng coast guard sa Bataan dahil sa banta ng oil spill. Bukas na sisipsipin ang milyong litro industrial fuel ng MT Terra Nova ang dahilan ng fishing ban sa Limay, Bataan at sa Bulacan. 24 Oras is GMA Network’s flagship newscast, anchored…

  • Previous
  • 1
  • …
  • 320
  • 321
  • 322
  • 323
  • 324
  • 325
  • 326
  • …
  • 1,531
  • Next

Recent Posts

  • Open Source email Clients
  • When and how to use benchmarking
  • How Plotly AI revolutionizes the dashboard development process
  • [TUT] LoRa & LoRaWAN – MikroTik wAP LR8 kit mit The Things Network verbinden [4K | DE]
  • Mercado aguarda Powell e olha Trump, dados e Haddad | MINUTO TOURO DE OURO – 11/02/25

Categories

  • Android
  • Linux
  • News
  • Open Source
©2025 Open World News | Powered by Superb Themes
We use cookies on our website to give you the most relevant experience by remembering your preferences and repeat visits. By clicking “Accept All”, you consent to the use of ALL the cookies. However, you may visit "Cookie Settings" to provide a controlled consent.
Cookie SettingsAccept All
Manage consent

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. These cookies ensure basic functionalities and security features of the website, anonymously.
CookieDurationDescription
cookielawinfo-checkbox-analytics11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics".
cookielawinfo-checkbox-functional11 monthsThe cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional".
cookielawinfo-checkbox-necessary11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary".
cookielawinfo-checkbox-others11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other.
cookielawinfo-checkbox-performance11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance".
viewed_cookie_policy11 monthsThe cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data.
Functional
Functional cookies help to perform certain functionalities like sharing the content of the website on social media platforms, collect feedbacks, and other third-party features.
Performance
Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.
Analytics
Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics the number of visitors, bounce rate, traffic source, etc.
Advertisement
Advertisement cookies are used to provide visitors with relevant ads and marketing campaigns. These cookies track visitors across websites and collect information to provide customized ads.
Others
Other uncategorized cookies are those that are being analyzed and have not been classified into a category as yet.
SAVE & ACCEPT