Drop Zepto from the docs #2431

Closed
wookiehangover opened this Issue Mar 26, 2013 · 9 comments

Comments

Projects
None yet
4 participants
Collaborator

wookiehangover commented Mar 26, 2013

Now that the test suite isn't running against Zepto, perhaps we should drop the reference to it as an alternative DOM library from the docs (and note it in the changelog for 1.0).

If for whatever reason we'd like to keep it in the docs, there are a few ways to proceed as I see it:

  1. Fix the breaking tests and keep it in the docs (that would need to be included in a minor release and noted in the changelog.) There are currently 4 failing tests: 3 have to do with delegateEvents and 1 can be fixed directly in the test suite (it's relying on a :has pseudo-selector, which Zepto chokes on.)
  2. Open an issue with Zepto and ask them to imitate jQuery more faithfully, but I doubt that Fuchs would bite on that.
  3. The nuclear option: remove official support from the docs.

So far, there are 3 projects in the examples section that use it: LinkedIn Mobile, Gilt Groupe, and Tzigla. Based on the relatively high profile of the first 2 names on that list, and the fact that it's still called out as a valid option in the docs, I think that something needs to be done.

(FWIW, I totally agree with the decision to drop support for it, I just don't want it to trip people up when it doesn't actually work.)

Collaborator

wookiehangover commented Mar 26, 2013

But the good news is that 1.0 has waaaay fewer failing tests with Zepto than 0.9.10 or 0.9.9

Collaborator

wookiehangover commented Mar 26, 2013

I was able to make the test suite pass with only minor changes to the test code (#2432). Closing this out in favor of the pull request.

jashkenas reopened this Mar 27, 2013

Owner

jashkenas commented Mar 27, 2013

How about "Use at your own risk" -- explain that Zepto is an attempt to emulate the core jQuery API, but isn't 100% compatible.

Collaborator

wookiehangover commented Mar 27, 2013

I think that's fine... Obviously we don't run tests with lodash and it's similarly referenced. I guess I was a bit surprised at how little change was required to get the tests to run and felt I should submit #2432 as part of the discussion.

My real concern is that if at some point in the future Zepto really ceases to be a viable option that it be removed from the docs. Just want to prevent giving people bad advice :)

EDIT: apparently lodash isn't referenced in the docs anymore

Collaborator

wookiehangover commented Mar 28, 2013

Here's what I'm currently thinking:

  • Remove the reference from the "Downloads and Dependencies" section.
  • Add an "Alternate Dependencies" section to the F.A.Q.

Something like:

Backbone uses a subset of jQuery's API and is generally compatible with jQuery-like libraries, like Zepto. If you plan on using Zepto, please proceed with caution: Zepto is not entirely faithful to the jQuery API and it's possible that future releases may not work with Zepto as a jQuery replacement.

Collaborator

knowtheory commented Mar 28, 2013

Seems like we should assert something like:

Backbone targets and tests against jQuery and Underscore.js as dependencies. The extent to which jQuery or underscore alternatives, such as Zepto.js or LoDash.js, are supported depends on those libraries adherence to the jQuery and Underscore.js APIs. Where testing against alternative libraries is provided, it is as a convenience and not a guarantee.

I don't have any problem keeping Zepto in our current test suite, the question really is whether future maintenance will be necessary, and whether new tests will have to be written with Zepto in mind or whatever (and who will keep an eye out for that)

Collaborator

wookiehangover commented Mar 28, 2013

@knowtheory +1 on that pass of the copy

Part of the point of #2432 was to add the Zepto tests to the Travis build, to establish if it's responsible to say that it still "works" or not (and have a baseline for deciding whether or not it should be in the documentation as an optional jQuery replacement). If the final assessment is that we really don't want to expend the extra energy to support it, that's fine too.

Contributor

jdalton commented Apr 1, 2013

I was just going to open an issue about a Zepto inconsistency.
Currently Backbone has:

    // Remove this view by taking the element out of the DOM, and removing any
    // applicable Backbone.Events listeners.
    remove: function() {
      this.$el.remove();
      this.stopListening();
      return this;
    },

The problem is Zepto's remove is really a detach so event data is never removed causing a leak.

Collaborator

wookiehangover commented Apr 1, 2013

@jdalton thanks, good catch.

IMO more evidence for the "use at your own risk" line of reasoning...

jashkenas closed this in afb9dfc Apr 4, 2013

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