You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by "Alejandro Scandroli (JIRA)" <ji...@apache.org> on 2013/03/19 19:31:16 UTC

[jira] [Updated] (TAP5-2097) Use a JavaScriptStack to import the tapestry-beanvalidator.js file.

     [ https://issues.apache.org/jira/browse/TAP5-2097?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alejandro Scandroli updated TAP5-2097:
--------------------------------------

    Attachment: TAP5-2097.patch


Simple patch attached.
                
> Use a JavaScriptStack to import the tapestry-beanvalidator.js file.
> -------------------------------------------------------------------
>
>                 Key: TAP5-2097
>                 URL: https://issues.apache.org/jira/browse/TAP5-2097
>             Project: Tapestry 5
>          Issue Type: Improvement
>          Components: tapestry-beanvalidator
>    Affects Versions: 5.3.6
>            Reporter: Alejandro Scandroli
>         Attachments: TAP5-2097.patch
>
>
> 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
>  

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira