adobe-webplatform / Snap.svg

The JavaScript library for modern SVG graphics.
http://snapsvg.io
Apache License 2.0
13.94k stars 1.15k forks source link

Please increment version number and republish #264

Open kristoferjoseph opened 10 years ago

kristoferjoseph commented 10 years ago

The current version on npm is 3.0, but has the old main property. It looks as though 3.0 was published multiple times. npm will not overwrite an existing version number due to security issues. Incrementing the version here: https://github.com/adobe-webplatform/Snap.svg/blob/master/package.json#L3 to 3.x would be sufficient to fix this issue.

Thanks :)

DmitryBaranovskiy commented 10 years ago

npm sux

DamonOehlman commented 10 years ago

Having a bit of a play with browserify and the master branch I can see that it might be worth waiting before doing a new npm publish. From what I can tell, the following piece of code and browserify are not playing nicely together:

var glob = {
    win: window,
    doc: window.document
};

Essentially, glob.doc ends up being undefined. Unsure of what the exact problem is but I'll try and dig into it a little...

DamonOehlman commented 10 years ago

OK, this problem comes down to the following line:

https://github.com/adobe-webplatform/Snap.svg/blob/master/dist/snap.svg.js#L434

While this works in the browser standalone, once encapsulated within the browserify prelude stuff this becomes the simulated module rather than the Window instance, which is what you were expecting it to be.