chore: Next.js + CLI example
Added a Next.js example that uses the CLI for compilation.
NOTE: Because of some strange NPM issues, the Next build fails with some strange errors. The CLI is not the root cause and the previous Next example has fallen into this before.
So, for now, this PR is not intended to be merged. It's primarily a test to ensure that the CLI does work for a Next.js app.
compressed-size: runtime library
Size change: 0.00 kB Total size: 2.52 kB
View unchanged
| Filename: gzip (minify) | kB size | kB change | % change |
|---|---|---|---|
./packages/stylex/lib/stylex.js |
1.04 (3.22) | 0.00 (0.00) | 0.0% (0.0%) |
./packages/stylex/lib/StyleXSheet.js |
1.48 (3.75) | 0.00 (0.00) | 0.0% (0.0%) |
compressed-size: e2e bundles
Size change: 0.00 kB Total size: 1128.74 kB
View unchanged
| Filename: gzip (minify) | kB size | kB change | % change |
|---|---|---|---|
./apps/rollup-example/.build/bundle.js |
1005.32 (10185.35) | 0.00 (0.00) | 0.0% (0.0%) |
./apps/rollup-example/.build/stylex.css |
123.42 (774.34) | 0.00 (0.00) | 0.0% (0.0%) |
workflow: benchmarks/size
Comparison of minified (terser) and compressed (brotli) size results, measured in bytes. Smaller is better.
@stylexjs/[email protected] size:compare ./size-compare.js /tmp/tmp.Fky0mPnlBa /tmp/tmp.MYzGpQUK6I
| Results | Base | Patch | Ratio | |
|---|---|---|---|---|
| stylex/lib/stylex.js | ||||
| · compressed | 729 | 729 | 1.00 | |
| · minified | 2,541 | 2,541 | 1.00 | |
| stylex/lib/StyleXSheet.js | ||||
| · compressed | 1,266 | 1,266 | 1.00 | |
| · minified | 3,776 | 3,776 | 1.00 | |
| rollup-example/.build/bundle.js | ||||
| · compressed | 563,025 | 563,025 | 1.00 | |
| · minified | 10,185,368 | 10,185,368 | 1.00 | |
| rollup-example/.build/stylex.css | ||||
| · compressed | 99,154 | 99,154 | 1.00 | |
| · minified | 745,649 | 745,649 | 1.00 |
abandoning this for now in favour of showing the Postcss plugin.