How can I make the SmartGWT core smaller?
Asked Answered
M

4

6

I have recently written a Hello World application using SmartGWT and noticed that the size of the application is huge. In my case it is over 600kb just for that application.

I think that size is obscene so I narrowed the culprit down to two core libraries, ISC_Core and ISC_Foundation which combine for a total size of 649kb. Is there anyway to reduce the bloat of these libraries?

Any help would be appreciated.

Mongoose answered 4/12, 2009 at 3:35 Comment(0)
S
5

SmartGWT is not designed for Hello World applications, but for sophisticated enterprise applications that work with lots of entities and have lots of screens. In that use case, the final delivered size of a SmartGWT application is comparable to, if not smaller than the size you would get working with any other technology.

Basically if you tackle a larger-scale application with a flyweight technology, you end up with application code that re-creates the features that are already in SmartGWT. There's no bloat - SmartGWT is very compact on a features-per-byte basis - there's just more features.

If you really have an ultra-lightweight use case - say, adding minor interactivity to a web site that consists mostly of static content - then JQuery and other ultra-lightweight frameworks are the way to go. A lot of enterprises use a mixture of JQuery and SmartGWT/SmartClient, each for different purposes.

Sada answered 5/12, 2009 at 19:15 Comment(0)
M
2

Unfortunately you cannot, as SmartGWT have already stated here the size will remain constant or even increase. I tried SmartGWT but because of this issue and 3rd party framework integration problems I chose another framework.

A possible solution to their problem would be to introduce a dynamic JavaScript loader like is present in ZK. I have used it in my enterprise projects and it works very well.

Nowadays for smaller applications I tend to use jQuery directly.

Maurist answered 4/12, 2009 at 3:55 Comment(0)
C
1

As Charles stated you have to keep in mind that you actually build a rich client on a single HTML page, so it's loaded just once. You can preload the libraries on a login page where nobody notices it while he is entering the credentials.

Take a look at http://www.smartclient.com/docs/7.0rc2/a/b/c/go.html#group..networkPerformance

Candicecandid answered 30/3, 2010 at 7:8 Comment(0)
K
-1

If the foot print is really important to you, you might consider Ext GWT. Ext GWT has everything done in Java (and compiled with GWT). It techincally could remove the codes that your application doesn't count on.

Kortneykoruna answered 7/12, 2009 at 4:43 Comment(4)
I thought gwt-ext is no longer maintained, having been replaced by SmartGWTMoon
Trimming actually has very little effect in Ext GWT. Use a BorderLayout, Grid and some form controls, add an event handler or two, and you have an irreducible 600k core, similar to SmartGWT. You only get a small size with a meaningless demo (eg one Tab and one Button, no event handlers)Sada
Yes, but anything more complicated than a two-field login screen still pulls in the core runtime. Meanwhile, a very effective approach with SmartGWT is to download the SmartClient runtime in the background during login, which requires a single method call (background info here: smartclient.com/docs/8.1/a/b/c/go.html#class..FileLoader). This is, so far as I know, currently impossible in plain GWT or ExtGWT since the runtime is mixed with the application code, the generated resources have unpredictable names.Sada
Evidence for the above: here's someone who took the time to create 50 split points for a ExtGWT-based application, and got no benefit because the core widgets are always loaded: groups.google.com/group/google-web-toolkit/browse_thread/thread/…Sada

© 2022 - 2024 — McMap. All rights reserved.