4 ms·
Sugar: A JavaScript library for working with native objects
- secoif 12y agoThis tool is absolutely amazing and a great idea… but has a big caveat: you can't sandbox it because it extends prototypes, so unfortunately it's entirely 100% unusable in node because it breaks module encapsulation. Node allows multiple versions of the same package to exist simultaneously, so if one package depends on sugar@1.0.0 and another on sugar@1.5.0, the version that is used to extend the prototypes is entirely determined at run-time – and could even change at run-time.
- l_andrew_l 12y agoThis is absolutely true and not only node but also with modern client-side package management such as Bower, etc. The next version of Sugar is going to address this issue.
- nobullet 12y agoLooks similar to Prototype library. But the same mistake: extending the prototype :)
- l_andrew_l 12y agoIt's actually a lot more complicated than this. Prototype's big mistake was extending host objects and the Object prototype specifically, not prototypes in general. http://sugarjs.com/native http://sugarjs.com/native