The priority ordering is lost when the call is handed over to
RequireJS from pageinit:invokeInitializer().

There's a shed load of code on the server side to ensure the priority
ordering is kept.
The generated page init JSON is in the correct order.
The initialisation code is called in the correct order.
But pageinit:invokeInitializer() doesn't actually invoke the
initializer. It calls require() which seems to store a callback to be
executed sometime later.

I'm guessing the random execution order is due to the async nature of
the modules being loaded.

Being new to AMD and RequireJS I don't know how to go about fixing
this. Should I raise a JIRA?

Steve.
--
Steve Eynon
-------------------------------
"If at first you don't succeed,
   so much for skydiving!"



On 17 January 2013 13:32, Steve Eynon <steve.ey...@alienfactory.co.uk> wrote:
> Hiya,
>
> I have the following in a component:
>
> void setupRender() {
>     
> jsSupport.require("af/highcharts/theme/darkGreen").priority(InitializationPriority.EARLY);
>     jsSupport.require("af/highcharts/lineChart").with(params);
> }
>
> and yet the theme module is still called *after* the lineChart. From
> Firefox console:
>
> Invoking af/highcharts/lineChart({ ... })
> Invoking af/highcharts/theme/darkGreen()
>
> Is this because one module is invoked with params and the other
> without? The component is used several times on the same page,
> resulting in many calls to "require" the same modules.
>
> Steve.
> P.S. So far I'm liking the use of RequireJS - I get a cosy feeling
> from having my dependencies injected into my JS modules, it's like an
> IoC for JS!
> --
> Steve Eynon
> -------------------------------
> "If at first you don't succeed,
>    so much for skydiving!"

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to