On 25 juin, 13:37, Vladislavs Korehovs <
vladislavs.koreh...@gmail.com>
wrote:
> Hi,
>
> I dont see your point at all.
> RootPanel is something optimization cannot drop, because it is core of
> your applications.
> As i say there should be at most 5-10 root panels in most
> applications. And thease are VERY coarse grained components.
> If compiler will build dependency graph to determine which peaces of
> Code are unused, it wont be RootPanels Since RootPanels are Entry
> points of your applications.
RootPanels are *one* way to "inject" widgets into the page at
identified locations. You can also use the newly introduced .wrap()
methods of some widgets:
http://code.google.com/p/google-web-toolkit/source/detail?r=3085
And you're not forced to use widgets with GWT (you can use bare DOM
access for instance; and/or GwtQuery ;) ), nor are you obliged to use
widgets as they're done in com.google.gwt.user.*
EntryPoints are something different as far as GWT is concerned, and
there can only be one per module.
> Not everything should be driven by
> compiler, something as coarse as RootPanels could be driven by
> configuration or convention.
So you're proposing that "injectable" widgets derive from some base
class? If so, say it clearly.
Or are you using the term "widget" to actually mean "module
EntryPoint"?
so <div class="gwtWidget" name="com.mycompany.MyApplication"> would
then be caught by a GWT app that'll in turn load the
com.mycompany.MyApplication module.
Are your injected "widgets" intended to communicate with each others?
or are they meant to be "standalone" "applications"?
> What you are trying to persuade is common pitfall of bad designs, it
> is generalizing some particular thing(conpilation driven) what is
> benefitial for something across whole things, and at the end you endup
> with too many quirks for humans, because Compiler is different from
> Human
>
> Microformats inject only simple types, like Strings and Integers so
> there is no Way how injection can make 200kb bigger code.
> All your figures are completely based on imagination and not taking
> into accout facts and typical ussage scenarios.
My main problem is to identify those "typical usage scenarios". I
believe most GWT applications have only one "instance" injected into a
page, so using a predefined id and RootPanel.get(id) isn't a problem.
In the issue report, you say one use case is to communicate from
server to client without involving RPC. GWT already has such a thing,
without involving microformats: the Dictionary class.
If what you'd like is to communicate some element ids to the app so
that RootPanel is parameterized at runtime by the calling page; you
could use such a Dictionary. Only that Dictionary would have to have a
predefined name (eventually being the module's name).
I believe what you'd like to achieve is doable as a 3rd-party lib
(i.e. don't require any change to the compiler or any GWT client
class). So go ahead, code it, and if it works eventually propose it
for inclusion into the incubator (with a chance that it'll be merged
into "core" at some time).
What I wonder is how to do dynamic injection (while "placeholders" are
added/removed), and moreover without memory leak.
(off topic: I have a gripe about so-called microformats, which
actually doesn't have any more meaning than "Web 2.0", are sometimes
abusing HTML, etc. Not that the idea is borked, but it has evolved in
a bad bad way... e.g. using HTML to convey machine-oriented data while
originally it was about annotating user-oriented data with machine-
readable metadata... see
http://www.bbc.co.uk/blogs/radiolabs/2008/06/removing_microformats_from_bbc.shtml
)