Details
-
Type: Improvement
-
Status: Closed
-
Priority: Major
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: 4.0
-
Component/s: ACE-Components
-
Labels:None
-
Environment:ICEfaces 4 ACE Components
-
Assignee Priority:P1
Description
With the resource coalescing and head-update capabilities provided in ICEfaces 4, we need to review the ace-components.js file contents to see if we can lower it's footprint by selectively removing JS for certain components, especially those with larger JS footprints.
Issue Links
- blocks
-
ICE-10291 remove dependency of mobi components on ace-component.js, instead using only the support for ace-ajax.js
- Closed
Activity
- All
- Comments
- History
- Activity
- Remote Attachments
- Subversion
Based on my analysis of JS dependencies and JS files sizes, frequency of component usage, etc. I have the following recommended changes:
- Refactor the ace-jquery.js merged file into the following separate files to improve the ability of components to load just those resources required on the page (esp. important for mobile devices):
- ace-core.js - includes util/core.js and util.util.js only. util.js needs to be modified to not depend on jQuery itself.
- jquery/jquery.js (unmerged natural jQuery file).
- ace-jquery-ui.js - merged jquery/ui/jquery-ui.js and jquery/ui/jquery.ui.touch-punch.js
- This makes ace-core.js the baseline mandatory .js library that virtually any ace comp. that requires JS will depend upon. Also allows ace:ajax to only depend on ace-core.js.
- Remove completely the ace-components.js merged file, instead have each component declare all of their actual dependencies independently in their meta classes. In addition, remove the use of the "<requires>" entries in the ACE resource-dependency.xml file (use meta class dependency declarations instead).
- Establish any necessary "<depends>" entries in the ACE resource-dependency.xml file to ensure that when resources are required by components that they are loaded in the correct order.
Show
Ken Fyten
added a comment - - edited Based on my analysis of JS dependencies and JS files sizes, frequency of component usage, etc. I have the following recommended changes:
Refactor the ace-jquery.js merged file into the following separate files to improve the ability of components to load just those resources required on the page (esp. important for mobile devices):
ace-core.js - includes util/core.js and util.util.js only. util.js needs to be modified to not depend on jQuery itself.
jquery/jquery.js (unmerged natural jQuery file).
ace-jquery-ui.js - merged jquery/ui/jquery-ui.js and jquery/ui/jquery.ui.touch-punch.js
This makes ace-core.js the baseline mandatory .js library that virtually any ace comp. that requires JS will depend upon. Also allows ace:ajax to only depend on ace-core.js.
Remove completely the ace-components.js merged file, instead have each component declare all of their actual dependencies independently in their meta classes. In addition, remove the use of the "<requires>" entries in the ACE resource-dependency.xml file (use meta class dependency declarations instead).
Establish any necessary "<depends>" entries in the ACE resource-dependency.xml file to ensure that when resources are required by components that they are loaded in the correct order.
Ken. MInification was available many years before 42722 (no-compress flag). We use this solution (minification and compression) in production systems with success.
Solution added after #42640 is good idea but is unnecessary.
Also coalescing isn't compatibile with this patch. It disables caching and creates new javax.faces.resource/coalesced.js.iface file on each request - I definately see different sizes of this file on each request.
Summary the I can suggest to restore previous solution with selection based on development mode (orignal or minified js send to client) also coalesce should generate stable cacheable (on client and server) response