Tapestry 5
  1. Tapestry 5
  2. TAP5-1486

When Tapestry adds CSS and JS files to the page, it should ensure that CSS files are above any JavaScript files

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 5.3, 5.2.5
    • Fix Version/s: 5.3
    • Component/s: tapestry-core
    • Labels:
      None

      Description

      From the "Audit" tab of Chrome Developer Tools:

      The following external CSS files were included after an external JavaScript file in the document head. To ensure CSS files are downloaded in parallel, always include external CSS before external JavaScript

      I think the best order would be:

      Add all CSS files first; add them before any <script> tag or, failing that, at the end of the <head>.

      Add all JavaScript files second; add them after any <link> tag or, failing that, at the end of the <head>.

      1. patch DocumentLinkerImpl.txt
        1 kB
        François Facon
      2. patch Data for DocumentLinkerImplTest.txt
        1 kB
        François Facon

        Activity

        Hide
        François Facon added a comment -

        As CSS are first include at the top, with this tiny change we add js file just after CSS inclusion.
        But perhaps you have in mind more code in order to provide reorder all the elements.

        Show
        François Facon added a comment - As CSS are first include at the top, with this tiny change we add js file just after CSS inclusion. But perhaps you have in mind more code in order to provide reorder all the elements.
        Hide
        Hudson added a comment -

        Integrated in tapestry-trunk-freestyle #378 (See https://builds.apache.org/job/tapestry-trunk-freestyle/378/)
        TAP5-1486 : Add all CSS files first

        ffacon : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1138594
        Files :

        • /tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry5/internal/services/empty_document_with_scripts_at_top.txt
        • /tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/DocumentLinkerImpl.java
        Show
        Hudson added a comment - Integrated in tapestry-trunk-freestyle #378 (See https://builds.apache.org/job/tapestry-trunk-freestyle/378/ ) TAP5-1486 : Add all CSS files first ffacon : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1138594 Files : /tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry5/internal/services/empty_document_with_scripts_at_top.txt /tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/DocumentLinkerImpl.java
        Hide
        hien tran added a comment -
        Show
        hien tran added a comment - JS files can still be added before css. Please have a look at: http://tapestry.1045711.n5.nabble.com/scripts-in-head-affect-placement-of-imported-scripts-in-tapestry-5-3-td5446328.html

          People

          • Assignee:
            François Facon
            Reporter:
            Howard M. Lewis Ship
          • Votes:
            2 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development