Dusty hardware deserves nice things too. Spackle adds newer JavaScript features to older devices and WebViews, with less work for their CPUs and garbage collectors.
A polyfill adds a JavaScript feature an older browser is missing. Many polyfill libraries route calls through shared helpers, which can be slow. Spackle keeps each polyfill self-contained to reduce work and temporary allocations on older engines.
on 2015-era Chromium, up to
Front-end stress test on Chromium 41, 64 MB heap, one CPU core. How we measured
A core-js alternative for the APIs Spackle supports. Current release: 0.1.0-alpha.9. Still alpha, so check what's covered first.
Install it
npm install @shim-works/spackle
Import Spackle before anything else, at your app's entry point
import '@shim-works/spackle';
import App from './App';
Tell your bundler to stop adding core-js
// babel.config.js
['@babel/preset-env', {
targets: { chrome: '38', safari: '7.1' },
useBuiltIns: false,
}]
Using SWC or Vite? The README has those.
24 Chromium WebViews from 41–150, Safari 7.1–10, and a real app on a 2017 LG TV. The numbers and raw data are all in the paper.
1,357 JS compliance tests run in the actual WebViews · methods and raw results in the paper