Re: Flash of Unstyled Content
Cheers Thomas.
Yeah, I appreciate I might be making a rod for my back here. If
ClientBundle were the only GWT feature I were planning to use, and
there was another spriting solution with proper i18n support, I might
well take another route. As it is, I'll think I'll cautiously look
into writing my own Linker.
Thanks very much for the tips,
Kris
> > Thanks Stefan. :-)
>
> > Yes, sorry - I typed that code it when I should have copied and pasted
> > - it would have been clearer. Here's the whole of my module:
>
> > public class FrontPage implements EntryPoint {
> > private static final FrontPageClientBundle clientBundle =
> > GWT.create( FrontPageClientBundle.class );
>
> > public void onModuleLoad() {
>
> > StyleInjector.injectAtStart( clientBundle.style().getText(), true );
> > }
>
> > }
>
> > I actually don't have any GWT widgets - at least not yet. I just want
> > to take advantage of GWT's spriting & hashing to begin with, to speed
> > up the load of an existing page. And it works *really* well, except
> > for the brief flash at the beginning where the page renders once
> > without any style information. That's the problem I'm trying to solve.
>
> > Any ideas?
>
> As good as GWT ClientBundle is, it's not meant to solve your issue
> (styling an HTML page). If I were you, I'd either:
> - rather use other CSS tooling (http://sass-lang.com/orhttp://lesscss.org/
> for instance, and/orhttp://spriteme.org/)
> - if you want to stick with GWT's ClientBundle, create your own
> Linker (inspired by XSLinker if I were you) to (try to) load the
> stylesheet "synchronously", without waiting for the onload/
> DOMContentLoad event.
>
> But really I find it weird to use JavaScript to control "plain old
> styling", so I'd rather go the first way, i.e. using the right tool
> for the job.
--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home