Commit 58e6427
committed
feature #111 [LiveComponent] Adding rollup to make an esm build (weaverryan)
This PR was squashed before being merged into the main branch.
Discussion
----------
[LiveComponent] Adding rollup to make an esm build
| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | no
| Tickets | Addresses `Bug A` from #102
| License | MIT
Hi!
This changes how LiveComponent is bundle. There are a few important pieces:
1) I decided to continue support IE 11. The difference in the unminified file size (including polyfills) is about 5kg (56kb vs 61kb).
2) I'm building ESM only right now. I have considered a UMD build... but I don't know if there is a real use-case. In practice, this library will always be used in a build system... but I cannot find any other libraries that only output ESM.
3) This sets `babelHelpers` to `runtime`, which means that instead of embedding the babel helpers (like `_typeof` https://github.com/symfony/ux/blob/e239983ef55805224df7eef4fe7eff089c70b7cd/src/LiveComponent/assets/dist/live_controller.js#L3) in every file, they all import from ``@babel`/runtime`.
4) We're testing the `src/` files, not the `dist/` files.
I don't have a lot of experience with compiling files for the frontend - and there seems to be a lot of variability on how to do it. If you see anything weird, let me know :).
Cheers!
Commits
-------
10929f4 [LiveComponent] Adding rollup to make an esm buildFile tree
16 files changed
+1969
-1928
lines changed- src/LiveComponent
- assets
- dist
- src
- test
16 files changed
+1969
-1928
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
10 | | - | |
11 | | - | |
| 9 | + | |
12 | 10 | | |
13 | 11 | | |
14 | 12 | | |
| 13 | + | |
15 | 14 | | |
16 | | - | |
| 15 | + | |
| 16 | + | |
17 | 17 | | |
18 | 18 | | |
This file was deleted.
This file was deleted.
0 commit comments