Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 6.8.0
    • Fix Version/s: 6.10.0, 7.0.0-M1
    • Component/s: wicket
    • Labels:
      None

      Description

      Given an application with a resource reference to a minified script, i.e. html5.js and html5.min.js.

      When the ResourceRequestHandler responds
      it will set compress to false, if the resource reference was PackageResourceReference
      but it will not change compression if the resource reference was JavaScriptResourceReference.

      PackageResourceReference handles minified resources more or less correctly (if they are minified, they should not be further compressed), but this behavior is overwritten in its subclasses.

        Activity

        Hide
        Martin Grigorov added a comment -

        Patch applied.
        Thanks, Cedric!

        Show
        Martin Grigorov added a comment - Patch applied. Thanks, Cedric!
        Hide
        Cedric Gatay added a comment -

        Hi,
        I made a small patch allowing CssResourceReference and JavaScriptResourceReference to use the built-in mechanism in PackageResourceReference, please ignore the previous message as I melted things in my head.

        You can find the correct patch at the following url : https://github.com/CedricGatay/wicket/compare/WICKET-5250?expand=1 it includes basic unit-testing around the bug as it has been described.

        Regards,

        Show
        Cedric Gatay added a comment - Hi, I made a small patch allowing CssResourceReference and JavaScriptResourceReference to use the built-in mechanism in PackageResourceReference, please ignore the previous message as I melted things in my head. You can find the correct patch at the following url : https://github.com/CedricGatay/wicket/compare/WICKET-5250?expand=1 it includes basic unit-testing around the bug as it has been described. Regards,
        Hide
        Cedric Gatay added a comment -

        Ok I finally understood what you meant. The problem lies in the fact that the minified handling is done within PackageResourceReference and not in PackageResource.

        I am willing to take this issue into account and correct it for the Wicket.next, however, only if a core commiter tell me it is ok to do so (it represents quite a lot of work to be honest).

        Can someone confirm this issue needs to be handled (or we might complete the JavaDoc of JavaScriptPackageResource to tell that automatic lookup of minified resource won't be done) ?

        Show
        Cedric Gatay added a comment - Ok I finally understood what you meant. The problem lies in the fact that the minified handling is done within PackageResourceReference and not in PackageResource. I am willing to take this issue into account and correct it for the Wicket.next, however, only if a core commiter tell me it is ok to do so (it represents quite a lot of work to be honest). Can someone confirm this issue needs to be handled (or we might complete the JavaDoc of JavaScriptPackageResource to tell that automatic lookup of minified resource won't be done) ?
        Hide
        Johannes Odland added a comment -

        In PackageResourceReference#getResource() there is a check that sets compress to false on the resource if a minified name exists (Line 132-136).

        This method is overwritten by JavaScriptResourceReference (and CssResourceReference). Neither of them checks if the resource is minified.

        Show
        Johannes Odland added a comment - In PackageResourceReference#getResource() there is a check that sets compress to false on the resource if a minified name exists (Line 132-136). This method is overwritten by JavaScriptResourceReference (and CssResourceReference). Neither of them checks if the resource is minified.
        Hide
        Cedric Gatay added a comment - - edited

        Hi,
        can you provide a quickstart for this one please (by digging in the code I see no reason for what you describe) ?

        Thanks

        Show
        Cedric Gatay added a comment - - edited Hi, can you provide a quickstart for this one please (by digging in the code I see no reason for what you describe) ? Thanks

          People

          • Assignee:
            Martin Grigorov
            Reporter:
            Johannes Odland
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development