Skip to content

Make jQuery Optional - #73

Closed
sandstrom wants to merge 3 commits into
emberjs:masterfrom
sandstrom:master
Closed

Make jQuery Optional#73
sandstrom wants to merge 3 commits into
emberjs:masterfrom
sandstrom:master

Conversation

@sandstrom

Copy link
Copy Markdown
Contributor

@sandstromsandstrom mentioned this pull request Jul 6, 2015
12 tasks

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mike1o1

Copy link
Copy Markdown

One approach the Angular team takes is to use Google's jqLite library if jQuery itself isn't loaded. Is it worth investigating to see if a similar approach can be taken for Ember?

This can also be exposed for developers. If a developer invokes Ember.$ or this.$() within a view and jQuery is not available, Ember would return an instance of jqLite. Angular's equivalent to Ember.$ is angular.element, which is documented here, in case you wanted some prior art to look at.

@locks

locks commented Jul 6, 2015

Copy link
Copy Markdown
Contributor

Related: emberjs/ember.js#3791

@runspired

Copy link
Copy Markdown
Contributor

Related #86 removes most of the reliance on jQuery for eventing.

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

@ming-codes

Copy link
Copy Markdown

Related: https://github.com/rwjblue/ember-native-dom-event-dispatcher

Haven't tried it yet, but assuming it works, it's a bridge to be rid of jQuery.

@sandstrom

Copy link
Copy Markdown
ContributorAuthor

Closing this RFC, since work is nowunderway to make jQuery optional.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants

@sandstrom@mike1o1@locks@runspired@ming-codes@dukex