Uploaded image for project: 'ZK'
  1. ZK
  2. ZK-1889

zul.lang.wpd is always loaded twice with some JS package merge configurations

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: 6.5.3
    • Fix Version/s: 6.5.4
    • Component/s: ZK Loader
    • Security Level: Jimmy
    • Labels:
      None

      Description

      When using configuration where multiple JS packages are merged to zk.wpd, zul.lang.wpd package gets loaded twice from different URLs (once from HTML and once from JS).

      Example configuration:

      <language-addon>
        <addon-name>demo</addon-name>
        <language-name>xul/html</language-name>
      
        <!-- core packages -->
        <javascript package="zhtml" merge="true" />
        <javascript package="zul.utl" merge="true" />
        <javascript package="zul.menu" merge="true" />
        <javascript package="zul.box" merge="true" />
        <javascript package="zul.wnd" merge="true" />
      
        <!-- dependent packages -->
        <javascript package="zul.mesh" merge="true" />  <!-- depends on zul.menu -->
        <javascript package="zul.sel" merge="true" />   <!-- depends on zul.mesh -->
        <javascript package="zul.grid" merge="true" />  <!-- depends on zul.mesh -->
      
      
        <!-- removing these packages fixes the issue -->
        <javascript package="zk.fmt" merge="true" />    <!-- depends on zul.lang -->
        <javascript package="zul.inp" merge="true" />   <!-- depends on zul.lang, zk.fmt -->
        <javascript package="zul.db" merge="true" />    <!-- depends on zk.fmt, zul.inp -->
      </language-addon>
      

      I think what happens is this:
      1. Page is loaded, first script tag points to zk.wpd
      2. zk.wpd is processed, submitting requests for required JS packages (including zul.lang.wpd, even though it would be loaded later anyway)
      3. Second script tag in HTML points to zul.lang.wpd, so it gets loaded again

      While zul.lang.wpd file is very small, it can not be cached, so it must be unneccesarily loaded from server the second time on every page hit.

        Attachments

          Activity

            People

            • Assignee:
              RaymondChao RaymondChao
              Reporter:
              gediminas gediminas
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: