In short and in plain language
Many shops load code for very old browsers. This code is called a polyfill. It rebuilds things that old browsers cannot do. New browsers do not need it.
Baseline shows what all big browsers can do. After 30 months, a new feature counts as widely spread. Then you usually need no stand-in code.
First you find the target in your own build. Then you set a new target. After that you measure how much code goes away.
The data of your own visitors matters most. It is in your own measuring tool or in the server log. Old browsers still get a way back.
We check your shop and remove the old code. We plan the change for the time after Black Week.
Many shops send every visitor code for browsers that hardly anyone still uses: polyfills that rebuild missing features, and rewritten syntax that translates modern language features into older forms. According to the Web Almanac, 67 percent of the mobile pages recorded by the HTTP Archive ship this kind of legacy JavaScript (Web Almanac 2024). Baseline now offers a clear yardstick for which features run in all common browsers, and build tools are switching their defaults to it right now. This article shows how to find the browser target of your own build, set a Baseline target, measure the overhead and base the decision on your visitor data instead of gut feeling. Nothing changes for Black Week itself: the rebuild belongs in the quieter weeks afterwards, but the data for it is being collected right now.
Key takeaways
- A web feature counts as widely available once 30 months have passed since it became supported in Chrome, Edge, Firefox and Safari (web.dev). For such features a build usually needs neither a polyfill nor a syntax transform.
- 67 percent of recorded mobile pages ship transformed or unnecessary legacy JavaScript (Web Almanac 2024). The overhead costs transfer as well as parse and compile time on the main thread.
- Without a setting of your own, Browserslist falls back to the
defaultsquery, which selects by usage share and version age (Browserslist). The effective target lives in.browserslistrc,package.jsonor the bundler, separately for each theme and plugin build. - The Lighthouse Legacy JavaScript check fails as soon as more than 5 KiB of polyfills or transforms for widely available features are found (Chrome for Developers). Transfer and script evaluation are measured before and after.
- The Baseline target follows your own visitor data from monitoring or server logs. Features outside the target get a feature query and a polyfill that loads only in browsers that lack the feature.
- Black Week delivers a large number of visits as a data basis. Analysis and the switch happen afterwards, with checkout tests in the core browsers, not during peak trading.
What Baseline says about browsers
Baseline summarizes how well individual web platform features are supported across browsers: HTML elements, CSS properties, JavaScript methods and APIs. The Chrome team started the classification, and today it is defined by the WebDX Community Group (web.dev). What counts are the core browsers Chrome, Edge, Firefox and Safari (web.dev). MDN lists desktop and mobile separately: Safari on iOS and macOS, Chrome and Firefox each on Android and desktop, and Edge on desktop (MDN).
The classification has two stages (web.dev). A feature is Newly available as soon as all core browsers support it; it is then considered interoperable. It becomes Widely available once 30 months have passed since that date (web.dev). MDN describes the same threshold as a consistent history of support in each Baseline browser for at least 2.5 years (MDN). Anything not yet running in all core browsers has Limited availability and sits outside Baseline.
For your build, the second stage is the interesting one. Newly available only means that the current stable version of each core browser knows the feature. Older versions still in circulation may not be able to run it. Only after the 30-month window has passed is a feature considered established enough that most sites can use it without worrying about support (web.dev). That threshold is exactly where fallback code in the bundle becomes unnecessary.
Baseline is not a test, though. MDN explicitly points out that the classification may not tell you whether a feature works with older devices and browser releases, in operating system web views that apps embed, or with assistive technology such as screen readers (MDN). For a shop this means: Baseline tells you which features are available in principle, but it does not replace testing on your customers' devices. We describe how that looks in our article on speed on weak hardware.
Where the overhead in the bundle comes from
Two things bloat code for older browsers. A polyfill is code, usually JavaScript, that provides modern functionality on older browsers that do not support it natively (MDN). A transform, by contrast, rewrites syntax: async/await or JavaScript classes turn into longer code in an older form. The build decides both based on the browser target. The older the target, the more polyfills and rewrites end up in the bundle, and they go to every visitor, including those whose browser can do everything itself.
The Web Almanac shows how common this is: 67 percent of mobile pages in the HTTP Archive data set ship JavaScript that is transformed or contains unnecessary legacy parts, and on desktop it is 70 percent (Web Almanac 2024). The polyfill library core-js appears on 41 percent of mobile pages (Web Almanac 2024), often as a companion of a transpiler. The median mobile page loaded 558 KB of JavaScript in 2024 (Web Almanac 2024). How much of that is fallback code differs from shop to shop and can only be measured on your own bundle.
The costs show up in several places. Polyfills are JavaScript and burden the page like any other script: they can block rendering and create long tasks on the main thread through extra parsing and compiling (web.dev). They can hurt accessibility if they do not implement the emulated feature exactly to spec, for example in the accessibility tree (web.dev). And some features cannot be fully rebuilt at all. web.dev cites the container queries polyfill, which relies on ResizeObserver; its callbacks run just before the next frame and lengthen the presentation delay that feeds into Interaction to Next Paint (web.dev).
Typical sources of fallback code in shops and content systems are:
- Global polyfill bundles that patch in everything the browser target requires at startup, whether or not the page uses the feature at all.
- Transpiled syntax from your own build when the target still includes browsers without modern language features.
- Prebuilt files from extensions that their author compiled for an old target. Your own browser target does not change them.
- Duplicate polyfills when the theme and several plugins each patch in the same feature themselves.
- Fallback code for CSS, such as prefixes or scripts for layout features that have long run in all core browsers.
How to set and hold a fixed size limit for scripts is covered in our article on JavaScript budgets. Here we focus on the part of the budget you can often win back without changing a single feature.
Finding the browser target of your own build
Before you can change a target, you need to know which one applies today. In many JavaScript projects it lives in the Browserslist configuration format, which transpilers, CSS post-processing and linters read together (web.dev). The lookup runs in this order: a .browserslistrc file, the browserslist key in package.json, a file named browserslist and the BROWSERSLIST environment variable (Browserslist). If none of them exists, the default > 0.5%, last 2 versions, Firefox ESR, not dead applies (Browserslist).
This default selects by global usage share and version numbers, not by features. The not dead part excludes browsers without official support or updates for 24 months (Browserslist). In between, the list can contain versions that lack many modern features, and it is precisely for them that the transpiler adds fallback code that every other visitor downloads too.
Tools are switching their defaults right now. Browserslist understands Baseline queries directly (web.dev). The build tool Vite changed its default from 'modules' to 'baseline-widely-available' with version 7 (Vite), announced in June 2025 (Vite). The minimum Safari version rose from 14.0 to 16.0 in the process (Vite). A project that has not been updated since may still build with the old target. And if you have updated, check whether a setting of your own in the configuration overrides the new default.
Shops and content systems rarely have just one build. The core, the theme and every extension bring their own JavaScript, and only part of it comes out of your build process. For the inventory, a list of all scripts that a product page loads, each with origin and target, pays off:
- Theme build: Browserslist setting or target in the theme's bundler configuration.
- Extension builds: a separate
package.jsonin the plugin, or prebuilt files with someone else's target. - Core of the shop system or CMS: the vendor's target, usually not configurable.
- External scripts: the provider's target, which you can only influence through selection and load timing.
- CSS build: prefixes and fallback rules follow the same browser target as the JavaScript.
External scripts follow their own rules, which we describe under trimming third-party scripts. For Shopware and WordPress installations the list is especially worthwhile, because theme and extensions are usually built separately there; how we speed up such installations overall is covered under Shopware performance and WordPress performance.
Setting a Baseline target
A Baseline target describes the feature set your code may assume without fallbacks. web.dev distinguishes moving targets from fixed targets (web.dev). Moving targets such as “widely available” grow over time: every feature whose 30-month window ends is added automatically. Fixed targets such as “Baseline 2023”, by contrast, contain exactly the features that became newly available in that year and stay unchanged (web.dev). They are predictable, but they age and should be reviewed regularly.
{
"browserslist": [
"baseline widely available with downstream"
]
}In Browserslist, baseline widely available stands for the moving target and baseline 2024 for a fixed year; years can be given from 2015 up to the current year (web.dev). The suffix with downstream adds browsers that are built on the same foundation as Chrome and Edge and should therefore support the same feature set (web.dev). For a shop this suffix usually makes sense, because visits do not come only from the core browsers.
Which target fits depends on the business. Chrome for Developers calls widely available a suggested default for new web projects (Chrome for Developers). web.dev notes that ecommerce and B2B websites may be willing to live with a lower support threshold and handle issues as users report them, whereas government websites may require a high threshold (web.dev). Even a target that is more than five years old likely lets you adopt features you are not using today, or are using only with polyfills you do not need (web.dev).
| Target | Contains | Fits when | Watch out for |
|---|---|---|---|
Default defaults | browsers by global usage share and version age | no target has ever been chosen deliberately | can pull in old versions and lots of fallback code |
baseline widely available | all features that have run in all core browsers for 30 months | visitor data shows no notable group of old devices | moves along, re-measure every new build |
baseline 2022 or older | a fixed year that does not change | many visits come from older tablets or managed company devices | re-evaluate regularly, or overhead stays behind |
baseline newly available | everything the current core browsers support | closed user groups with up-to-date equipment | usually too tight for public shops |
Timeline: when a feature no longer needs a polyfill
The data of the web-features project, which the Baseline classification comes from, shows how the moving target works. Object.groupBy() and Map.groupBy() group lists without a helper library. They became newly available on March 5, 2024 (web-features) and widely available on September 5, 2026 (web-features). A build targeting baseline widely available may assume both methods without a polyfill since then, provided the Baseline data in the project is current.
CSS followed the same pattern. The :has() selector became newly available on December 19, 2023 and widely available on June 19, 2026 (web-features). Container queries got there earlier: newly available on February 14, 2023, widely available on August 14, 2025 (web-features). Scripts that rebuild container queries are therefore unnecessary for this target, along with the extra presentation delay they can cause.
Conversely, the calendar shows what is not there yet. The new set methods of Set, such as union() and intersection(), have been newly available since June 11, 2024 (web-features). Under the 30-month rule they only become widely available in December 2026 (web-features). If you use them today, you still need a fallback for older browsers.
Current data is part of the target
Measuring polyfills and legacy bundles
Whether a switch pays off is decided by measuring your own bundle. A first indication comes from the Lighthouse “Legacy JavaScript” check: it reports polyfills and transforms for features that are widely available according to Baseline, and it fails when more than 5 KiB of them are found (Chrome for Developers). According to the Web Almanac, the check looks for transforms that may be unnecessary on the modern web, such as those for async/await and JavaScript classes (Web Almanac 2024). In our Lighthouse audit this point is a fixed part of the review.
It only becomes reliable in a direct comparison of two builds. This is how we proceed:
- Create two builds: the same code once with the previous target and once with the Baseline target, otherwise unchanged.
- Compare transfer size: compressed and uncompressed size of each script, split by your own code, extensions and external providers.
- Measure script evaluation: time for parsing, compiling and executing in the Performance panel, on a throttled mid-range device instead of the developer machine.
- Compare long tasks and Total Blocking Time in the lab, then watch INP in the field.
- Check functionality: click through checkout, filters and forms in the core browsers and on older devices from your own visitor list.
Our article on live metrics in the browser shows how to read the values directly in DevTools. To keep the gain, the bundle size belongs in a budget in CI after the switch, measured on every change.
An older way to serve both worlds is two bundles: a modern one with type="module" and a legacy bundle with the nomodule attribute, which browsers with module support do not execute (MDN). Across the web this is rare: the module attribute appears on 4 percent of pages, and nomodule shows close to zero adoption (Web Almanac 2024). The dual path doubles builds and tests and helps little if the modern bundle itself is built with an old target. A carefully chosen Baseline target is usually the simpler lever.
Visitor data instead of gut feeling
The target should come from your own data, not from the assumption that your customers use old devices. web.dev recommends deriving the Baseline threshold primarily from the data of your own website (web.dev). If you collect field data yourself, you can assign a browser and version to every visit. Without your own monitoring, the same information sits in the server logs: the User-Agent header names the application, operating system and version of the browser (MDN).
Two details matter. Chrome now reduces its User-Agent string: the major version shows correctly, while the minor version numbers appear as 0.0.0 (MDN). The major version is enough for mapping to Baseline. In addition, on some devices the browser version is tied to the operating system, as with Safari on the iPhone; anyone who can no longer update the system stays on the old version until the device is replaced (web.dev). Exactly this group shows up in the data as a long tail of old versions.
For mapping versions to Baseline years there is an open table that is updated daily as a JSON and CSV file (web.dev). It lists the supported year for each browser version and whether the version covers the widely available features; versions released before July 2015 appear there as pre_baseline (web.dev). With this table and a log extract you can count which share of visits meets which target. Filter out bots and monitoring services first, or they will count as visitors. How your own field data and public data complement each other is covered in RUM vs. CrUX compared.
For context: across many websites, 98 percent or more of users support the Baseline years within the widely available window (web.dev). That is an overall picture from cross-site field data, not a statement about your customers. A B2B shop with managed company computers may do better, a shop with many older tablets worse.
Black Week as a measurement period
Fallback through progressive enhancement
A Baseline target does not mean older browsers are left out. Progressive enhancement provides a baseline of essential content and functionality to as many users as possible and delivers the full experience only where the browser can run the required code (MDN). For features outside the target, web.dev suggests sorting them into three groups (web.dev):
- Enhancement: if the feature is missing, the user usually notices nothing. One example is the
fetchpriorityattribute. A polyfill is very likely unnecessary here (web.dev). - Additive: if the feature is missing, the page looks different or a detail is gone without anything breaking, as with newer color functions such as relative color syntax. web.dev leans against polyfills here, especially when many are already in use (web.dev).
- Critical: if the feature is missing, the page or a flow breaks. Then the choice is between a polyfill and a different workaround (web.dev).
Feature queries are the technical tool for this. In CSS, @supports defines rules that only apply when the browser supports a feature (MDN). In JavaScript, a simple check tests whether a method exists, for example union() from the new Set methods. If it is missing, a small module loads the polyfill, only in that browser. web.dev points out that polyfills without such conditional loading pass extra bytes on to all users (web.dev).
// Load the polyfill only when the method is missing
if (!('union' in Set.prototype)) {
await import('./polyfills/set-methods.js');
}
// then use it the same way in every browser
const allIds = cartIds.union(wishlistIds);The fallback needs its own test
Step by step to a lean build
- Record all scripts on a product, listing and checkout page, with origin and browser target.
- Analyze visitor data from recent months and map the browser versions to Baseline years.
- Set the target, usually
baseline widely available with downstream, and document it with a rationale. - Switch your own builds and replace global polyfill bundles with conditional loading.
- Identify extensions with prebuilt legacy code and ask the vendor for a current version or replace them.
- Measure before and after: transfer size, script evaluation, Total Blocking Time in the lab and INP in the field.
- Test the checkout in the core browsers and on the oldest relevant devices, then ship.
- Store the budget and target in CI and update the Baseline data regularly.
In many shops the rebuild is manageable if it happens outside peak season. The effort lies less in changing one configuration line than in the inventory and the tests. And it pays off repeatedly: every month more features cross the 30-month threshold (web.dev), and every build with current data gets a little leaner.
How we support the switch
In our frontend optimization, the switch starts with an inventory: we read the browser targets of the builds, as far as they can be determined, including those of the theme and extensions, and measure how much polyfill and transform code actually arrives on the important templates. We analyze visitor data from your own monitoring or your server logs, without adding external services. The result is a target proposal with a rationale, which we implement, test and back up with measurements before and after the switch.
If you first want to know where your shop stands, start with a technical analysis. Besides legacy code, it shows whether other items such as unused CSS or missing code splitting would bring more. That way the budget goes where it does the most for the Core Web Vitals of your shop.
Sources
<script>, @supports, User-Agent); HTTP Archive Web Almanac 2024 (JavaScript chapter); Chrome for Developers (Legacy JavaScript); Browserslist (project documentation); Vite (Vite 7.0 announcement); web-features (Baseline data of the WebDX Community Group).with downstream (web.dev)..browserslistrc file or under the browserslist key in package.json (Browserslist). If both are missing, a default based on usage share and version age applies. Theme, extensions and core can have their own targets, so it pays to look at each build separately.Related Articles
Images in the browser: what WordPress 7.1 changes on upload
WordPress 7.1 resizes and encodes images in the browser during upload. What that changes for files, formats, GIFs and server load, and how to measure it.
Fluctuating Response Time: When Your Server Shares CPU
Response time swings with no change to your shop? Shared CPU time may be the cause. How to measure steal time, run the counter-checks and choose a remedy.
CPU Tier in the Browser: Lighten Shops on Low-End Devices
Chrome 152 reports a device performance tier via the CPU Performance API. See how shops serve lighter profiles to weak phones and verify INP in the field.