Home » Eclipse Projects » Remote Application Platform (RAP) » rap-client.js & webapp startup speed
rap-client.js & webapp startup speed [message #1488807] |
Wed, 26 November 2014 23:17 |
Sergei Vasilyev Messages: 5 Registered: January 2013 |
Junior Member |
|
|
Hi,
I found that rap-client.js, which is seemingly built at runtime from a number of shorter js files sitting in org.eclipse.rap.rwt-3.0.0-M3.jar, has the size of 2.04 MB, containing non-minified javascript with whitespace, comments, what not.
Though late releases of RWT have significantly decreased the webapp startup delay in the browser (the gray gradient before the main form appears), seems had rap-client.js been minified, the startup time would have shortened even further.
If I remember correctly, at some point around M2.0 the original js minification was dropped to save resources, but would it be possible to drop the process of runtime assembly of rap-client.js from pieces, and have that guy jar'ed as already assembled and minified?
Thanks in advance,
Sergei
|
|
| | |
Re: rap-client.js & webapp startup speed [message #1489658 is a reply to message #1489564] |
Thu, 27 November 2014 15:14 |
Sergei Vasilyev Messages: 5 Registered: January 2013 |
Junior Member |
|
|
Many thanks, Ivan and Ralf,
you are right, that was the development mode. Though as I run it in the production mode (the tick-box "RAP settings/Start in development mode" in the RWT Application launch config UI unchecked), I can see rap-client.js only partly minified.
As Ralf mentioned, the minified version (client.js) is in the jar, but then a non-minified tail is appended to that when rap-client.js is created (in my Eclipse workspace its location is /.metadata/.plugins/org.eclipse.rap.tools.launch.rwt/launch_config_name/web-app/rwt-resources/).
Probably not a big deal as that tail adds up only 10% to the file, but still a 1MB javascript looks big having mobile browsers/poor connections in mind. I suspect only part of it is needed in most webapps using only a small subset of the widgets, but even the Hello world has to pay the startup time price downloading a 1MB file at every screen refresh (EDIT: when a new UI session is created).
People using Bootstrap and other HTML5 frameworks often select (manually) which components' javascript to include in the pursuit of decreasing the js load time.
The server part of RWT could auto-assemble the client js from fragments only for the widgets being used by a given webapp, and then minify that file. In that case the javascript would be the minimal possible size, and the initial delay would only be experienced by the very first session, and all consecutive sessions would receive the size-optimized client.js.
Thanks for the fantastic framework!
Cheers,
Sergei
[Updated on: Thu, 27 November 2014 19:21] Report message to a moderator
|
|
| | |
Goto Forum:
Current Time: Fri Mar 29 04:55:20 GMT 2024
Powered by FUDForum. Page generated in 0.05095 seconds
|