Skip to content
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

Closed
markhealey opened this issue Mar 1, 2013 · 8 comments · Fixed by #304
Closed

Remove internal jQuery dependency in F2.js #39

markhealey opened this issue Mar 1, 2013 · 8 comments · Fixed by #304
Milestone

Comments

@markhealey
Copy link
Member

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

@markhealey
Copy link
Member Author

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

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

@markhealey
Copy link
Member Author

@brianbaker, the roadmap has been updated.

@markhealey
Copy link
Member Author

Just closed #70 as a dupe

@markhealey
Copy link
Member Author

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

@markhealey
Copy link
Member Author

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

@brianbaker brianbaker linked a pull request Jul 15, 2021 that will close this issue
15 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants