8000 feature #111 [LiveComponent] Adding rollup to make an esm build (weav… · symfony/ux@58e6427 · GitHub
[go: up one dir, main page]

Skip to content

Commit 58e6427

Browse files
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 build
2 parents e239983 + 10929f4 commit 58e6427

16 files changed

+1969
-1928
lines changed

src/LiveComponent/assets/babel.config.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@
66
"targets": {
77
"node": "current",
88
"ie": "11"
9-
},
10-
"useBuiltIns": "entry",
11-
"corejs": "3.14.0"
9+
}
1210
}
1311
]
1412
],
13+
"exclude": "node_modules/**",
1514
"plugins": [
16-
"@babel/plugin-proposal-class-properties"
15+
"@babel/plugin-proposal-class-properties",
16+
"@babel/plugin-transform-runtime"
1717
]
1818
}

src/LiveComponent/assets/dist/directives_parser.js

Lines changed: 0 additions & 228 deletions
This file was deleted.

src/LiveComponent/assets/dist/http_data_helper.js

Lines changed: 0 additions & 125 deletions
This file was deleted.

0 commit comments

Comments
 (0)
0