Coder Social home page Coder Social logo

Remove jQuery dependency about jquery-zencoding HOT 5 OPEN

zodoz avatar zodoz commented on May 5, 2024
Remove jQuery dependency

from jquery-zencoding.

Comments (5)

zodoz avatar zodoz commented on May 5, 2024

I would have to think about this for a bit. I originally decided to use jQuery as a way for me to abstract away the creation of the HTML elements, and I know that jQuery will continually be updated for newer(/est) versions of HTML, thus requiring fewer code changes/updates for this project.

However, having said that, I am aware that I do not use very much of the jQuery library and it would be worth the time to investigate just what that percentage is and what would be required to remove this dependency. For now, however I am working on version 2.0 which will include many significant changes (I refer you to the wiki for more details), the most significant of which is a PEG via pegjs which will make this a fully fledged language rather than my (probably error prone) regular expression parsing. But I will be happy to consider this after version 2.0. Also, feel free to make revisions to that document to suggest any other new ideas you may have.

As a side note: I think that this templating language may be general enough to be XML rather than specifically HTML. If this ends up being true and worth pursuing, then I will definitely be removing the jQuery dependency at that time. The only down side(s) that I can think of with doing that at the moment is that it will/may remove the &data and ~event capabilities.

from jquery-zencoding.

dizzib avatar dizzib commented on May 5, 2024

I agree, the fact that $.zen sits on jQuery suggests the following code would return a jQuery object rather than just plain html:

$.zen('#foo')

...so I find myself having to wrap it using a second $ which looks and feels cumbersome:

$($.zen('#foo'))

Perhaps ZenCoding might sit well as a standalone AMD module, so example 2 above could become:

$(ZenCoding.html('#foo'))

Cheers!

from jquery-zencoding.

zodoz avatar zodoz commented on May 5, 2024

Hmm... I think I like the idea behind AMD, but this is the first time I've seen AMD I'm not sure how it will integrate in the direction I'm currently bringing this project. Therefore I have marked this thread as a "New Feature" and will explore it more once I have brought my upgrade a bit further.

Also, I seem to not be pushing my updates as often as I used too, this is intentional: Making a PEG for this language is proving more finicky than I first anticipated, and I'd rather not push things too early. So instead, I'm working on it on my local machine until I have a general working prototype and then I'll push it up to github.

I intend to also be creating a new wiki page within the next few days for how I feel the general use-case(s) for version 2.0 will be and the direction I'm trying to take. I hope you all will be able to review this and provide further feedback.

from jquery-zencoding.

forest-devil avatar forest-devil commented on May 5, 2024

+1 to this, we should first focus on how to fast templating, then consider the extras like ~event and &data. Also I don't think including !js! in templates is a good idea, it makes debugging trickier

from jquery-zencoding.

forest-devil avatar forest-devil commented on May 5, 2024

suppose we can borrow some ideas form sprintf.js http://www.diveintojavascript.com/projects/javascript-sprintf

from jquery-zencoding.

Related Issues (9)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.