Remove jQuery as a dependency
Floofies opened this issue · 4 comments
Per my (possibly inaccurate) count, this only directly uses jQuery 40 times. I believe the semantics are small enough to be retrofitted with "vanilla" JavaScript easily. Selectors can be kept the way they are by directly including Sizzle in the project source, which is what jQuery uses. That leaves a small spattering of easily reproduced methods.
Methods:
- $.extend 5 times.
- $.parseJSON 3 times.
- $.type Once.
- $.ajax Once.
- $.parseHTML Once.
- $.trim Once.
Selectors: 28 times.
Might this be possible for Version 2, or is it destined for it's own fork? I'd like to know what the consensus is.
Removing jQuery as a dependency would be possible and I can see why this is desirablem. My concern is there is already a lot of competing libraries in this space and one of the reasons you might use jQuery template is that it is a plugin to jQuery.
If I was to remove jQuery as a dependency on version 2 I would have to look very long and hard at what jQuery template provides that other libraries don't. I'm obviously totally open to external input on this as many people use this, and I would like to understand why and whether removing jQuery template would still be feasible or desirable.
Thank you, I appreciate your time.
I can see why a developer might want to utilize jQuery to it's fullest extent if they happen to include it as a dependency, however I can only remark about my own experience. I only use jQuery because this is a jQuery plugin, which is a good indication of how great jQuery-Template really is. None of my code utilizes jQuery otherwise.
Frustrated, I attempted to hunt down a different template engine that did not require jQuery, while providing similar semantics and features. (JavaScripting.com)[https://www.javascripting.com/application-tools/templating] has a 31-item section for Templating. I looked for something that matched all of the following criteria:
- No special template syntax.
- No side effects from lack of template data.
- No directives for template data.
- No logic syntax embedded in HTML.
- Utilization of W3C valid HTML5
data
attributes to bind template data. - Utilization of those same attributes to dictate type and context.
- Automatic DOM template injection.
The closest thing I could find was (Transparency)[https://github.com/leonidas/transparency], however it uses static data-bind
attributes, not a suite of different data-type
attributes. It also lacks a large portion of the other criteria. It would seem to me that jQuery-Template is a special thing indeed, only rarely replicated or imitated by other libraries. That said, if you do not mind, I may fork this repository to implement the changes myself.
Of course, feel free to fork.
You make some good points. I'll be interested to see the wider opinion, but if it is seen as useful, I'm more than happy to make as a standalone library.
Having considered this, this is not something I am going to do in this version of the repository so I'm closing this issue here. It may be something I do in a different repository in future.