madrobby / zepto

Zepto.js is a minimalist JavaScript library for modern browsers, with a jQuery-compatible API
http://zeptojs.com
Other
15k stars 3.91k forks source link

Make Zepto version number accessible from JavaScript #1050

Closed henryruhs closed 8 years ago

henryruhs commented 9 years ago

Hello,

is it possible to get the current version of Zepto like in $.fn.jquery?

madrobby commented 9 years ago

What's the use case for that? We could add it, but if we don't need it, I'd rather avoid having the extra code to make this happen.

henryruhs commented 9 years ago

Correct, this is a "nice to have" feature but I could imagine multiple use cases.

  1. Using Bower with versioning ~1 fetches the latest stable release and I like to know the current jBone, Zepto, jQuery version my suite is running by watching a dashboard.
  2. Analyse websites with a bookmarklet that shows the used framework and related version - useful to find browser issues and understand possible Javascript issues.

Maybe we wait for more opinions but there has to be a reason jQuery provides this feature.

shalecraig commented 9 years ago

Some libraries use $.fn.jquery as differentiation between jQuery elements and DOM nodes as arguments.

mislav commented 9 years ago

I didn't want to make the version accessible from JS runtime to prevent people from relying on it, e.g. writing plugins that check the version string.

Is it an option that your tools can read the version string from the first line of zepto.js source file?

madrobby commented 8 years ago

Closing this because there was no response to our questions in a while. Feel free to reopen with the requested information!