ChatBundle icon indicating copy to clipboard operation
ChatBundle copied to clipboard

remove dependency on jquery

Open dmecke opened this issue 11 years ago • 6 comments

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).

dmecke avatar Aug 27 '14 19:08 dmecke

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?

mgersten-caxy avatar Aug 28 '14 00:08 mgersten-caxy

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?

dmecke avatar Aug 28 '14 04:08 dmecke

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

mgersten-caxy avatar Aug 28 '14 04:08 mgersten-caxy

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.

dmecke avatar Aug 28 '14 04:08 dmecke

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.

mgersten-caxy avatar Aug 28 '14 05:08 mgersten-caxy

That sounds like a good solution.

dmecke avatar Aug 28 '14 06:08 dmecke