clemens-tolboom commented on pull request MikeSchulze/gdUnit4#207

On github - Fri, 2023/06/16 - 9:55am
clemens-tolboom commented on MikeSchulze/gdUnit4#207 · June 16, 2023 07:55 clemens-tolboom commented Jun 16, 2023

All code changes starts from an issue. (that was the whole point of this #204 ;-) )

clemens-tolboom commented on pull request MikeSchulze/gdUnit4#207

On github - Fri, 2023/06/16 - 9:54am
clemens-tolboom commented on MikeSchulze/gdUnit4#207 · June 16, 2023 07:54 clemens-tolboom commented Jun 16, 2023

I never heard of GitHub Flow ... can this be linked to a blog or docs?

clemens-tolboom commented on pull request MikeSchulze/gdUnit4#207

On github - Fri, 2023/06/16 - 9:52am
clemens-tolboom commented on MikeSchulze/gdUnit4#207 · June 16, 2023 07:52 clemens-tolboom commented Jun 16, 2023

It's recommended to familiarize yourself with GitHub's features and workflow I guess our users are savvy git users but maybe not GitHub? What fea…

clemens-tolboom commented on pull request MikeSchulze/gdUnit4#207

On github - Fri, 2023/06/16 - 9:52am
clemens-tolboom commented on MikeSchulze/gdUnit4#207 · June 16, 2023 07:52 clemens-tolboom commented Jun 16, 2023

Thank you for considering contributing to GdUnit4! Make H2? Or new line to make it more explicit

clemens-tolboom commented on issue godotengine/godot#72825

On github - Thu, 2023/06/15 - 9:16pm
clemens-tolboom commented on godotengine/godot#72825 · June 15, 2023 19:16 clemens-tolboom commented Jun 15, 2023

<C++ Source> modules/gdscript/gdscript_vm.cpp:697 @ call() In #75550 we use the build-in GDScript editor which @dakennedyd thinks relates to this…

clemens-tolboom commented on issue godotengine/godot#75550

On github - Thu, 2023/06/15 - 9:12pm
clemens-tolboom commented on godotengine/godot#75550 · June 15, 2023 19:12 clemens-tolboom commented Jun 15, 2023

It was a hot reload/script edit while running ... I do that a lot but thought my anonymous functions caused it. Issue #72825 is only mentioning ext…

Promet Source: 10 Reasons to for Government to Love Drupal 10

Planet Drupal - Thu, 2023/06/15 - 6:54pm
The seemingly uneventful December 2022 release of Drupal 10 reflects the new normal for Drupal – away from the concept of “migration” to the latest version, and the realization that “upgrade” more aptly describes the the process of getting into alignment with current Drupal advantages.  For government and public sector websites, however, Drupal 10 features represents several significant leaps forward – all the best features and functionalities of Drupal 9 and plus tightened security, powerful configurability, enhanced flexibility, and integration-rich.
Categories:

Community Working Group posts: 2023 Aaron Winborn Award Winner: Randy Fay

Planet Drupal - Thu, 2023/06/15 - 4:46pm

During DrupalCon Pittsburgh 2023, the members of the Drupal Community Working Group were pleased to announce the winner of the 2023 Aaron Winborn Award, Randy Fay (rfay).

About Rfay

Randy joined our Drupal community more than 17 years ago and has been an engaged member ever since. Randy loves dueling with computers and his career has spanned Apple ][ home automation, Unix/Linux kernel driver development, Windows, Drupal, and loads of fun system administration and DevOps work. After years of Drupal work he delights in maintaining DDEV, which provides an easy way to do web development on a local computer. Oh, and he’s done lots of traveling by bicycle, including a 2 1/2 year journey through the Americas from the Yukon to Patagonia.

Many Nominations

This year, there were 17 different individuals nominated for the award. In the coming weeks, the CWG will be contacting all nominees to let them know of their nomination, sharing some details about what their nominators wrote about them, and thank them for their continued work in the community.

Several community members nominated Randy for the 2023 Aaron Winborn Award. Here are a few of the things they said:

As a nearly 18-year member of the Drupal community, Randy has made countless contributions to the growth and success of the platform. His work on important projects such as the "Examples for Developers" modules, as well as many projects in the commerce suite, has been invaluable to the community. He has also been a wonderful speaker at camps and conferences, sharing his expertise and insights with others.

In addition to his impressive technical skills, Randy's tireless work on the DDEV project has been a game-changer for Drupal developers. His commitment to creating a local development tool that simplifies and streamlines the development process has saved countless hours of work for developers around the world.

What sets Randy apart, however, is his unwavering commitment to kindness and his above-and-beyond dedication to the Drupal community. He is always willing to lend a helping hand, whether it's through trainings, mentorship, or simply being a friendly and supportive presence within the community.

His contributions have been immeasurable, and his character and commitment to the Drupal community make him a shining example of what this award represents.

About the Aaron Winborn Award

The award is named after a long-time Drupal contributor who lost his battle with ALS in 2015. This award recognizes an individual who, like Aaron, demonstrates personal integrity, kindness, and an above-and-beyond commitment to the Drupal project and community.

Previous winners of the award are Cathy Theys, Gabór Hojtsy, Nikki Stevens, Kevin Thull, Leslie Glynn, Baddý Breidert, AmyJune Hineline, and Angie Byron. Current CWG members, along with previous winners, selected the winner based on nominations submitted by Drupal community members.

Nominations for the 2024 award will open in early 2024.

Categories:

Agaric Collective: Display lists naturally with the In Other Words module for Drupal

Planet Drupal - Thu, 2023/06/15 - 1:43pm

It is common for a Drupal site to list multiple items. It could be several authors of a single article, the days a recreation center is open, or the flavors an ice cream parlor serves. Clean, structured data is a strong point of Drupal, but the display of that structured content is limited out of the box. That is why DevCollaborative partnered with the Agaric Tech Collective to complete a stable release of In Other Words, a Drupal module that gives site builders the power to configure precise and natural ways to display lists of items.

Read more and discuss at agaric.coop.

Categories:

LN Webworks: 5 Must-Have CMS Features Your Enterprise Applications Needs in 2023

Planet Drupal - Thu, 2023/06/15 - 8:08am

Enterprise-level content management systems (CMSs) are software applications that empower businesses to manage their digital content and assets seamlessly. They are equipped with cutting-edge tools and resources required to develop phenomenal sites with engaging content. With a CMS, you can create and update web pages even without any know-how in design and coding. These incredible aspects have given rise to an immense fondness for enterprise applications across the globe. According to research, 73 million sites use a CMS. Besides, 43.6% of sites have been custom-built with CMSs like Drupal. Seems intriguing, doesn’t it?

Categories:

Nonprofit Drupal posts: June Drupal for Nonprofits Chat: DrupalCon Debrief

Planet Drupal - Wed, 2023/06/14 - 6:50pm

Join us TOMORROW, Thursday, June 14 at 1pm ET / 10am PT, for our regularly scheduled call to chat about all things Drupal and nonprofits. (Convert to your local time zone.)

In this month's informal chat, we'll be talking about DrupalCon Pittsburgh.  What did we learn?  What went well?  What could be better?  Got something specific on your mind? Feel free to share ahead of time in our collaborative Google doc: https://nten.org/drupal/notes!

All nonprofit Drupal devs and users, regardless of experience level, are always welcome on this call.

This free call is sponsored by NTEN.org and open to everyone. 

  • Join the call: https://us02web.zoom.us/j/81817469653

    • Meeting ID: 818 1746 9653
      Passcode: 551681

    • One tap mobile:
      +16699006833,,81817469653# US (San Jose)
      +13462487799,,81817469653# US (Houston)

    • Dial by your location:
      +1 669 900 6833 US (San Jose)
      +1 346 248 7799 US (Houston)
      +1 253 215 8782 US (Tacoma)
      +1 929 205 6099 US (New York)
      +1 301 715 8592 US (Washington DC)
      +1 312 626 6799 US (Chicago)

    • Find your local number: https://us02web.zoom.us/u/kpV1o65N

  • Follow along on Google Docs: https://nten.org/drupal/notes

View notes of previous months' calls.

Categories:

The Drop Times: Open Source as a Humanitarian Opportunity

Planet Drupal - Wed, 2023/06/14 - 4:24pm
The beauty of open source arises when one person improves the software and gives that back to the community with no expectation of anything in return. 
Categories:

LN Webworks: Views Responsive Grids: Drupal 10’s Incredible Feature for Responsive Web Design

Planet Drupal - Wed, 2023/06/14 - 12:31pm

Drupal is an ingenious content management system (CMS) known for astonishing the world with unbelievable features every now and then. Recently, the release of the latest Drupal 10, packed with awe-inspiring features caused a sensation worldwide. Views Responsive Grids is a Drupal 10 feature that contributed a fair share to the buzz it created. This phenomenal feature has revolutionized responsive design. Once you get a glimpse of the magic Views Responsive Grids can create, you cannot help but make Drupal 10 your new companion.

Wondering why everyone sings praises of this Drupal 10 feature? Let’s take an intriguing journey to help you understand what makes Views Responsive Grids worthy of it. But, before that, here is a prophecy for you: after getting acquainted with what this feature can do for you, you will also be prompted to join the club of its admirers.

Categories:

DrupalEasy: DrupalCon Pittsburgh 2023 Superlatives

Planet Drupal - Tue, 2023/06/13 - 8:51pm

Unless you've been living underneath a Druplicon-shaped rock, you're probably aware that DrupalPalooza Pittsburgh took place June 5-8. If so, I'm guessing that your Drupal newsfeed is full of wrap-up articles and summaries that may feel a bit redundant (I know that mine is and that they do).

It is in the spirit of hopefully spicing up your Drupal news consumption that this will not be one of those blog posts. Rather, in my somewhat still high-school-aged mind, I'm rolling back the clock to present the DrupalCon Pittsburgh 2023 Superlatives 🎉

Best session (that I attended): Drupal Distributions & Recipes Initiative Update - but don't get too excited, Mr. Jim Birch (the presenter) 😜, as I really don't go to a whole lot of sessions normally. That being said, it is difficult not to get excited about Recipes and this session was exactly what I was hoping for.

Most "It's about time" thing: Randy Fay winning the Aaron Winborn Award.

Most fulfilling personal moment: The DrupalEasy Learning Community alumni and mentor lunch. Having so many of our graduates and mentors in one place was quite gratifying, even if they did turn teasing me into a competitive sport. 

Most of the alumni present were from our long-running 12-week, best practice and beginner focused Drupal Career Online http://drupaleasy.com/dco (next semester begins August 28.)

Best official/unofficial party: The Lullabot Party. There are a few things I really need at a party these days: a volume level where I don't have to scream to have a conversation, an outdoor area, activities, and good food and drink. This one was 4-for-4. The Pins x Pints Barcade Bash from Acquia came in a close second.

Favorite session that I didn't see in person but have since watched: Advanced Render Cache Debugging presented by Jody Hamilton and Janez Urevc. I'll watch pretty much anything having to do with Drupal caching, and this was one of the better presentations I've ever seen on the topic. Well worth your time.

Most useful thing that I really liked but probably not too many other people did: The distance between the expo hall and the session rooms.

Biggest question I left with: Which hosting companies are going to step up and fully support (and promote) hosting plans for Automatic Updates (and therefore Project Browser) for less technical Drupal site-builders?

Best new "thing": I am not a fan of draws (even though I do love soccer,) but in this case I really can't pick one. Both Pitch-burg and the Drupal Association Member Breakfast were fantastic additions this year. I love incentivizing folks to join the Drupal Association (especially with free food.) Also, I was a bit skeptical of Pitch-burg at first, but I really enjoyed how Dries weaved it into his keynote, and I am really looking forward to seeing how the funded projects turn out.

Best contributed module release that took place during DrupalCon: Smart Trim 2.1.0

Biggest complaint: Why was the Single Directory Components session in such a small room? Silly.

Worst accommodations: Mine (shared with Gwendolyn, Sara, John, and Ryan.) We were in an Airbnb that was located by itself in the middle of a mostly-abandoned, overgrown industrial park. We had difficulty getting ride-share drivers there after dark. Seriously. Perhaps we need to read the reviews more carefully next time.

Biggest personal takeaways: Single Directory Components and Recipes are the future of Drupal. Also, the average age of community members needs to get younger (no offense, REDACTED.)

Best completely unofficial social event: The Pirates/A's baseball game on Wednesday afternoon (that led into Wednesday evening.)

Most inconvenient alarm: Thursday, 5am, in the bedroom of our sketchy Airbnb so I could finish prep for the Intro to Module Development workshop I was teaching at 9am.

Favorite image from another DrupalCon Pittsburgh wrap-up blog post: Ted Bowman (T-Bone to his friends) shot-gunning a beer(?) on the keynote stage on Mike Herchel's blog

Categories:

Bounteous.com: Composability and Drupal: Going Headless at Scale

Planet Drupal - Tue, 2023/06/13 - 8:46pm
Discover how composable architectures offer unparalleled speed, agility, and flexibility to empower organizations in navigating the ever-changing landscape of technological advancements and evolving consumer needs, and how Drupal can be a key part of a composable solution!
Categories:

Matt Glaman: Registering services to the Drupal service container without a module

Planet Drupal - Tue, 2023/06/13 - 4:07pm

Drupal's service container for dependency injection allows modules to register services and parameters to the service container or alter and modify the service container. Usually, this is done with a services.yml file provided by a module or a service provider for dynamic registration and alteration. But! Did you know you can integrate with Drupal's service container without a module?

Categories:

Drupal blog: State of Drupal presentation (June 2023)

Planet Drupal - Tue, 2023/06/13 - 12:49pm

This blog has been re-posted and edited with permission from Dries Buytaert's blog.

DrupalCon North America 2023 DriesNote presentation

Last week, approximately 1,500 Drupal enthusiasts came together in Pittsburgh for DrupalCon North America. In good tradition, I delivered my State of Drupal keynote. You can watch the video of my keynote or download my slides (240.6 MB).

The theme of this keynote was innovation. As we like to say in Drupal, the drop is always moving. If we don't keep progressing and innovating, we risk falling behind. That is simply not an option because our mission and purpose are just too important.

License to innovate

In my keynote, I talked about the Drupal Association's goal to support and prioritize product innovation. To shed light on this important topic, I moderated a Q&A session with Tim Doyle, the new CEO of the Drupal Association, and Baddý Breidert, the current chair of the Drupal Association Board of Directors.

We discussed the strategic goals of the Drupal Association, the three-year plan we have been working on, and the actions we're taking to help accelerate product innovation. Given that it was a brief 15-minute Q&A, we only scratched the surface. Stay tuned for more details in the upcoming weeks!

Jumping S-curves by letting a 1,000 flowers bloom

I also discussed the importance of Drupal "jumping S-curves". The pattern of innovation and growth over time follows an S-curve, with periods of slow progress, rapid innovation, and stagnation, followed by a leap to the next curve.

Lessons from S-curve jumps include the importance of having a vision and purpose, grassroots innovation, a supportive environment, and allowing time for ideas to flourish. I applied this theory to Drupal and emphasized how we are well-positioned for innovation, and have been able to jump S-curves over the years because of this.

Drupal has a clear vision and purpose, receives contributions from many individuals, provides a supportive environment, and allows ideas to grow and flourish over time. Additionally, we have initiatives like Project Browser and Recipes that help showcase innovative ideas.

Pitch-burgh innovation contest

Finally, we determined the winners of the Pitch-burgh innovation contest, where individuals from all over the world pitched their own innovative Drupal ideas via video submissions. The response to our contest was overwhelmingly positive, with many attendees expressing their desire to see it return and expand in future DrupalCons.

We received 35 proposals for DrupalCon Pitchburgh, which exceeded expectations. Moreover, thanks to the incredible support from our sponsors, we raised $75,000 in sponsorship funds. I would like to extend my heartfelt appreciation to each and every one of our sponsors: Drupal AssociationAcquia1xINTERNETSkilldPalantir.netDigital PolygonZoochaImageX.

I also want to express my gratitude to Lee Walker from Code Journeymen and Jonathan Daggerhart from Daggerhart Lab for their real-time support. When the audience vote fell short by $3,000 to fully fund the fifth winner, they stepped in, and shouted from the audience that they will provide the extra funds.

All 35 submissions can be viewed on Drupal.org. I would like to extend a special congratulations to the five exceptional projects that were granted funding as a result of the live audience vote. I'm excited to see your projects come to life over the months to come.

  1. ​​Decoupled Layout Builders (PreviousNext, $20,000)
  2. Using Drupal Gutenberg towards the most easy to use enterprise CMS (Frontkom, $22,000)
  3. JSON data and schemas FTW (Brad Jones, $20,000)
  4. Drupal API Client (Brian Perry, $10,000)
  5. Contributing and Mentoring the mentor (AmyJune Hineline, $6,000)

I'm really excited about these particular projects being funded because many Drupal site builders have requested enhancements for Drupal's page/layout builder (proposal 1 and 2), and more and more Drupal developers are embracing an API-first approach to website development (proposal 3 and 4). The funded projects offer an interesting blend of both. While we can't guarantee that these projects will be added to Drupal core itself, they surely deserve to be taken into consideration. We'll decide that in time through our regular process.

Bonus announcement and unexpected funding

Since Automattic is the main developer behind Gutenberg, I shared the Gutenberg proposal with Matt Mullenweg, co-founder of WordPress and CEO of Automattic. Matt was really excited about the idea of more Drupal sites using Gutenberg, and he kindly offered to provide the full €20,000 in funding through Automattic. Furthermore, he will be sending some Gutenberg experts to join the sprint without any cost to the Drupal community. Thank you, Matt!

Matt shared this great news after my keynote, which means we received some unexpected last-minute funding. It brings the total funding for Pitch-burgh close to $100,000!

As a result, we are able to fully fund the next project chosen by the audience at DrupalCon: Policy based access in core (Factorial, €13,000). The remaining funds will be carried over to the next innovation contest or used for other strategic initiatives of the Drupal Association.

Conclusion

I always love the energy that fills the air when so many from the Drupal community gather together in one place. Every time I attend DrupalCon, I go home full with ideas, enthusiasm, and energy. The creativity and passion of the Drupal community constantly inspires me. I firmly believe in our ability to drive innovation at an even faster pace in the years to come.

Categories:

Specbee: Component-based theming with Drupal’s Single Directory Component

Planet Drupal - Tue, 2023/06/13 - 12:25pm
Component-based theming with Drupal’s Single Directory Component Sagar Chauhan 13 Jun, 2023 Subscribe to our Newsletter Now Subscribe Leave this field blank

Drupal theming has been an area long untouched by a radical update. Sure there are tons of contributed modules available for making the workflow a little easier but the out-of-the-box approach for creating a custom theme has remained more or less the same. There has been chatter about having some sort of component-based theming mechanism inside Drupal core itself for a long time. Enter Single Directory Components (SDC), which has been in discussion for quite some time through a contributed module handled by prominent Drupal contributors - Mateu Aguiló Bosch, Mike Herchel, Lauri Eskola, and Dave Reid. But now it has entered the core of Drupal (currently as an experimental feature) in version 10.1. 

This component-based approach of theming a Drupal application isn’t new but it finally has made it to the core. It gives a whole new frontier for front-end devs to organize their code in a way that is more maintainable with a minimal learning curve. Within SDC, all files necessary to render the component (Twig, CSS, JS, etc.) are grouped together in a single directory. SDC has the potential to revolutionize front-end development in Drupal by empowering developers to leverage the latest front-end techniques, solidifying Drupal’s position as a robust and forward-looking CMS.

Drupal's current theming approach

The simplest way to work on a Drupal theme has been to add the markup to the html.twig files inside the template folders. For styling and behavior, we create CSS and JS files according to an entity's need and place them inside the CSS and JS folders respectively. This includes theming header menu, footer menu, blocks, regions, individual content types and their different view modes, different views, etc.  These files are then declared in the libraries.yml file where dependencies (if any) can also be mentioned. This way they can be loaded on demand or be made globally available. Apart from this, any preprocessing logic goes into the .theme files, we have the breakpoints.yml to help with responsive designs and of course, .info.yml file without which all the effort is a waste.

While this seems to be a lot of work to be done before we actually do some useful frontend work, there have been some boilerplate code generators like drush theme generate, which intend to generate the folder structure of a theme in an interactive way and create a standard drupal folder structure.

Even though the above structure works well enough for starting a project and can pose no issue for a small project, it can become a bottleneck for enterprise websites where a more sophisticated design system needs to be integrated.

  1. Things start getting cluttered very rapidly. We see a lot of CSS and JS files just filled up to the brim in their folders. 
  2. Developers struggle to find the code they can reuse or extend.
  3. Issues like code duplication, code spread across the files, specificity hell, and CSS conflicts crop up.
  4. This often leads to more efforts spent on later development where it is expected that initial development would have helped later.
Our approach to theming in Specbee

At Specbee, we have standardized how we create our themes using an NPM tool called Drupal Theme Init developed by us from scratch which is open-sourced. Being a Yeoman generator, it can easily be installed with NPM/Yarn which then interactively helps in the generation of a custom theme. The idea of the Drupal Theme init is to have a consistent approach to how theme files are scaffolded following Drupal practices and to help out developers to start working on the theme without the hassle of setting the files every time they start a new project.  The basic idea of the structure is to compartmentalize SASS into components using the BEM convention. Each CSS files associated with an entity like block, view, content type, etc have its own CSS generated and is attached to that entity either through the twig template or preprocessing. The same goes for the JS files. The extensive use of libraries.yml helps us to limit the amount of CSS and JS we render on the page.

The advantage of setting up the theme this way is we have a system in place for component-based theming without depending on any external libraries or plugins. It helps us to segregate the CSS/JS libraries based on the components to be loaded on the page, which helps with the performance. However, there are still limitations to this approach especially when the project grows in size. The segregation of components into atomic levels becomes a bit of a burden as it requires us to maintain the libraries.yml file with required dependencies. Also, there is no easy way we can do a proper integration of a design system with the current structure easily as we will have to define each component path and its dependency by ourselves in the design system too, to load the components in it.

What is Component-based theming

While the vanilla approach seems fairly basic, there have been huge amounts of advancements done in recent times through contributed modules to have better approaches. One of the popular approaches is imagining the UI as a collection of reusable and consistent units called components. In most cases, this follows Atomic Design where each component is segregated into smaller building blocks. Modules like UI Patterns, Components! or component libraries like PatternLab, Fractal, and Storybook have brought innovative ways which have made the development of themes more streamlined and robust. Component-based theming has a certain edge over traditional theming:

  1. One of the biggest bottlenecks is the backend dependency, where frontend work can't start without the Backend work. This creates a lag. Using a component-based approach, the front-end can work independently and without much deep knowledge of Drupal things.
  2. Components can be created just from the available design with the required placeholders. The values for these placeholders can be filled later when the backend work is completed
  3. It creates a workflow where we just don’t change the markup in the templates folder and style it as per the requirement. Rather we have smaller structures styled separately and then create a collection of these smaller units into bigger components that can be used by the Drupal templates. 
  4. This helps in maintaining the code related to each component in isolation and creates lesser chances of side effects. 
  5. It confirms UX consistency across the application.
  6. Helps in the reduction of efforts spent on setting up the feature as changes made in one place reflect across the areas where it is used.
How to do component-based theming in Drupal

One of the prominent ways of following component-based development is using PatternLab which was introduced quite a while back. It initially came in with a Drupal edition which is archived now and replaced by a node-based package. The setting up of the PatternLab requires a Components module to be installed which will help in getting the markup from Twig files outside the templates folder for Drupal. This is followed by installing the patternlab package via npm which gives options to generate twig or mustache-based templates (obviously twig for us). Once this is done we have a ready reckoner style guide, some boilerplate code that helps in the creation of the style guide, and a patterns folder where in we create the components according to the requirements. These components are then included in the html.twig files present inside the templates folder.

While all these steps are fine to perform, there are instances where this is a bit difficult to set up and has a bit of a learning curve to it. The biggest drawback that comes with Patternlab is that all the CSS is aggregated into a single file which then gets dumped into all the pages (which is sometimes also the case with the JS included with it). While this doesn’t matter initially as the basic idea is the reusability of the component, once the project grows this starts affecting the page performance.

How to do component-based theming with SDC

With the initial version of SDC going into the core as an experimental module, there has been a lot of excitement around it. SDC has been touted as the biggest change to Drupal theming since the introduction of Twig. SDC again is not a complete solution for the Frontend Development team but a component-driven approach to theming with an out-of-the-box basic structure. This can still be extended with a number of modules for a certain kind of workflow. The basic idea is everything related to a component stays inside a single directory. This includes the Component Twig file, JS, CSS, other assets, and a single schema YAML file declaring the properties of the component.

Some immediate benefits of using SDC:

  1. All the code related to a component is in a single directory (as the name suggests!). 
  2. The libraries for the component are auto-generated which leads to lesser trauma of not declaring the it in libraries.yml file. Although we still might need to add the dependencies to the component.yml file, this is being done in a single place rather than jumping to the libraries.yml file.
  3. There is a far smaller learning curve to implement SDC. If you know the basic of Drupal theming, all you need to do is enable this module and start writing the components.
  4. The power of twig (include/extend/embed) is still available which helps in the reusability of code.
  5. As the components are YML plugins, which can be easily discovered by Drupal and can be easily swapped by a component having the same API structure.
  6. The components can also be rendered through render arrays! 
  7. Provides a good mechanism to integrate external libraries to facilitate a Design system.
  8. As the components are organized, the result of that is a consistent look and feel of the end product.
  9. The code becomes more testable as we have units (read components) that can be tested independently
  10. Because we define the schema within a component’s YAML definition, modules can automatically create forms to populate data.

Though it is currently included as an experimental feature in the core, setting up SDC is quite easy. Assuming there is a Drupal 10.1.x installation:

1. Enable the experimental SDC core module.

 

2. Create or use a custom theme to add SDC. For our purpose we created a custom theme called Ice Cream with Olivero as base theme.

3. For our purpose, let's use the basic page which comes out of the box. I have repurposed it by adding a custom Title field and making some adjustments to the display which then looks like this:

 

4. The template twig file consists of basic code:

 

5. Create a folder called components inside your custom theme. This is similar to how we have a templates folder for Drupal templates.

 

6. For now, the basic idea is to style the title and description, which will be reusable in nature. Let's create a component called simple-article. There will be simple-article.component.yml file and simple-article.twig which we will require. Apart from that, we will also add simple-article.css for styling.

 

7. Let's create the simple-article.twig file. We will have a basic markup for that.

 

8. Add the simple-article.component.yml file with the schema mentioned in https://www.drupal.org/node/3352951. The idea is to define what will be the inputs to the twig file. It will look something like this for us:

 

9. Let’s add some basic styling to the component in simple-article.css.

 

10. Clear the cache.

11. Abracadabra! The component is now ready to use. But it still needs to be used. Without that, the component sits idle in the components folder.

12. Include this component in the required template file (this is the html.twig file under the templates folder in the custom theme) with format [theme_name:component-name]. Notice the include statement where we are adding the twig variables to be used in the component.

 

13. The component now gets rendered with our new markup and better styling.

14. Notice the markup. If twig debug is enabled, we get some special icons too with our SDC component rendered.

And that’s it!

References

Final Thoughts

With the way SDC has been built, there is going to be high-intensity development around it. One of the popular tracks is that modules will automatically detect components and insert their respective forms into Layout Builder, CKEditor, Paragraphs, Blocks, Fields, etc! In addition, SDC right now plays nice with Storybook through a contributed module called CL Server (which has been maintained by SDC project maintainers). Already there are other modules like CL Devel, CL Generator, and even UI Patterns that are getting built around SDC.

This will also help us to upgrade our own theme generator (Drupal Theme Init)  which we discussed earlier to give an option of using SDC along with a Design System in place, preferably Storybook. This will help anyone to kickstart SDC implementation instantly paving the way for better theme development.

If you would like to read more such interesting content on Drupal, subscribe to our weekly newsletter today!

Author: Sagar Chauhan

Meet Sagar Chauhan, Lead Engineer, Acquia-certified Frontend Developer, soccer player, and a huge Arsenal fan. Sagar loves long train journeys and checking out latest gadget reviews. If you want to invite him for a meal (and you don’t know how to cook), Maggi would be perfect! :)

Email Address Subscribe Leave this field blank Drupal Drupal Module Drupal Development Drupal Planet

Leave us a Comment

  Recent Blogs Image Component-based theming with Drupal’s Single Directory Component Image Finding Growth and Fulfillment - Ankitha Shetty’s Career Story Image The Admin Toolbar - A Must-Have Drupal Module Want to extract the maximum out of Drupal? TALK TO US Featured Case Studies

Upgrading the web presence of IEEE Information Theory Society, the most trusted voice for advanced technology

Explore

A Drupal powered multi-site, multi-lingual platform to enable a unified user experience at SEMI

Explore

Great Southern Homes, one of the fastest growing home builders in the US, sees greater results with Drupal

Explore
View all Case Studies
Categories:

LN Webworks: Discovering Drupal 10 Compatibility with Emerging Technologies

Planet Drupal - Tue, 2023/06/13 - 9:46am

Right from its inception, Drupal has been captivating the hearts of users worldwide. The fondness for this top-notch content management system continues to increase more and more with every upgrade that is equipped with cutting-edge features. Currently, Drupal 10 is creating a sensation globally with its incredible speed, phenomenal security, modern semantic layout, seamless support for embedded videos, and flawless compatibility with emerging technologies.

As marching along with technological advancements is indispensable for businesses to accomplish enduring success in the modern world, Drupal 10 can be a boon for your company. In this blog, we’ll explore Drupal 10’s compatibility with cutting-edge technologies such as Artificial Intelligence and Machine Learning, Headless CMS, and Cloud services.

Categories: