-
Notifications
You must be signed in to change notification settings - Fork 62
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
Remove internal jQuery dependency in F2.js #39
Comments
As of 1.1, jQuery is bundled inside of a closure in F2 (along with Bootstrap modals) so the container doesn't actually need jQuery or Bootstrap.js on the page. The caveat to this is that some v1 apps have been written with the assumption that jQuery is on the page. I think we'll have to look towards v2 and adding to the spec that apps should bundle whatever libs they need (in .noConflict mode, of course). |
...and I like the idea of allowing App Developers—perhaps by adding a property to the AppConfig—to define what frameworks their app requires. This would permit the Container Developer to optimize the container's static resources. |
In version 2.0 of F2, one way of dealing with legacy F2 apps usage of jQuery is to have your loader automatically wrap legacy code in define(["path/to/jquery"], function($){ // other dependencies may be added
// legacy code
}); Also, to continue along @markhealey's point, I think both container and app should have a manifest declaring what resources they provide or require, respectively. Currently, the container only has a supportedViews() method and that is not enough. The F2 framework should then take these container resource declarations and publish them via the has.js api so conditional loading can be done in AMD. define([has("F2-provides-jQuery.1.8")? "jQuery": "path/to/CDN/jQuery1.8"], function($){
// ...
}); |
I realize now after adding #70 that this issue is already out here. The original request was to remove the dependency on jquery (the container had to provide it on the page). As stated previously, as of 1.1 this is no longer the case and the requirement no longer exists. We can use #70 to track removing jquery internally in order to slim down F2.js. We need to add to the roadmap (if not already there) the thoughts on containers and apps and what they provide and depend on per @ilinkuo comments. |
@brianbaker, the roadmap has been updated. |
Just closed #70 as a dupe |
...and no re-opening this because I accidentally closed it, too. Snow day. |
Could be a candidate to address this: https://github.com/bendc/sprint |
Remove jQuery dependency in F2.js making library capable of running alongside frameworks such as jQuery, Dojo, ExtJS, PrototypeJS, etc. without any additional overhead. Possibly replace jQuery dependency with Zepto.js to reduce effort.
The text was updated successfully, but these errors were encountered: