javascriptmvccanjsstealjs

StealJS and CanJS


I'm having problems using canJS together with stealjs, i've cloned the repo of javascriptmvc (3.3 use canJS). Now i've this folder structure

/js
   /can
   /documentjs
   /funcunit
   /plugins
   .
   .
   .

In another part of my application i've a "standalone module" e.g layout (generated using the scaffolding tool). I load this module using "js/steal/steal.js?path/to/module/layout" inside my page and it works. If I stole some jquery plugins (e.g. located in the main js folder) inside my layout.js like so:

steal('plugins/jqueryplugin.js', 'plugins/jqueryplugin.css', function() {
    // my code here
});

it still work, but when i try to add in the list of "dependecies" some component from "canJS" (even fixture.js generated with the tool...because it stoles can.fixture) it just stops to work and breaks everything. I've also tried using:

steal('that').then('this', function() {});

But i've the same results.....fail!!! anyone have any hints?


Solution

  • Ok i found the problem. There is nothing wrong with stealjs and canjs, but

    canjs just load its own version of jquery

    that will break my application. Now I need to find a way to load canjs and jquery separately (i use yii and some extensions need to have jquery loaded at a certain time so cannot wait for canjs).