Closed WickyNilliams closed 5 years ago
This is a breaking change, which simplifies the external API and the internals.
The external API has changed in the following way.
Before:
import Headroom from "headroom.js"; var hr = new Headroom(element, options); hr.init(); hr.destroy();
After:
import headroom from "headroom.js"; var hr = headroom(element, options); hr.destroy();
Dropping usage of classes has resulted in ~20% file size saving before gzip, and ~10% after gzip.
┌───────────────────────────────────────┐ │ │ │ Destination: dist/headroom.min.js │ │ Bundle Size: 4.26 KB │ │ Gzipped Size: 1.37 KB │ │ Brotli size: 1.32 KB │ │ │ └───────────────────────────────────────┘
┌───────────────────────────────────────┐ │ │ │ Destination: dist/headroom.min.js │ │ Bundle Size: 3.45 KB │ │ Gzipped Size: 1.22 KB │ │ Brotli size: 1.2 KB │ │ │ └───────────────────────────────────────┘
This is a breaking change, which simplifies the external API and the internals.
The external API has changed in the following way.
Before:
After:
Dropping usage of classes has resulted in ~20% file size saving before gzip, and ~10% after gzip.
Before:
After: