TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Pika CDN – A CDN for Modern JavaScript

222 pointsby vvoyeralmost 6 years ago

27 comments

devalnoralmost 6 years ago
Very nice service but how do you manage the CDN subresource integrity (SRI) if the packages are different for each individual user?<p>It&#x27;s possible to check subresource with es6 module but only if you know the signature first.(<a href="https:&#x2F;&#x2F;stackoverflow.com&#x2F;questions&#x2F;45804660&#x2F;is-it-possible-to-use-subresource-integrity-with-es6-module-imports" rel="nofollow">https:&#x2F;&#x2F;stackoverflow.com&#x2F;questions&#x2F;45804660&#x2F;is-it-possible-...</a>).<p>Even Webpack will not handle it with webpack-subresource-integrity (<a href="https:&#x2F;&#x2F;www.npmjs.com&#x2F;package&#x2F;webpack-subresource-integrity" rel="nofollow">https:&#x2F;&#x2F;www.npmjs.com&#x2F;package&#x2F;webpack-subresource-integrity</a>)<p>Of course HTTPS is strong but not a foolproof solution against man-in-the-middle attack.
评论 #20174296 未加载
评论 #20174234 未加载
no_wizardalmost 6 years ago
My company would buy into this if there were some kind of boilerplate contract you sold to a business&#x2F;institution vs the Patreon page you have right now.<p>Just FYI, you&#x27;re missing out on some dollars because of that. For better or worse, the bean counters at my work place won&#x27;t approve anything less. I have a feeling I&#x27;m not alone.<p>If you can quickly whip up some boilerplate business checkout with an invoice, you&#x27;d make more than a few dollars today.
评论 #20176499 未加载
mrspeakeralmost 6 years ago
This is fantastic - exactly what I&#x27;ve been looking for but didn&#x27;t know I was looking for it! I&#x27;ve been re-importing libraries by doing something weird like: `import &#x27;.&#x2F;three.js&#x27;; export default window.Three;` so I can use it as a normal module.<p>I love not having to use build tools for my personal projects anymore - everything feels so light and &quot;old school&quot;. Here&#x27;s my Minecraft-ish clone in native modules and WebGL2: <a href="https:&#x2F;&#x2F;github.com&#x2F;mrspeaker&#x2F;webgl2-voxels" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;mrspeaker&#x2F;webgl2-voxels</a>. No dot files, nothin&#x27; to build... just view source!
评论 #20177826 未加载
评论 #20177012 未加载
tthiskalmost 6 years ago
This is very good development for frontend development. Build systems like webpack were useful technology in earlier days. But they are presenting a big hurdle for newer less experienced developers to enter the frontend development space today. I would love to see a future where we can again run a webserver from a folder to serve a frontend in development.<p>I do wonder how modular css fits into the picture of es modules though.
评论 #20173940 未加载
评论 #20173984 未加载
评论 #20175525 未加载
youngtaffalmost 6 years ago
If you&#x27;ve got a site with decent levels of traffic host libraries yourself rather than use a JS CDN.<p>Retrieving critical content from a 3rd-party CDN has a number of issues:<p>- New TCP connection has to be created with added cost of TLS negotiation and it&#x27;s own slow-start phase<p>- If you&#x27;re using HTTP&#x2F;2 then prioritisation only occurs over a single connection so it can&#x27;t be prioritised against other content
评论 #20177851 未加载
评论 #20179237 未加载
unilynxalmost 6 years ago
`curl -i <a href="https:&#x2F;&#x2F;cdn.pika.dev&#x2F;preact`" rel="nofollow">https:&#x2F;&#x2F;cdn.pika.dev&#x2F;preact`</a> redirects me to a dist-es2019 package (I assume because it detects my user-agent supporting that) but isn&#x27;t showing anything like a `Vary: User-Agent` header.<p>Won&#x27;t this break for any situation in which users with different browsers share a proxy server?<p>(also tried with Chrome, didn&#x27;t see a Vary there either)
评论 #20179121 未加载
bufferoverflowalmost 6 years ago
So how is that different from any other CDN?<p>CDNJS is actually orders of magnitude more likely to have a cache hit than this new offering.
评论 #20173348 未加载
评论 #20173070 未加载
santialboalmost 6 years ago
Does it inspect your code for potentially needed polyfills or do you need to specify a list of polyfillable features that you have used?
评论 #20176736 未加载
raxxorraxalmost 6 years ago
The differential serving sounds like a neat idea. Naturally, everyone not using the newest version of Firefox or Safari will go to hell eventually, but until then it could really improve the web for a lot of people.
anderspitmanalmost 6 years ago
This is way cool. I recently started a new app and decided to see how far I could get without a build tool. My early impressions left me wanting to write a blog post &quot;ES Modules Make JavaScript Fun Again.&quot; The whole development cycle felt clean and simple. Ultimately though I got hung up on dependencies. For a while I was just including things directly from node_modules&#x2F;. But npm flattens things so that library location is not predictable (this crops up when en ES module dependency tries to look in its own node_modules&#x2F; directory for another ES module dependency, but that dependency has actually been flattened to the top level). So you&#x27;re basically stuck downloading all your dependencies (and their dependencies) manually. This isn&#x27;t 100% a bad thing. It pushes you to use smaller dependencies with fewer sub-dependencies. You&#x27;re also stuck using libraries that export an ES module. Pika could be just the ticket to bridge these gaps.
cjblomqvistalmost 6 years ago
How many bytes are typically spent on compatibility with older browsers? Have anyone made any research into this?
评论 #20173474 未加载
olleracalmost 6 years ago
This wouldn&#x27;t work with a standard React project though, right? Because you still need to transpile JSX. You could use the development version of React, I guess, which is slower, but can understand JSX, but that&#x27;s not something you want to ship.<p>I&#x27;d love to use something like this for teaching, tutorials, and even small projects, but there&#x27;s some things I still need a transpiler for.<p>I also realize I could use the `htm` package instead of JSX, which gives a lot of benefits over JSX, including not requiring transpiling, but, since it&#x27;s not widely used by the wider ecosystem, I&#x27;d be a little hesitant to include it in my projects.
评论 #20186731 未加载
ktpsnsalmost 6 years ago
<a href="https:&#x2F;&#x2F;www.pika.dev&#x2F;search?q=jquery" rel="nofollow">https:&#x2F;&#x2F;www.pika.dev&#x2F;search?q=jquery</a> -- so jQuery is not &quot;modern&quot; any more? That&#x27;s quite surprising, giving for instance the dependency of the <a href="http:&#x2F;&#x2F;semantic-ui.com&#x2F;" rel="nofollow">http:&#x2F;&#x2F;semantic-ui.com&#x2F;</a> framework on jQuery (<a href="https:&#x2F;&#x2F;github.com&#x2F;Semantic-Org&#x2F;Semantic-UI&#x2F;issues&#x2F;1175" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;Semantic-Org&#x2F;Semantic-UI&#x2F;issues&#x2F;1175</a>)
评论 #20175385 未加载
评论 #20175539 未加载
评论 #20175366 未加载
mferalmost 6 years ago
What is the business model? Where does the money come to pay for the dev and hosting? This is the question I&#x27;m left with.<p>Nothing is free and I didn&#x27;t find this in crunchbase.<p>Something is paying for it. Is it tracking people and selling it?
评论 #20175537 未加载
评论 #20175298 未加载
评论 #20179180 未加载
playpausealmost 6 years ago
Looks great, but I think the homepage should do more to convince me that I can trust it. Who runs it, how is it funded, is there any guarantee they won&#x27;t run out of money and shut down, etc.
zimbatmalmost 6 years ago
Can anyone explain how the differential serving works?<p>I get that they might have a User-Agent mapping to features. But how do they know which feature are needed by the loaded modules?
评论 #20174303 未加载
neilvalmost 6 years ago
Pika CDN seems to facilitate user tracking by the CDN better than the current JS CDNs can (with simple browser privacy features that browsers should be doing already).<p>Also, wasn&#x27;t clear to me whether they support SRI or an equivalent supported by the browser. If they don&#x27;t, it could also be a centralized vulnerability for user-targeted injection.<p>(Solution: the best sites will pay to serve their own JS.)
codezeroalmost 6 years ago
I suggest you register all the bit-flipped domains. This is a must for all CDNs, given the ability to serve malicious JS from a bitflipped domain.
wcdolphinalmost 6 years ago
I love the idea of a more efficient CDN for JS (and code overall!), but it isn’t clear to me how this handles the multitude of versions. None of the examples seem to include versioning, which is a huge oversight IMO. A future I see is IPFS for this sort of thing. All objects identified uniquely, but cacheable by multiple entities.
评论 #20175938 未加载
z3t4almost 6 years ago
I built a repo like this but for require (commonjs), where package dependencies was sent along the first request using http2. Only problem was that browsers didnt cache the preloaded files and re-requestsed them. Hopefully browsers will fix this or latency will be a huge problem with several layers deep dependencies.
indigochillalmost 6 years ago
Just a comment on the name: as a Python dev when I saw Pika I immediately thought the RabbitMQ Python package: <a href="https:&#x2F;&#x2F;pypi.org&#x2F;project&#x2F;pika&#x2F;" rel="nofollow">https:&#x2F;&#x2F;pypi.org&#x2F;project&#x2F;pika&#x2F;</a><p>May or may not be an issue for this project. Just bringing it up for visibility.
评论 #20174186 未加载
评论 #20175109 未加载
itsbitsalmost 6 years ago
When I mention url like that in import, will bundlers like Webpack automatically downloads the js modules?
评论 #20173205 未加载
评论 #20173310 未加载
评论 #20173211 未加载
skybrianalmost 6 years ago
There&#x27;s a reference to the &quot;browser&#x27;s shared module cache&quot;. Anyone know what that is?
symlinkkalmost 6 years ago
Their example doesn&#x27;t work for me - it&#x27;s just blank. Looks like CORS issues?<p><a href="https:&#x2F;&#x2F;pika-cdn-example.glitch.me&#x2F;" rel="nofollow">https:&#x2F;&#x2F;pika-cdn-example.glitch.me&#x2F;</a>
Something1234almost 6 years ago
Isn&#x27;t pika where you&#x27;re eating things you&#x27;re not supposed to? So by using this cdn your computer is eating things it&#x27;s not supposed to?
snugalmost 6 years ago
It would be great to make the packages immutable, doesn&#x27;t allow the maintainer of the package to change code on the website, malicious or not.
tzfldalmost 6 years ago
If I would be Google, I would create a service like this, and would slowly inject tracking code in every package served.
评论 #20175897 未加载
评论 #20175920 未加载