Hey Justin,
I hope you don't mind me taking up this old thread again. I just tried
to implement the 'dummy' steal you spoke of.
The problem is that the compressed JSMVC requires the dummy to be
rather elaborate because .then() is expected to pass the most recent
steal to the passed function.
I have been trying to do this to solve a different problem:
- I have two applications: app1, app2
- They share some code and I have successfully compiled the
applications into app1/production.js, app2/production.js and packages/
0.js
- Depending on the result of a bootloader function, I want either
app1 or app2 to load
So I created a bootloader script in which I put steal.production.js,
packages/0.js and and my bootloader function.
I'm stuck trying to load app1/production.js or app2/production.js.
Given the above setup, how would I use steal to load either of the
compressed fragments in app1 or app2?
It may be worth noting that the directory structure is different from
before. I want is three files called bootloader.js (containing
(mock-)steal, the shared code from 0.js and the bootloader function)
that loads either app1.js or app2.js (from the same directory). I can
see there are references to //app1/controllers and such in app1.js and
app2.js. Could this be a reason why steal fails. If I had a working
steal dummy, then obviously I wouldn't have to care about any of that.
Here's my approach
steal = function(){
for(var i=0, l=arguments.length; i<l; i++) {
if(typeof arguments[i] === 'function') arguments[i]()
}
return steal;
}
steal.end = steal.start = steal.then = ... = steal;
As I said, that breaks when the compressed framework uses steal.then.
I hope you can help me. I'm a little concerned about how steal is this
huge magic black box and whenever I try to do something unintended, I
end up spending a lot of time and rarely achieve my goals. It probably
makes sense to write up a few scenarios and how to implement them
using steal. What we're doing seems fairly standard. We load a
barebones bootloader that switches on either of a list of applications
(depending on language, browser, who cares).
Thanks and regards,
Jonas
On Sep 6, 8:43 pm, Justin Meyer <
justinbme...@gmail.com> wrote:
> A better approach would be to use the build/apps functionality to order the
> dependencies and then just insert a 'dummy' steal on top:
> steal = function(){
> for( arguments)
> if(arg is function) arg()}
>
> steal.plugins = steal.controllers = .... = function(){}
>
> Justin Meyer
>
> Jupiter Consulting
> \Development\Training\Support
>
847-924-6039
>
justinbme...@gmail.com
>
> On Mon, Sep 6, 2010 at 1:38 PM, Jonas Huckestein <
jonas.huckest...@gmail.com
> >
javascriptmv...@googlegroups.com<javascriptmvc%2Bunsubscribe@goog
legroups.com>
> > .
> > --
> > You received this message because you are subscribed to the Google Groups
> > "JavaScriptMVC" group.
> > To post to this group, send email to
javasc...@googlegroups.com.
> > To unsubscribe from this group, send email to
> >
javascriptmv...@googlegroups.com<javascriptmvc%2Bunsubscribe@goog
legroups.com>
> > .