judgegem / judge

Client-side form validation for Rails
MIT License
256 stars 41 forks source link

Reconsider bundled third-party JS #65

Open joecorcoran opened 9 years ago

joecorcoran commented 9 years ago

Opening this discussion.

  1. json2.js is only needed for IE < 8 according to http://caniuse.com/#feat=json – can we stop shipping this and leave it to users to work out whether they need legacy IE support? I would vote to remove it and leave a helpful note about legacy support in the documentation.
  2. This is a more complex one. The version of Underscore that Judge provides is very out of date and, in retrospect, I don't like the praxis of providing dependencies as part of this library. When Judge was first written, JS dependency management tools like Bower and npm either didn't exist, or had not been widely adopted. Nowadays it's still a pretty fragmented state of affairs, but I think users can be expected to take care of it for themselves. I think the options are:
    1. Remove Underscore from the Judge project. Expect users to install it into their applications
    2. Remove Underscore from the Judge project completely, including refactoring it out of judge.js
    3. Continue to ship Underscore with Judge, make more of an effort to keep it up to date

Thoughts?

jamesmk commented 9 years ago
  1. 👍
  2. I'd vote for (iii). If it's a true dependency I believe it should be bundled in the gem for ease of implemenation, but I agree we should keep it up to date.

The other part of the discussion here would be what version would these changes would go into? These are potenially non-backwards compatible since we'd officially be dropping some browser support. This hints at bumping the version to v3, but that's also a big jump follow the version history of the gem.