Comments (8)
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).
from f2.
...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.
from f2.
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($){
// ...
});
from f2.
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.
from f2.
@brianbaker, the roadmap has been updated.
from f2.
Just closed #70 as a dupe
from f2.
...and no re-opening this because I accidentally closed it, too. Snow day.
from f2.
Could be a candidate to address this: https://github.com/bendc/sprint
from f2.
Related Issues (20)
- How to use F2 Registry and Store HOT 2
- Add support for cross-domain Apps HOT 7
- Add bower install to readme HOT 1
- Fix gruntfile.js in bower.json to match case in filename HOT 1
- Create build task in grunt file HOT 1
- change gh-pages task to only copy dist folder under docs HOT 1
- bump version to 1.4.2 HOT 1
- Upload new version to Nuget.org HOT 1
- Container error thrown when using shadow DOM HOT 2
- Issue related to i-pad - Set description as 'Tube'. HOT 2
- Add Failure AppHandler constants HOT 1
- Website examples fail to load HOT 1
- Issue related to i-pad - Set description as 'Tube'
- How to Use f2-autoload on F2.Event.emit or F2.Event.on HOT 3
- Can't recieve event in secure app HOT 1
- Update Libraries w/ Known Security Vulnerabilities HOT 3
- App Class's 'destroy' method is undocumented
- Cannot pass DOM element references in event data HOT 1
- APP_MANIFEST_REQUEST_FAIL is never emitted HOT 2
- Library is breaking if I don't use 'unsafe-inline' in CSP HOT 11
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from f2.