Live data from Hacker News

Visual Studio Code 1.7 overloaded npmjs.org, release reverted

code.visualstudio.com

81–90 of 94 posts

Re: Visual Studio Code 1.7 overloaded npmjs.org, release reverted

#81
post #13

I'd just like to say on behalf of npm that Microsoft's handling of this incident was A+. As soon as we alerted them to the issue they were all hands on deck and did a rollback. We've been really pleased that Microsoft chose to put their @types packages into the npm registry rather than a separate, closed system, and in general happy with Microsoft's support of node and npm. We're confident we can make the new feature…

Awesome for sharing your thoughts. Don't mind the children here. You could give them gold and they would moan about the purity.

Re: Visual Studio Code 1.7 overloaded npmjs.org, release reverted

#82
post #22

Earlier quoted context omitted.

A VSCode person can (and probably will) answer in more detail, but at heart it's simple: if you want to add type-checking goodness to a library that isn't itself written in TypeScript, you can create a thing called a declaration file: https://github.com/DefinitelyTyped/DefinitelyTyped Microsoft publishes a list of known good declaration files for popular npm packages to npm, under the scope @types: https://www.npmjs.…

Can they publish a package that contains a list of all their other packages under @types?

This is the tentative fix, though we'll be looking all-up at ways to reduce the load generated by VS Code from this feature.

Re: Visual Studio Code 1.7 overloaded npmjs.org, release reverted

#83
post #22

Earlier quoted context omitted.

A VSCode person can (and probably will) answer in more detail, but at heart it's simple: if you want to add type-checking goodness to a library that isn't itself written in TypeScript, you can create a thing called a declaration file: https://github.com/DefinitelyTyped/DefinitelyTyped Microsoft publishes a list of known good declaration files for popular npm packages to npm, under the scope @types: https://www.npmjs.…

Can they publish a package that contains a list of all their other packages under @types?

[deleted]

Re: Visual Studio Code 1.7 overloaded npmjs.org, release reverted

#84
post #22

Earlier quoted context omitted.

Can you elaborate on what the issue is and how you want it to be fixed? Is it just something like rate-limiting requests or something more fundamental? Edit: Answered at https://news.ycombinator.com/item?id=12861118

A VSCode person can (and probably will) answer in more detail, but at heart it's simple: if you want to add type-checking goodness to a library that isn't itself written in TypeScript, you can create a thing called a declaration file: https://github.com/DefinitelyTyped/DefinitelyTyped Microsoft publishes a list of known good declaration files for popular npm packages to npm, under the scope @types: https://www.npmjs.…

[deleted]

Re: Visual Studio Code 1.7 overloaded npmjs.org, release reverted

#85
post #22

Earlier quoted context omitted.

Can you elaborate on what the issue is and how you want it to be fixed? Is it just something like rate-limiting requests or something more fundamental? Edit: Answered at https://news.ycombinator.com/item?id=12861118

A VSCode person can (and probably will) answer in more detail, but at heart it's simple: if you want to add type-checking goodness to a library that isn't itself written in TypeScript, you can create a thing called a declaration file: https://github.com/DefinitelyTyped/DefinitelyTyped Microsoft publishes a list of known good declaration files for popular npm packages to npm, under the scope @types: https://www.npmjs.…

If there's only 5000 types, why don't you just keep a catalog file? Then it's a single hit.

Re: Visual Studio Code 1.7 overloaded npmjs.org, release reverted

#86

I'd love to use VSCode but can't until they or someone else rolls out a dockblockr extension that works for php as I'm mostly tied to Laravel right now, and my company requires docblocks and they are not fun to write by hand.

https://github.com/jsdoc3/jsdoc maybe?

http://usejsdoc.org/about-getting-started.html

Re: Visual Studio Code 1.7 overloaded npmjs.org, release reverted

#87
post #22

Earlier quoted context omitted.

A VSCode person can (and probably will) answer in more detail, but at heart it's simple: if you want to add type-checking goodness to a library that isn't itself written in TypeScript, you can create a thing called a declaration file: https://github.com/DefinitelyTyped/DefinitelyTyped Microsoft publishes a list of known good declaration files for popular npm packages to npm, under the scope @types: https://www.npmjs.…

> At the moment there are few enough that they could fetch a list of all of them and cache it (the public registry lacks a documented API for doing that right now, but we can certainly provide one) Might I suggest having a bloom filter containing all the existing type declaration (which would be quite small) and only querying the registry if the bloom filter reports the type declaration as a positive. Since the filte…

Is there an efficient diff algorithm for bloom filters?

Re: Visual Studio Code 1.7 overloaded npmjs.org, release reverted

#88
post #72
post #22

Earlier quoted context omitted.

A VSCode person can (and probably will) answer in more detail, but at heart it's simple: if you want to add type-checking goodness to a library that isn't itself written in TypeScript, you can create a thing called a declaration file: https://github.com/DefinitelyTyped/DefinitelyTyped Microsoft publishes a list of known good declaration files for popular npm packages to npm, under the scope @types: https://www.npmjs.…

Most CDN's are able to invalidate a cache entry, so caching a 404 and busting it when it's not going to be a 404 anymore seems like it'd work?

Yeah, you're right. It was a simple oversight that we hadn't been caching 404s already, since we already have infrastructure in place to bust cache on publishes. It would have been our next step if necessary (it wasn't necessary to mitigate this flood).

You optimize for the use patterns you anticipate or see in normal usage, because, well, see famous saying about premature optimization. The use pattern we see most often is people installing from pre-determined lists in package.json, so 404s aren't all that common ordinarily.

Re: Visual Studio Code 1.7 overloaded npmjs.org, release reverted

#89
post #87

Earlier quoted context omitted.

> At the moment there are few enough that they could fetch a list of all of them and cache it (the public registry lacks a documented API for doing that right now, but we can certainly provide one) Might I suggest having a bloom filter containing all the existing type declaration (which would be quite small) and only querying the registry if the bloom filter reports the type declaration as a positive. Since the filte…

Is there an efficient diff algorithm for bloom filters?

Depends on the bloom filter, but for the fixed size, fixed hash functions, and other implementations in the same general vein, it would just be XOR of both of the bloom filters. Anything that comes out true is missing from what would be the combined filter. Slightly different for counting filters, where something along the lines of subtraction would get you what you need (anything non-zero is different).

Re: Visual Studio Code 1.7 overloaded npmjs.org, release reverted

#90
post #76

Earlier quoted context omitted.

More efficiently handling 404s, which as many have pointed out we were handling quite naïvely.

Right, but I'm curious what exactly the issue was (on a technical level), and how you've mitigated it. This might be useful knowledge for other people building similar things, to avoid making the same mistakes :)

Check out my detailed answer a few comments down: https://news.ycombinator.com/item?id=12861180
Post reply on HN