Just out of curiosity, any thoughts on removing the module's dependencies on jQuery? I know it's just an admin-side dependency, but it'd be nice to not need it!

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

jennypanighetti created an issue. See original summary.

sluc23’s picture

+1

smustgrave made their first commit to this issue’s fork.

smustgrave’s picture

Title: Removing jQuery dependency? » Completely redo the module filter module

Sorry unfortunately got like 80+ modules and this one just doesn't get the attention. So I'm disclosing I ran it through an LMM reviewing the changes along the way. This would be a new 6.0.x branch but just testing for now. Notable changes

1. Removed all uses with jQuery and replaced with vanilla JavaScript
2. Dropped .module legacy hooks and turned fully to OOP and services
3. Limting to 11.4/12
4. Using a template for the tabs to avoid layout shifts.

smustgrave’s picture

Version: 5.0.4 » 6.0.x-dev
Status: Active » Needs review

Think ready for eyes.

csakiistvan’s picture

Assigned: Unassigned » csakiistvan
csakiistvan’s picture

@smustgrave Reviewed the rewrite as requested in #6, no issues found.

✅ Tested and works — checked out MR !62 and rebuilt caches, then uninstalled jquery_ui, jquery_ui_menu and jquery_ui_autocomplete: Module Filter stayed enabled and the filter works on /admin/modules, /admin/modules/uninstall, /admin/people/permissions and /admin/reports/updates, with no console errors and no tab layout shift. So the jQuery removal holds and the OOP/template rewrite keeps functional parity.

csakiistvan’s picture

Assigned: csakiistvan » Unassigned
Status: Needs review » Reviewed & tested by the community
smustgrave’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.

nick hope’s picture

Thanks for removing the jQuery dependency. I encountered one upgrade-path issue when moving from Module Filter 5.0.5 to 6.0.0.

Composer removed `jquery_ui_autocomplete` and its `jquery_ui_menu` dependency, but both modules were still recorded as installed in `core.extension`. This caused `drush updatedb` to stop because their code was missing, giving this message:

[error] (Currently using Missing or invalid modules The following modules are marked as installed in the core.extension
configuration, but they are missing:
* jquery_ui_autocomplete
* jquery_ui_menu

I resolved it by temporarily restoring the packages, uninstalling the modules through Drupal in dependency order, and then removing the packages again:

composer require drupal/jquery_ui_autocomplete:^2.1
drush pm:uninstall jquery_ui_autocomplete -y
drush pm:uninstall jquery_ui_menu -y

If no other enabled module requires `jquery_ui`, also run:

drush pm:uninstall jquery_ui -y

Then finish with:

composer remove drupal/jquery_ui_autocomplete drupal/jquery_ui
drush updatedb -y
drush cache:rebuild
drush config:export -y
jwintx’s picture

I had the same upgrade-path issue as Nick in #12

mekal’s picture

Also same upgrade-path issue as Nick in #12

smustgrave’s picture

Most I can do is put a disclaimer. This module doesn’t get a lot of attention but I would of needed to have done a

6.0.x with the dependencies still there but not used
7.0.x to drop the dependencies after some time

arx-e’s picture

This removal of jquery_ui modules is a problem. I any update I did up to now I had to go and re-require the modules.