Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
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 Go to next message
Sergei Vasilyev is currently offline Sergei VasilyevFriend
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 #1489564 is a reply to message #1488807] Thu, 27 November 2014 13:31 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2426
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
Hi Sergei,
are you running your application in "development mode"? rap-client.js
will not be minified in development mode, only in production.
Best,
Ivan

--
Ivan Furnadjiev

Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Re: rap-client.js & webapp startup speed [message #1489569 is a reply to message #1488807] Thu, 27 November 2014 13:38 Go to previous messageGo to next message
Ralf Sternberg is currently offline Ralf SternbergFriend
Messages: 1313
Registered: July 2009
Senior Member

Hi Sergei,

As Ivan said, in production mode, RAP uses a concatenated and minified
client.js. This file is not created at runtime, it's included in the jar
already.

In development mode, you get the plain JS to enable debugging.

Regards,
Ralf

--
Ralf Sternberg

Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Re: rap-client.js & webapp startup speed [message #1489658 is a reply to message #1489564] Thu, 27 November 2014 15:14 Go to previous messageGo to next message
Sergei Vasilyev is currently offline Sergei VasilyevFriend
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

Re: rap-client.js & webapp startup speed [message #1489723 is a reply to message #1489658] Thu, 27 November 2014 16:23 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2426
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
Hi Sergei,
the additional uncompressed javascript comes from appearances js files
and Forms widgets, but as you mentioned, the overhead is not so big. We
are working hard to keep the client.js as small as possible. See related
bugzillas:
401126: [Forms] Register and load JavaScript on demand in forms bundle
https://bugs.eclipse.org/bugs/show_bug.cgi?id=401126
393497: Compress JavaScript in Forms bundle
https://bugs.eclipse.org/bugs/show_bug.cgi?id=393497
363745: Register appearances as static JavaScript
https://bugs.eclipse.org/bugs/show_bug.cgi?id=363745
Best,
Ivan

--
Ivan Furnadjiev

Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Re: rap-client.js & webapp startup speed [message #1489728 is a reply to message #1489658] Thu, 27 November 2014 16:27 Go to previous message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2426
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
BTW... the rap-client.js is not downloaded on every browser refresh
because browser caches it.

--
Ivan Furnadjiev

Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Previous Topic:Timing of 3.0 release
Next Topic:[ANN] RAP 3.0 release plan changed
Goto Forum:
  


Current Time: Fri Mar 29 04:55:20 GMT 2024

Powered by FUDForum. Page generated in 0.05095 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top