3 ms·
I assume crawlers have improved since this was written, but: If the content is only visible when executing JS, then an archive crawler which does not execute J
by ben_w 6y ago
I assume crawlers have improved since this was written, but:
If the content is only visible when executing JS, then an archive crawler which does not execute JS will not archive it, and a search engine crawler will not index it.
Another thing I may be out of date with: do people still link to 3rd party copies of JavaScript libraries? Because the left-pad npm package being deleted caused a lot of problems, and that kind of drift is inevitable over a decade.
- JoshTriplett 6y ago> do people still link to 3rd party copies of JavaScript libraries? Sadly yes. Occasionally, sites use Subresource Integrity (SRI, https://caniuse.com/subresource-integrity https://caniuse.com/subresource-integrity) hashes to ensure the scripts are identical to what they expect. But it still surprises me to see secure, sensitive sites loading third-party scripts.
- colejohnson66 6y agoWebpack is supposed to solve the inevitable “left-pad 2.0” problem. The downside is that each website serves their own copy of the libraries defeating cross domain caching (which browsers are starting to prevent anyways). It also requires setting up a build system. The upside of Webpack is that it does “tree shaking” which removes code that is never touched which makes the browser have to download less. Tradeoffs...
- ratww 6y agoActually Webpack has nothing to do with the left-pad issue, and it predates it. The original left-pad problem was due to it being deleted from NPM itself. It wasn't a package served by a CDN like jQuery. Its deletion from NPM prevented people from starting new projects or re-fetching dependencies, not websites from working. And the issue of CDNs being offline or deleting packages can be solved by vendoring dependencies, which is possible without Webpack and was already the common practice for more than a decade before using CDNs for dependencies became super popular.
- colejohnson66 6y agoRight, my bad! I forgot that left-pad wasn’t a CDN issue, but a removal from npm... I think the big problem with JavaScript isn’t necessarily npm, but JavaScript’s abysmally small standard library that leads to situations like left-pad. Including left-pad into your project is easier than searching how to do something that JS’ stdlib doesn’t have. That doesn’t mean there aren’t dumb packages like `is-array`[0] that are nothing more than `Array.isArray` with a polyfill[1] for those working with Chrome 4 or earlier. Even IE9 has `Array.isArray` according to MDN![2] And that package somehow had 59,000 downloads this past week?! [0]: https://www.npmjs.com/package/is-array https://www.npmjs.com/package/is-array [1]: https://github.com/retrofox/is-array/blob/master/index.js https://github.com/retrofox/is-array/blob/master/index.js [2]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/isArray https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...