Tapestry 5
  1. Tapestry 5
  2. TAP5-2097

Use a JavaScriptStack to import the tapestry-beanvalidator.js file.

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 5.3.6
    • Fix Version/s: 5.3.7
    • Component/s: tapestry-beanvalidator
    • Labels:
      None

      Description

      tapestry-beanvalidator is using MarkupRendererFilter to include the tapestry-beanvalidator.js in every page. Which means that if you have the tapestry-beanvalidator dependency in your project you end up importing many tapestry javascript files that you may not need. Even for an empty page, if you have tapestry-beanvalidator as a dependency it will include a dozen javascript files.

      A better approach would be to have a JavaScriptStack for tapestry-beanvalidator.js and then use a worker to import the stack ONLY when there is a form present. The tapestry-jquery project has a nice example of this, FormResourcesInclusionWorker

      https://github.com/got5/tapestry5-jquery/blob/master/src/main/java/org/got5/tapestry5/jquery/services/FormResourcesInclusionWorker.java

      1. TAP5-2097.patch
        13 kB
        Alejandro Scandroli

        Activity

        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Resolved Resolved
        25d 10h 23m 1 Kalle Korhonen 14/Apr/13 03:51
        Kalle Korhonen made changes -
        Resolution Fixed [ 1 ]
        Status Open [ 1 ] Resolved [ 5 ]
        Fix Version/s 5.3.7 [ 12323355 ]
        Hide
        Kalle Korhonen added a comment -

        Applied, thanks Alejandro. Only applicable to 5.3.x, 5.4 beanvalidator uses the new js module system. No tests but existing suite passes so I'm letting it through.

        Show
        Kalle Korhonen added a comment - Applied, thanks Alejandro. Only applicable to 5.3.x, 5.4 beanvalidator uses the new js module system. No tests but existing suite passes so I'm letting it through.
        Kalle Korhonen made changes -
        Assignee Kalle Korhonen [ kaosko ]
        Alejandro Scandroli made changes -
        Field Original Value New Value
        Attachment TAP5-2097.patch [ 12574376 ]
        Hide
        Alejandro Scandroli added a comment -


        Simple patch attached.

        Show
        Alejandro Scandroli added a comment - Simple patch attached.
        Alejandro Scandroli created issue -

          People

          • Assignee:
            Kalle Korhonen
            Reporter:
            Alejandro Scandroli
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development