This module is a Twig extension that merges multiple Tailwind CSS classes and automatically resolves conflicts, ensuring an optimized and clean class list. It depends on the tailwind-merge-php library.

Project link

https://www.drupal.org/project/tailwind_merge_classes

Comments

sergey_gabrielyan created an issue. See original summary.

avpaderno’s picture

Priority: Critical » Normal

Thank you for applying!

Please read Review process for security advisory coverage: What to expect for more details and Security advisory coverage application checklist to understand what reviewers look for. Tips for ensuring a smooth review gives some hints for a smoother review.

The important notes are the following.

  • If you have not done it yet, you should enable GitLab CI for the project and fix the PHP_CodeSniffer errors/warnings it reports.
  • For the time this application is open, only your commits are allowed.
  • The purpose of this application is giving you a new drupal.org role that allows you to opt projects into security advisory coverage, either projects you already created, or projects you will create. The project status will not be changed by this application; once this application is closed, you will be able to change the project status from Not covered to Opt into security advisory coverage. This is possible only 14 days after the project is created.
    Keep in mind that once the project is opted into security advisory coverage, only Security Team members may change coverage.
  • Only the person who created the application will get the permission to opt projects into security advisory coverage. No other person will get the same permission from the same application; that applies also to co-maintainers/maintainers of the project used for the application.
  • We only accept an application per user. If you change your mind about the project to use for this application, or it is necessary to use a different project for the application, please update the issue summary with the link to the correct project and the issue title with the project name and the branch to review.

To the reviewers

Please read How to review security advisory coverage applications, Application workflow, What to cover in an application review, and Tools to use for reviews.

The important notes are the following.

  • It is preferable to wait for a project moderator before posting the first comment on newly created applications. Project moderators will do some preliminary checks that are necessary before any change on the project files is suggested.
  • Reviewers should show the output of a CLI tool only once per application.
  • It may be best to have the applicant fix things before further review.

For new reviewers, I would also suggest to first read In which way the issue queue for coverage applications is different from other project queues.

avpaderno’s picture

Status: Needs review » Needs work

Usually, after reviewing a project, we allow the developer to opt projects into security advisory coverage. This project is too small for us and it doesn't contain enough PHP code to really assess your skills as developer.

Have you created any other project on drupal.org (module, theme, distribution) we could instead review? The project needs to have most of the commits (preferable all the commits) done by you.

sergey_gabrielyan’s picture

Hello @avpaderno! This is my first module. I'm using the tailwind-merge-php package and have added the tw_merge Twig function; for that reason, code is small. I have also created a patch for this module: https://www.drupal.org/project/smart_trim/issues/3334442 (not my module), but I don't have my own modules or themes besides Tailwind Merge Classes.

avpaderno’s picture

Priority: Normal » Minor

I am changing priority as per Issue priorities.

avpaderno’s picture

This thread has been idle, in the needs work state with no activity for some months.

May you confirm you are still pursuing this application? If this is the case, and you made commits basing on what previously reported, or you can answer the questions previously asked, please change the status to Needs review.

sergey_gabrielyan’s picture

Hello @avpaderno, I’ve updated the tailwind_merge_classes module by adding a custom form, a service, and unit tests. All pipelines are passing successfully, and both phpcs and phpstan have been checked carefully. At this stage, can the project already have security advisory coverage?

sergey_gabrielyan’s picture

Status: Needs work » Needs review
vishal.kadam’s picture

Issue summary: View changes
sergey_gabrielyan’s picture

Priority: Minor » Normal
sergey_gabrielyan’s picture

Priority: Normal » Minor
sergey_gabrielyan’s picture

Priority: Minor » Normal
vishal.kadam’s picture

Status: Needs review » Needs work

1. FILE: README.md

The README file is missing the required sections - Requirements, Installation, and Configuration.

2. FILE: src/Form/TailwindPrefixForm.php

With Drupal 10 and Drupal 11, there is no longer need to use #default_value for each form element, when the parent class is ConfigFormBase: It is sufficient to use #config_target, as in the following code.

    $form['image_toolkit'] = [
      '#type' => 'radios',
      '#title' => $this->t('Select an image processing toolkit'),
      '#config_target' => 'system.image:toolkit',
      '#options' => [],
    ];

Using that code, it is no longer needed to save the configuration values in the form submission handler: The parent class will take care of that.
For this change, it is necessary to require at least Drupal 10.3, but that is not an issue, since Drupal 10.2.x is no longer supported.

3. FILE: src/Form/TailwindPrefixForm.php

  /**
   * Render cache backend.
   *
   * @var \Drupal\Core\Cache\CacheBackendInterface
   */
  protected CacheBackendInterface $cacheRender;

  /**
   * Dynamic page cache backend.
   *
   * @var \Drupal\Core\Cache\CacheBackendInterface
   */
  protected CacheBackendInterface $cacheDynamicPage;

  /**
   * Page cache backend.
   *
   * @var \Drupal\Core\Cache\CacheBackendInterface
   */
  protected CacheBackendInterface $cachePage;

  /**
   * Constructs a TailwindPrefixForm object.
   *
   * @param \Drupal\Core\Cache\CacheBackendInterface $cacheRender
   *   Render cache service.
   * @param \Drupal\Core\Cache\CacheBackendInterface $cacheDynamicPage
   *   Dynamic page cache service.
   * @param \Drupal\Core\Cache\CacheBackendInterface $cachePage
   *   Page cache service.
   */
  public function __construct(
    CacheBackendInterface $cacheRender,
    CacheBackendInterface $cacheDynamicPage,
    CacheBackendInterface $cachePage,
  ) {
    $this->cacheRender = $cacheRender;
    $this->cacheDynamicPage = $cacheDynamicPage;
    $this->cachePage = $cachePage;
  }

FILE: src/Twig/TailwindMergeClassesTwigExtension.php

  /**
   * Service instance used for merging Tailwind classes.
   *
   * @var \Drupal\tailwind_merge_classes\Service\TailwindMergeService
   */
  public $tailwindMergeService;

  /**
   * Constructs the Twig extension.
   *
   * @param \Drupal\tailwind_merge_classes\Service\TailwindMergeService $service
   *   Tailwind merge service injected via dependency injection.
   */
  public function __construct(TailwindMergeService $service) {
    $this->tailwindMergeService = $service;
  }

New modules, which are compatible with Drupal 10 and higher versions are expected to include type declarations in property definitions, and use constructor property promotion.

sergey_gabrielyan’s picture

Thank you for the review and the detailed explanation @vishal.kadam

I just want to confirm whether updating the form to use #config_target (and removing #default_value and manual config saving) is required for this module, or if it would be acceptable to keep the current approach to allow compatibility with Drupal versions below 10.3.

vishal.kadam’s picture

This is not required. However, it is better if the module does not depend on Drupal versions that are no longer supported. Keeping the current approach is acceptable to maintain compatibility with versions below 10.3.

sergey_gabrielyan’s picture

Status: Needs work » Needs review
sergey_gabrielyan’s picture

@vishal.kadam Feedback addressed: README updated, forms use #config_target, typed properties and constructor promotion added, requires Drupal 10.3+. The same changes have been applied to the 2.x branch as well. Please let me know if a separate issue is needed for that version or if you'll review 2.x too.

sergey_gabrielyan’s picture

Title: [1.0.x] Tailwind Merge Classes » [1.1.x] Tailwind Merge Classes
sergey_gabrielyan’s picture

@vishal.kadam Since the module now requires Drupal 10.3+, I created release 1.1.0 instead of 1.0.2 to indicate the new Drupal version requirement.

sergey_gabrielyan’s picture

Title: [1.1.x] Tailwind Merge Classes » [1.x] Tailwind Merge Classes
vishal.kadam’s picture

Title: [1.x] Tailwind Merge Classes » [1.1.x] Tailwind Merge Classes

Please let me know if a separate issue is needed for that version or if you'll review 2.x too.

Since a successful completion of the project application process results in the applicant being granted the necessary role to be able to opt projects into security advisory coverage, there is no need to take multiple applications through the process.

Reviewers do not review multiple branches. It would also be better not to create new branches, as reviewers may need to recheck all the files to understand what changes were made in the new branch.

vishal.kadam’s picture

Rest looks good to me.

Please wait for a Project Moderator to take a look and if everything goes fine, you will get the role.

sergey_gabrielyan’s picture

I know not much time has passed, but I just wanted to check if there are any updates.

avpaderno’s picture

Assigned: Unassigned » avpaderno
Status: Needs review » Reviewed & tested by the community

Thank you for your contribution and for your patience with the review process!

I am going to update your account so you can opt into security advisory coverage any project you create, including the projects you already created.

These are some recommended readings to help you with maintainership:

You can find more contributors chatting on Slack or IRC in #drupal-contribute. So, come hang out and stay involved!
Anyone is welcome to participate in the review process. Please consider reviewing other projects that are pending review. I encourage you to learn more about that process and join the group of reviewers.

I thank also all the reviewers for helping with these applications.

avpaderno’s picture

Status: Reviewed & tested by the community » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

sergey_gabrielyan’s picture

Thank you @vishal.kadam and @avpaderno for your reviews and guidance. Much appreciated!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.