https://github.com/samouri/preact-shakability
https://github.com/samouri/preact-shakability
Last synced: 25 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/samouri/preact-shakability
- Owner: samouri
- Created: 2021-10-27T20:22:28.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2021-10-27T20:40:46.000Z (over 4 years ago)
- Last Synced: 2025-03-21T06:45:30.027Z (about 1 year ago)
- Language: JavaScript
- Size: 3.37 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Preact tree shakability
Given an esm import from `preact/compat`, it would be ideal if everything unneeded could be DCEd away.
For example, given this simple input, I am seeing a much larger output than expected.
```js
import { forwardRef } from 'preact/compat';
```
In order to test this, I copy/pasted the functions used for [forwardRef](https://github.com/preactjs/preact/blob/master/compat/src/forwardRef.js) and measured the bundle size against the former.
## Results
- [current](./current/bundled.js): 15K
- [isolated](./isolated/bundled.js): 8.6K