[Seaside] Re: Non-blocking jQuery load

jtuchel jtuchel at objektfabrik.de
Fri Nov 20 07:08:04 UTC 2015


Hi Johan,


Am 19.11.15 um 22:17 schrieb Johan Brichau-2 [via Smalltalk]:
> Hi Joachim,
>
> jQuery load is an ajax request and should thus not be blocking any 
> browser action.

Yes, that's what I thought as well...

>
> What kind of interaction are you expecting from the ‘click’ to which 
> the browser is not responder?
> A page request, an ajax request, the execution of a javascript 
> program, ... ?
On our Dashboard we have the main navigation menu which consists of 
anchors with normal callback blocks.

After I had sent my last mail, I saw that both ajax requests take about 
the same time to finish (4022 and 4096 ms on a slow development 
machine), so I thought maybe this all is just a coincidence.

So here is what I've tried then:

I added a (Delay forSeconds: 5) wait to one of our dashboard widget's 
business code.

What happens is this:

The widgets all immediately start an ajax request, and the one without 
the Delay gets rendered after the usual 4 seconds. The other one renders 
a bit more than 5 seconds later. So far, so unsurprising.

BUT: If I click on one of the main navigation links (which should be 
totally unrelated to the Components that issue the ajax call), the 
callback is not called before the longer runnin Ajax request is 
finished. The Re-rendering of the Component in the Browser is not 
performed, however (at least I can't see it).

So the first observation seems to tell me the "load html:" calls are not 
blocking. The second, however, seems to indicate that they block.

Or (shiver) there is something strange going on on the server side (VA 
Smalltalk) that keeps the server from handling the "normal" request 
before the ajax requests are finished. I need to test with a bit more 
logging to find out...

Thanks for listening,

Joachim





>
> Johan
>
> > On 19 Nov 2015, at 09:59, jtuchel <[hidden email] 
> </user/SendEmail.jtp?type=node&node=4862097&i=0>> wrote:
> >
> > Hi,
> >
> > in our application, the user sees a dashboard right after logging in.
> > Depending on the configuration of this dashboard, load and render 
> times can
> > get quite long.
> >
> > So we tried to wrap slow components into a Decoration that uses 
> load() to
> > postponbe the loading of their content. The render code in our 
> decoration
> > looks like this:
> >
> > replaced
> > ifTrue: [div with: [self renderNextOn: html]]
> > ifFalse: [
> > html document addLoadScript: (
> > (html jQuery: self idSelector) load html: [:r |
> > replaced := true.
> > self renderNextOn: html]).
> > div with: [
> > html image src: someSpinnerImage
> > html space; text: self message]]
> >
> >
> >
> > Thus, we hoped, the page would display very quickly, and be responsive
> > before all the widgets are loaded.
> >
> > So far, we've reached one of the two goals: the page now loads 
> quickly and
> > the widgets use ajax to load their contents later. Another nice side 
> effect
> > is that if you go back to the start page, all widgets are loaded 
> already.
> >
> > The other goal, however, is not met: If you log in and immediately 
> click on
> > one of the menu items, the browser won't react to your click before all
> > widgets have finished loading. So it seems like jQuery's load is 
> blocking.
> >
> > We've tried in Chrome and Firefox, and both expose this behavior.
> > Does anybody know how to not only cheat on the load times of our 
> dashboard
> > but also enable the browser to react on clicks before all widgets have
> > loaded their contents?
> >
> > Any hint is appreciated,
> >
> > Joachim
> >
> >
> >
> > --
> > View this message in context: 
> http://forum.world.st/Non-blocking-jQuery-load-tp4861881.html
> > Sent from the Seaside General mailing list archive at Nabble.com.
> > _______________________________________________
> > seaside mailing list
> > [hidden email] </user/SendEmail.jtp?type=node&node=4862097&i=1>
> > http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>
> _______________________________________________
> seaside mailing list
> [hidden email] </user/SendEmail.jtp?type=node&node=4862097&i=2>
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>
>
> ------------------------------------------------------------------------
> If you reply to this email, your message will be added to the 
> discussion below:
> http://forum.world.st/Non-blocking-jQuery-load-tp4861881p4862097.html
> To unsubscribe from Non-blocking jQuery load, click here 
> <http://forum.world.st/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=4861881&code=anR1Y2hlbEBvYmpla3RmYWJyaWsuZGV8NDg2MTg4MXwxNjg2NTg4NDEw>.
> NAML 
> <http://forum.world.st/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml> 
>


-- 
-----------------------------------------------------------------------
Objektfabrik Joachim Tuchel          mailto:jtuchel at objektfabrik.de
Fliederweg 1                         http://www.objektfabrik.de
D-71640 Ludwigsburg                  http://joachimtuchel.wordpress.com
Telefon: +49 7141 56 10 86 0         Fax: +49 7141 56 10 86 1





--
View this message in context: http://forum.world.st/Non-blocking-jQuery-load-tp4861881p4862141.html
Sent from the Seaside General mailing list archive at Nabble.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/seaside/attachments/20151119/e2409f0c/attachment-0001.htm


More information about the seaside mailing list