-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[QUEST] Making jQuery Optional #5320
Comments
Ember Data jQuery usage can be described as this:
Regarding current state of Questions I see as of today:
|
So, could we completely remove |
I just realised that Ember Data documentation is referring to |
@tchak mentioned in chat:
I think it would be important to make sure the error messaging for this scenario is very clear (and ideally at build time). "You opted out of jQuery, but Ember Data requires And we should mention it in an "opting out of jQuery" guide that we should write. |
@igorT what's the story with |
For reference, here is another issue discussing the removal of jQuery from Ember Data: #4929 |
@wycats It was implemented in 2015 and then merged (still behind a flag) in 2016. A while later it was decided that it needed to go through the RFC-process, where it has stalled (it has remained behind a flag pending resolution on the RFC).
Source: emberjs/rfcs#171 (rendered) (it was a while since I looked at the RFC closely, but from what I can remember it contained a bunch of good improvements + should be helpful in making jQuery optional, but I'd better have another look before I say anything with certainty) |
@sandstrom is there anything stopping us from merging the RFC at this point? /cc @igorT |
I believe the RFC stalled waiting for some feedback/buy-in on the idea of aligning the proposed |
@bmac is there any problem with that? |
@wycats I commented on the RFC with a list of pending concerns/questions |
I am unsure how we can help to create a consensus on the RFC. |
The truth is that without the |
Working towards emberjs#5320
Working towards emberjs#5320
This issue tracks emberjs/ember.js#16058 for Ember Data.
Currently, ember.js is in the progress of making jQuery optional. This does not deprecate jQuery in Ember, but it makes using Ember without jQuery a first-class option. Today, it's possible, but the Ember tests don't run without jQuery, and users need to keep track themselves of which APIs might inadvertently rely on jQuery.
This issue tracks making jQuery optional in the Ember Data component of Ember.
As a general principle, there are a few different kinds of reliance on jQuery:
fetch()
in Ember Data).ajaxSend
and other public jQuery APIs to configure the fetch. In this case, the strategy we're using is to keep around the jQuery code, but allow users to opt into a more standard mode explicitly. In general, we would like to try to detect when users are attempting to use jQuery in development mode and give them good assertions.So in short, we need to remove the use of jQuery in purely internal places, and create a mode for using Ember Data without jQuery on an opt-in basis in places where jQuery is leaked into the public API.
To get started, I'd recommend using an internal flag like jQueryDisabled that you can use as a conditional to opt into the no-jquery semantics. Ember Core will soon create a flag you can use explicitly (we need an RFC) that you can swap to as soon as we have it. But there's no reason to wait.
@tchak would you mind commenting with concrete steps we need here, and I'll add them to the issue?
Work to be done:
$.parseJSON
ember-fetch
bloat to people opting out of jQuery$.ajax
The text was updated successfully, but these errors were encountered: