Note: This piece was originally published to pika.dev.
The year is 1941. Your name is Richard Hubbell. You work at an experimental New York televi...
For further actions, you may consider blocking this person and/or reporting abuse
I can’t get about got the pika logo 😄
Check out our list of examples for how to set up an app or even a PWA: github.com/pikapkg/web/blob/master...
@pika/web is not a server, so you'll need a static file server for local development. Something like npmjs.com/package/serve with live reload configured.
Hey !
First, this is a great article.
Bundler should not be required for webdev :)
I really think Compression is a big deal.
Splitting file to file will increase runtime caching but will destroy Gzip or Brotli power.
For sure, it all comes down to a balance between the caching improvements that you get, the total downloaded efficiency that you get (no downloading code you don't need), and the compression efficiency of that first download.
One of my favorite things about this strategy is that it's great when you're just starting out and performance isn't your immediate concern. No need to wrestle with a ton of tools just to get a prototype or demo or simple site out there. And then, when you are ready to optimize for production users, you're free to add a bundler to your toolkit if that's what you'd prefer.
Great first post. I had heard of pika, but didn't realize how it worked. Looking forward to your next post!
Does having "1300 dependencies for Hello World" mean that this will create 1300 dependencies that have to be reloaded with a js file each?
Not necessarily, the point was more towards how complex the "starter" Create React App build pipeline. Most of those are Node-only packages specifically for building your app.
FYI... react-script is not the npm name of Create React App.
I there anyone who has managed to replace webpack/webpacker in a Rails app with pika? If so, please share.
Pika works with any server, you would just need to install your web_modules directory to somewhere that Rails would serve it to the browser (
app/assets/web_modules
?) and then just write your JS imports to point to their final location when served.We have a few examples here: github.com/pikapkg/web/blob/master...
If you do get it working with Rails, would love if you could add it there!
But rollup still needed because pika use that as dependencies 😋
Totally! I get to touch on that more in this talk: youtu.be/2Wwx-lF5NhE?t=711
If you don't have time to watch, the tl;dr is that we get to move bundling complexity away from the app (where it's no longer needed) and down to only the dependencies. It's not an attempt to get rid of bundling, but more to refocus it for 2019 on bundling's original purpose: