Skip to content

Document which jQuery modules are relied upon #3791

Closed

Description

@lukemelia

This would allow people to do a custom build of jQuery if they would like: https://github.com/jquery/jquery#modules

Activity

  1. wagenet commented on Nov 26, 2013

    @wagenet
    Member

    @lukemelia Are you volunteering? It should be a matter of running the tests with a custom build and seeing what fails.

  2. lukemelia commented on Nov 26, 2013

    @lukemelia
    MemberAuthor

    Yes, you can assign me. On a ongoing basis, do you think we would want tests to run with the necessary custom build, with all of jQuery, or both?

  3. wagenet commented on Nov 26, 2013

    @wagenet
    Member

    Good question. I think we might want to consider just changing the official dependency to be a subset of jQuery and just run tests against that. If we can run against a subset we should be able to run against the full thing in theory. We could also make the tests do both if we thought that was helpful.

  4. wagenet commented on Nov 26, 2013

    @wagenet
    Member
  5. lukemelia commented on Dec 21, 2013

    @lukemelia
    MemberAuthor

    Update: I spent about 30 minutes looking into this and found that jQuery's custom build system made it easy to create builds that don't work. It will be more complex than I expected to figure out which modules are necessary.

  6. rwjblue commented on Dec 22, 2013

    @rwjblue
    Member

    How about this: run through the main modules, build jQuery without them (one at a time), run our test suite, and document the failures/errors by module. Then start picking off the lowest hanging items one at a time.

    @lukemelia - Does that sound like a decent plan? If yes, I can devote some time to the first pass this week...

  7. lukemelia commented on Dec 23, 2013

    @lukemelia
    MemberAuthor

    Seems reasonable, Robert!—
    Sent from Mailbox for iPhone

    On Sun, Dec 22, 2013 at 6:55 PM, Robert Jackson notifications@github.com
    wrote:

    How about this: run through the main modules, build jQuery without them (one at a time), and run our test suite, document the failures/errors by module. Then start picking off the lowest hanging items one at a time.

    @lukemelia - Does that sound like a decent plan? If yes, I can devote some time to the first pass this week...

    Reply to this email directly or view it on GitHub:
    #3791 (comment)

  8. ebryn commented on Dec 29, 2013

    @ebryn
    Member

    I've had luck on modern browsers using a custom jQuery 2 build with these flags:

    grunt custom:-ajax,-ajax/script,-ajax/jsonp,-deprecated,-dimensions,-effects,-event-alias,-offset,-sizzle

    HTMLBars will require even less :D

  9. wagenet commented on Apr 15, 2014

    @wagenet
    Member

    @rjackson ping.

  10. locks commented on May 19, 2014

    @locks
    Contributor

    I just finished the first pass at this and I managed to remove more dependencies than I was expecting to. Results are up at https://gist.github.com/locks/cdbd04e6a2f9cefe8304.

    @ebryn I tried removing sizzle but it broke quite bad, did you supply an alternative?

    For the next pass I'm going to look into the failing tests and see if I can replace jQuery with native code.

  11. tomdale commented on May 21, 2014

    @tomdale
    Member

    @locks: Be careful with that one. jQuery.remove, for example, does a lot of things that we implicitly rely on to keep our memory consumption down. Off the top of my head, jQuery unbinds events and clear any data that may have been added by jQuery.data, which will otherwise leak. Changing to using native DOM manipulation will introduce a memory leak into any Ember apps that use, for example, jQuery UI or jQuery Mobile.

  12. locks commented on May 21, 2014

    @locks
    Contributor

    @tomdale how do you suggest I make sure I don't introduce regressions?

    My general plan was to err on the side of aggressiveness, and then re-introduce the modules when problems were detected.

  13. trek commented on Jul 15, 2014

    @trek
    Member

    We're pretty close to removing jQuery as a dependency. There were several stabs at integrating jQuery's custom build system to work with rake-p and Broccoli, but it seems silly at this point.

  14. locks commented on Aug 6, 2014

    @locks
    Contributor

    @trek curious about updates on this front

  15. tomdale commented on Aug 8, 2014

    @tomdale
    Member

    @locks We discussed this at the core team meeting but still feel uncomfortable dropping the dependency, especially due to extremely common confusion around props vs. attrs (which jQuery fixes up). We're going to try to extract the functionality that we need into separate libs, but I don't think it's top priority at the moment.

  16. locks commented on Aug 14, 2014

    @locks
    Contributor

    @tomdale thanks for the feedback. it's understandable, I was even under the impression that when htmlbars was fully merged that my efforts could be for naught.
    I feel like the gist is still useful for when extracting the separate libs.

  17. runspired commented on Aug 22, 2015

    @runspired
    Contributor

    This RFC would nearly remove the reliance on jQuery for eventing: emberjs/rfcs#86

    In my current implementation, jQuery.event.fix(e) is used to normalize the event. This is something that could be pulled out as a micro-lib exposing the needed jquery AMD module.

    https://github.com/runspired/ember-capture-eventing/blob/master/addon/event_dispatcher.js#L379

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions