Commit 3103307
committed
minor #2944 Modernize and simplify our packages building tools, replace Rollup by tsup (Kocal)
This PR was squashed before being merged into the 2.x branch.
Discussion
----------
Modernize and simplify our packages building tools, replace Rollup by tsup
| Q | A
| ------------- | ---
| Bug fix? | no
| New feature? | yes <!-- please update src/**/CHANGELOG.md files -->
| Docs? | yes <!-- required for new features -->
| Issues | Fix #... <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead -->
| License | MIT
Following #2935. Same goals, but less frictions than with tsdown, [tsup](https://github.com/egoist/tsup):
- `target` is correctly read from our `tsconfig.packages.json`
- no `//#region` comments
- less polyfills than oxc
- the `target` **stays** `es2021` without any issues with `static` and Stimulus
Two things:
1. About the `react-dom/client` import, yes it will impact AssetMapper users that don't use Flex, but it will positively impact other users (AssetMapper with Flex, Webpack Encore...) by removing useless code and making the file smaller
2. About the tons of `.d.ts` files removed, that's still fine, there is no point to generate `dist/<file>.d.ts` files when `dist/<file>.js` do not exist, they are not part of the public API.
The code review must be easier, since less code has been touched than with tsdown.
---
# Demo
When building LiveComponent assets:
```
➜ assets git:(tsup) pnpm build
> `@symfony`/[email protected] build /Users/kocal/workspace-os/symfony-ux/src/LiveComponent/assets
> tsx ../../../bin/build_package.ts .
CLI Building entry: src/live.css, src/live_controller.ts
CLI Using tsconfig: ../../../tsconfig.packages.json
CLI tsup v8.5.0
CLI Target: es2021
CLI Cleaning output folder
ESM Build start
[Symfony UX] Minified CSS file: /Users/kocal/workspace-os/symfony-ux/src/LiveComponent/assets/dist/live.css
[Symfony UX] Renamed dist/live.css to dist/live.min.css
ESM dist/live_controller.js 12.25 KB
ESM dist/live.css 74.00 B
ESM ⚡️ Build success in 26ms
DTS Build start
DTS ⚡️ Build success in 1276ms
DTS dist/live_controller.d.ts 7.96 KB
```
When watching LiveComponent assets, the CSS is easily watched too!
https://github.com/user-attachments/assets/a246f278-8bf4-40f6-887e-685be7509af0
Commits
-------
78fa229 Rebuild packages with tsup
897aaa8 Modernize and simplify our packages building tools, replace Rollup by tsupFile tree
102 files changed
+6464
-6381
lines changed- bin
- src
- Autocomplete/assets/dist
- Chartjs/assets/dist
- Cropperjs/assets/dist
- Dropzone/assets/dist
- LazyImage/assets/dist
- LiveComponent/assets/dist
- Backend
- Component
- plugins
- Directive
- Rendering
- Util
- Map
- assets/dist
- src/Bridge
- Google/assets/dist
- Leaflet/assets/dist
- Notify/assets/dist
- React
- assets/dist
- StimulusBundle/assets/dist
- Svelte/assets/dist
- Swup/assets/dist
- TogglePassword/assets/dist
- Translator/assets
- dist
- formatters
- src
- test
- Turbo/assets/dist
- Typed/assets/dist
- Vue/assets/dist
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
102 files changed
+6464
-6381
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
9 | | - | |
10 | 8 | | |
11 | | - | |
| 9 | + | |
| 10 | + | |
12 | 11 | | |
13 | 12 | | |
14 | 13 | | |
| |||
34 | 33 | | |
35 | 34 | | |
36 | 35 | | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
41 | 39 | | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
61 | 46 | | |
62 | 47 | | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
67 | 58 | | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | 59 | | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
104 | 64 | | |
105 | 65 | | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
128 | 132 | | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
| 133 | + | |
| 134 | + | |
148 | 135 | | |
149 | 136 | | |
150 | 137 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | 17 | | |
21 | 18 | | |
22 | 19 | | |
23 | 20 | | |
| 21 | + | |
24 | 22 | | |
25 | | - | |
26 | 23 | | |
| 24 | + | |
27 | 25 | | |
28 | 26 | | |
29 | 27 | | |
| |||
0 commit comments