Giter Club home page Giter Club logo

Comments (8)

brianbaker avatar brianbaker commented on July 16, 2024

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.

markhealey avatar markhealey commented on July 16, 2024

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

ilinkuo avatar ilinkuo commented on July 16, 2024

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.

brianbaker avatar brianbaker commented on July 16, 2024

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.

markhealey avatar markhealey commented on July 16, 2024

@brianbaker, the roadmap has been updated.

from f2.

markhealey avatar markhealey commented on July 16, 2024

Just closed #70 as a dupe

from f2.

markhealey avatar markhealey commented on July 16, 2024

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

from f2.

markhealey avatar markhealey commented on July 16, 2024

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

from f2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.