Problem/Motivation

The module defines its JavaScript library with both minified: false and preprocess: false:

js/jquery.deprecated.functions.js: { minified: false, preprocess: false, weight: -20 }

Because preprocessing is disabled, Drupal does not include the file in JavaScript aggregation or minification, even when JavaScript aggregation is enabled on the site.

This causes the unminified source file to be served separately on production sites. It may also trigger performance and SEO audit warnings about unminified JavaScript.

It is unclear whether preprocess: false is required for compatibility or whether it was just copied from Drupal core's jQuery library definition, where the referenced jQuery file is already minified.

Steps to reproduce

  1. Install and enable the jQuery Deprecated Functions module.
  2. Enable JavaScript aggregation at /admin/config/development/performance.
  3. Clear Drupal caches.
  4. Visit a page where the module's library is loaded.
  5. Inspect the page's JavaScript resources in the browser developer tools.

The file is loaded directly from the module directory:

/modules/contrib/jquery_deprecated_functions/js/jquery.deprecated.functions.js

It is not included in a generated Drupal JavaScript aggregate and remains unminified.

Proposed resolution

Remove preprocess: false from the library definition so Drupal can aggregate and minify the file using its standard asset processing system:

js/jquery.deprecated.functions.js: { minified: false, weight: -20 }

Alternatively, set preprocess: true explicitly.

If the file must remain excluded from preprocessing for compatibility reasons, document that requirement and consider providing a pre-minified version of the file instead.

Remaining tasks

  • Confirm whether preprocess: false is required for any compatibility or execution-order reason.
  • Test with JavaScript aggregation enabled.
  • Verify that the deprecated jQuery functions remain available before dependent scripts execute.
  • Test supported Drupal core versions.
  • Add or update automated test coverage if applicable.
  • Review and commit the proposed change.

User interface changes

None.

API changes

None.

Data model changes

None.

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

mekal created an issue. See original summary.

mekal’s picture

here is a patch that is working for me.

danrod’s picture

Assigned: Unassigned » danrod
Status: Active » Needs review
danrod’s picture

StatusFileSize
new214.93 KB

Thanks for submitting this patch, I can see the issue in my D11 instance:

Javascript file not being aggregated

After applying the patch, the file was aggregated:

Javascript file aggregated after the patch

I'll test that deprecated jQuery functions remain available before dependent scripts execute.

danrod’s picture

Issue tags: +Novice
danrod’s picture

Assigned: danrod » Unassigned
danrod’s picture

StatusFileSize
new235.19 KB
danrod’s picture

I tested this on a project that has Views Slideshow installed and works as expected after applying thte MR !24. I'll merge this to the 1.0.x branch.

  • danrod committed 98652d6c on 1.0.x
    Issue #3615119: Fix for the JDF Javascript file to be aggregated
    
danrod’s picture

Thanks for the fix.

danrod’s picture

Status: Needs review » 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.