Remove internal jQuery dependency in F2.js #39

Open
markhealey opened this Issue Mar 1, 2013 · 8 comments

Comments

Projects
None yet
3 participants
@markhealey
Member

markhealey commented Mar 1, 2013

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.

@brianbaker

This comment has been minimized.

Show comment
Hide comment
@brianbaker

brianbaker Mar 1, 2013

Member

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).

Member

brianbaker commented Mar 1, 2013

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).

@markhealey

This comment has been minimized.

Show comment
Hide comment
@markhealey

markhealey Mar 1, 2013

Member

...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.

Member

markhealey commented Mar 1, 2013

...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.

@ilinkuo

This comment has been minimized.

Show comment
Hide comment
@ilinkuo

ilinkuo Mar 2, 2013

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($){
   // ...
});

ilinkuo commented Mar 2, 2013

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($){
   // ...
});
@brianbaker

This comment has been minimized.

Show comment
Hide comment
@brianbaker

brianbaker Apr 10, 2013

Member

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.

Member

brianbaker commented Apr 10, 2013

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.

@markhealey

This comment has been minimized.

Show comment
Hide comment
@markhealey

markhealey Apr 11, 2013

Member

@brianbaker, the roadmap has been updated.

Member

markhealey commented Apr 11, 2013

@brianbaker, the roadmap has been updated.

@markhealey

This comment has been minimized.

Show comment
Hide comment
@markhealey

markhealey Apr 15, 2013

Member

Just closed #70 as a dupe

Member

markhealey commented Apr 15, 2013

Just closed #70 as a dupe

@markhealey markhealey closed this Apr 15, 2013

@markhealey markhealey reopened this Apr 15, 2013

@markhealey

This comment has been minimized.

Show comment
Hide comment
@markhealey

markhealey Apr 15, 2013

Member

...and no re-opening this because I accidentally closed it, too. Snow day.

Member

markhealey commented Apr 15, 2013

...and no re-opening this because I accidentally closed it, too. Snow day.

@markhealey

This comment has been minimized.

Show comment
Hide comment
@markhealey

markhealey Apr 27, 2015

Member

Could be a candidate to address this: https://github.com/bendc/sprint

Member

markhealey commented Apr 27, 2015

Could be a candidate to address this: https://github.com/bendc/sprint

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment