dmecke / ChatBundle

MIT License
15 stars 13 forks source link

remove dependency on jquery #15

Open dmecke opened 10 years ago

dmecke commented 10 years ago

As the focus of this bundle is on the backend there is no need to force the use of jquery (especially as it is undocumented at the moment).

mgersten-caxy commented 10 years ago

jQuery certainly makes the front end cleaner, would it just be easier to document that the bundle uses jQuery if one wants to use the templates? Perhaps the JS should be split out from the template so that different JS implementations can be added?

dmecke commented 10 years ago

Splitting it out from the template is a good idea in every case i think. Why i think it would be better to remove the dependency is that we would need to take care about the jquery version as well, so it provides the correct methods. If we instead implement the functionality in plain js we dont have this problem. What do you think?

mgersten-caxy commented 10 years ago

.post, .val, .submit, and .html are from jQuery 1.0, so I don't think versions are an issue

dmecke commented 10 years ago

Hm, good point. And most likely everybody who wants to have a chat in his application uses jquery anyway, right? Ok, so lets simply add the dependeny to the documentation.

mgersten-caxy commented 10 years ago

Well, the beauty of having it as a separate file is that people can submit PR for other JS implementations if they want (assuming you'd be accepting of such things). There are lots of common JS frameworks, see http://todomvc.com/. I'd suggest if you're using jQuery in your app, start there, if you're open to PRs for other implementations, that can be mentioned in the docs.

dmecke commented 10 years ago

That sounds like a good solution.