Wait... what!?
ES module syntax (ESM) is JavaScript's latest native module system. Officially ratified in 2015, its import
/ export
syntax is more compact, more easily analyzed and more reliably optimized. This all results in smaller, faster JavaScript on the web.
Unfortunately, most sites still generate a single "oldest browser" bundle, which means that every user (even the majority using modern browsers) get over-compiled JavaScript bundles that don't support ESM.
Pika is working to build better tools and services that make modern, ESM-focused JavaScript more accessible to package authors and application developers.
How does ESM make my website 90% faster?
ESM introduces something new to JavaScript and the way the web works: every JavaScript module can now be indexed and cached in a way that is universally accessible. That means that any site can push new changes and a user's browser will only fetch the files that have changed. No more bundling dependencies with source code. No more single-line changes blowing out your applications entire cached bundle.
I'm still not understanding this 90% number...
Okay, so here's why this matter: An average of 90% of website code comes from open source packages and other third parties. Pika is building a world where third-party libraries can be loaded, cached, and shared across sites. Browsers shouldn't need to re-download the same open source libraries (React, Lodash, jQuery) over and over for every site that uses them.
With ESM and cross-origin caching, we can create a world where sites can share cached dependencies. You could visit a site for the first time and already have all of its third-party dependencies cached in your browser, ready to run, cached from visits to other sites.
What about ${POSSIBLE_ISSUE}?
There's still plenty to work out here before this becomes a reality. For example, how can browsers introduce enough cushion and entropy into the browser cache to mitigate cross-origin cache fingerprinting? What about web packaging to support sharing code from multiple origins? Is treeshaking still a thing? Is the security story solid?
We're still a few years away from the endgame, but the implications for web performance are massive. You can join us today as we start to explore and build out this new world of JavaScript.