-
Notifications
You must be signed in to change notification settings - Fork 212
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add optional support for require.js #20
Comments
We would want to namespace |
Would have to wrap all files in Try implementing this strategy in the demo site to see if it works. |
See the requirejs branch. Verdict is that requirejs will be too confusing to beginners and to people who don't need it. |
James, have you considered ypenope.js? I found it a lot simpler than requirejs. |
It is indeed simpler. I tried it in a new yepnope branch. It seems to download all the dependencies correctly, but when it executes the |
I created an issue on yepnope: SlexAxton/yepnope.js#161 |
I also created an issue with headjs: headjs/headjs#231 Amazingly, the very old, no longer developed labjs works fine! |
Anyway, for the demo, I think If we were to integrate LAB for use by developers outside the demo, developers would need to set the LAB base path to the folder containing ajax-solr, because the paths to ajax-solr files are hardcoded: $LAB.setGlobalDefaults({BasePath: '../../'}); All their other scripts would have to be relative to this base path. If another library required developers to set the LAB base path, it'd be impossible to satisfy both. This wouldn't be an issue if LAB had something like Yepnope's path filter. The solution to the conflict would be to define a Anyway, I'm not sure LABjs is popular enough to bother adding this to ajax-solr. The only request has been for requirejs so far. If Yepnope or headjs fix their issues, we can maybe add those later. |
I tried require.js again, without using |
With some help from the maintainer, I got head.js working. See this fiddle for a small example: http://jsfiddle.net/TWDy4/2/ Update: The approach becomes very unwieldy, as you need to nest |
requirejs works now - I had the wrong syntax. |
James, I only quickly skimmed over your commits, but one thing stands out: https://github.com/evolvingweb/ajax-solr/blob/requirejs/core/AbstractSpatialWidget.js#L67 |
Oops, that was leftover from my earlier work. Keen eye! I've removed it now. |
If people want to manage dependencies with require.js, we can add the necessary code to assist integration. Think about using it in the demo and tutorial.
The text was updated successfully, but these errors were encountered: