chjj / zest

An absurdly fast CSS selector engine.
MIT License
238 stars 14 forks source link

Add a name parametter #3

Closed CapMousse closed 13 years ago

CapMousse commented 13 years ago

Add a name parametter to change the zest object name

pyrsmk commented 13 years ago

Hi,

I wondered, why do you need this?

CapMousse commented 13 years ago

Beause if an other module is named "zest" in my project, i will have a comflict.

With this parameter, we can easily change the name wihout change the core code Le 9 nov. 2011 13:12, "Aurlien Delogu" < reply@reply.github.com> a crit :

Hi,

I wondered, why do you need this?


Reply to this email directly or view it on GitHub: https://github.com/chjj/zest/pull/3#issuecomment-2680490

pyrsmk commented 13 years ago

Shouldn't it be better to change your library scope? Or rather use the Modules spec used in many projects (ender, and nodejs?). As zest is integrated to ender, I think it's better to improve it on this point.

We should never change library name/scope into the script itself... It seems to be pretty bad practice :s

chjj commented 13 years ago

How about a compromise? I can add a .noConflict function instead.

CapMousse commented 13 years ago

chjj, yeah it will be very usefull =)

pyrsmk commented 13 years ago

(maybe it'll better to speak english, for those who read us :p)

I understand well your point of view but it's not really efficient to go into the library to change the placeholder :s I agree with @chjj's noConflict idea.

chjj commented 13 years ago

Okay, implemented: 659b1e243fb62bf21d562efc7a79cc9a25166172

I also refactored zest a bit, hopefully with some performance improvements. Caching is now enabled by default.