Skip to content

Commit 98852dc

Browse files
core(maintenance) (#1654)
* bump `bun` version * migrate `tsup` to `tsdown` * up storybook * up storybook vite * up packages * run format * Shrink bundle size (#1653) * shrink bundle size: - use `oxc-parser` for AST parsing - remove previous AST related packages - remove unused packages - update some packages * add tests for `compound-components` transformer * use oxc-parser types * infer types * move `removeReactImport` to it's own file, add tests * dedupe tests * enhance `addToConfig` to inline/multiline detection and indentation * infer types * classnames -> twMerge * remove redundant type cast * fix typecheck * up packages * fix(plugin~modernjs): use new plugin API * fix build * add changesets * Enhance compound-components transformer to support import alias preservation and improved import handling - add tests for new functionality including import sorting and alias retention
1 parent d2f2666 commit 98852dc

39 files changed

+4010
-1979
lines changed

.changeset/khaki-rooms-film.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
"flowbite-react": patch
3+
---
4+
5+
Shrink final bundle size from `42 MB` to `8.38 MB`
6+
7+
### Changes
8+
9+
- [x] drop AST parsers in favor of `oxc-parser`
10+
- [x] update packages
11+
- [x] update `plugin/modernjs` to the new API
12+
13+
### before
14+
15+
<img width="310" height="186" alt="Screenshot 2026-02-05 at 12 02 11" src="https://github.com/user-attachments/assets/8990817f-3f71-45c4-9c0d-fdd8258c74dc" />
16+
17+
### after
18+
19+
<img width="316" height="188" alt="Screenshot 2026-02-05 at 12 02 03" src="https://github.com/user-attachments/assets/5bf94a07-d73f-43b7-8460-114505a3bbb5" />

.changeset/social-papayas-ring.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
"create-flowbite-react": patch
3+
---
4+
5+
Change bundler to `tsdown`
6+
7+
### Changes
8+
9+
- [x] migrate `tsup` to `tsdown`

.github/actions/setup/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ runs:
77
- name: Setup Bun
88
uses: oven-sh/setup-bun@v2
99
with:
10-
bun-version: 1.3.1
10+
bun-version: 1.3.8
1111

1212
- name: Setup Node
1313
uses: actions/setup-node@v4

apps/storybook/package.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,24 +19,24 @@
1919
"react-icons": "5.2.1"
2020
},
2121
"devDependencies": {
22-
"@storybook/addon-docs": "10.0.2",
23-
"@storybook/addon-links": "10.0.2",
24-
"@storybook/addon-themes": "10.0.2",
25-
"@storybook/react-vite": "10.0.2",
22+
"@storybook/addon-docs": "10.2.4",
23+
"@storybook/addon-links": "10.2.4",
24+
"@storybook/addon-themes": "10.2.4",
25+
"@storybook/react-vite": "10.2.4",
2626
"@types/react": "18.3.3",
2727
"@types/react-dom": "18.3.0",
2828
"@typescript-eslint/eslint-plugin": "8.19.1",
2929
"@typescript-eslint/parser": "8.19.1",
3030
"@vitejs/plugin-react": "4.3.4",
31-
"autoprefixer": "10.4.20",
31+
"autoprefixer": "10.4.24",
3232
"eslint-plugin-react": "7.37.3",
3333
"eslint-plugin-react-refresh": "0.4.16",
34-
"eslint-plugin-storybook": "10.0.2",
34+
"eslint-plugin-storybook": "10.2.3",
3535
"eslint-plugin-vitest": "0.5.4",
36-
"postcss": "8.4.49",
37-
"storybook": "10.0.2",
36+
"postcss": "8.5.6",
37+
"storybook": "10.2.3",
3838
"tailwindcss": "3.4.17",
3939
"typescript": "5.6.3",
40-
"vite": "6.0.7"
40+
"vite": "7.3.1"
4141
}
4242
}

apps/web/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"@types/prismjs": "1.26.5",
3131
"@types/react": "18.3.11",
3232
"@types/react-dom": "18.3.1",
33-
"autoprefixer": "10.4.20",
33+
"autoprefixer": "10.4.24",
3434
"eslint-config-next": "14.2.15",
3535
"markdown-toc": "1.2.0",
3636
"next": "14.2.15",

bun.lock

Lines changed: 1184 additions & 1279 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -30,20 +30,20 @@
3030
"version": "changeset version"
3131
},
3232
"devDependencies": {
33-
"@changesets/changelog-github": "0.5.1",
34-
"@changesets/cli": "2.29.7",
33+
"@changesets/changelog-github": "0.5.2",
34+
"@changesets/cli": "2.29.8",
3535
"@ianvs/prettier-plugin-sort-imports": "4.7.0",
36-
"@types/bun": "1.3.1",
37-
"@types/web": "0.0.283",
36+
"@types/bun": "1.3.8",
37+
"@types/web": "0.0.326",
3838
"clean-package": "2.2.0",
3939
"eslint": "8.57.0",
4040
"eslint-config-prettier": "9.1.0",
41-
"eslint-plugin-tailwindcss": "3.17.5",
42-
"npm-check-updates": "19.1.1",
43-
"prettier": "3.6.2",
44-
"prettier-plugin-packagejson": "2.5.19",
45-
"prettier-plugin-tailwindcss": "0.7.1",
46-
"turbo": "2.5.8"
41+
"eslint-plugin-tailwindcss": "3.18.2",
42+
"npm-check-updates": "19.3.2",
43+
"prettier": "3.8.1",
44+
"prettier-plugin-packagejson": "3.0.0",
45+
"prettier-plugin-tailwindcss": "0.7.2",
46+
"turbo": "2.8.2"
4747
},
48-
"packageManager": "[email protected].11"
48+
"packageManager": "[email protected].8"
4949
}

packages/cli/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@
3333
"dist"
3434
],
3535
"scripts": {
36-
"build": "tsup",
36+
"build": "tsdown",
3737
"clean": "git clean -xdf",
38-
"dev": "tsup --watch",
38+
"dev": "tsdown --watch",
3939
"format": "prettier . --write",
4040
"format:check": "prettier . --check",
4141
"prepack": "clean-package",
@@ -51,7 +51,7 @@
5151
"picocolors": "1.1.1"
5252
},
5353
"devDependencies": {
54-
"tsup": "8.3.5",
54+
"tsdown": "0.20.1",
5555
"typescript": "5.6.3"
5656
},
5757
"engines": {
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { defineConfig } from "tsup";
1+
import { defineConfig } from "tsdown";
22

33
export default defineConfig({
44
clean: true,
@@ -7,4 +7,5 @@ export default defineConfig({
77
minify: true,
88
target: "esnext",
99
outDir: "dist",
10+
dts: false,
1011
});

packages/ui/package.json

Lines changed: 21 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -264,28 +264,27 @@
264264
"typecheck": "tsc --noEmit"
265265
},
266266
"dependencies": {
267-
"@floating-ui/core": "1.7.3",
268-
"@floating-ui/react": "0.27.16",
267+
"@floating-ui/core": "1.7.4",
268+
"@floating-ui/react": "0.27.17",
269269
"@iarna/toml": "2.2.5",
270-
"@typescript-eslint/typescript-estree": "8.46.2",
271270
"chokidar": "4.0.3",
272-
"classnames": "2.5.1",
273-
"comment-json": "4.4.1",
274-
"debounce": "2.2.0",
271+
"comment-json": "4.5.1",
272+
"debounce": "3.0.0",
275273
"deepmerge-ts": "7.1.5",
276274
"klona": "2.0.6",
277-
"package-manager-detector": "1.5.0",
278-
"recast": "0.23.11",
279-
"tailwind-merge-v2": "npm:[email protected]",
280-
"tailwind-merge-v3": "npm:[email protected]"
275+
"magic-string": "0.30.21",
276+
"oxc-parser": "0.112.0",
277+
"package-manager-detector": "1.6.0",
278+
"tailwind-merge@2": "npm:[email protected]",
279+
"tailwind-merge@3": "npm:[email protected]"
281280
},
282281
"devDependencies": {
283282
"@farmfe/core": "1.7.11",
284-
"@modern-js/app-tools": "2.68.18",
285-
"@parcel/plugin": "2.16.0",
286-
"@rsbuild/core": "1.5.17",
287-
"@rslib/core": "0.16.1",
288-
"@rspack/core": "1.5.8",
283+
"@modern-js/app-tools": "3.0.0",
284+
"@parcel/plugin": "2.16.4",
285+
"@rsbuild/core": "1.7.3",
286+
"@rslib/core": "0.19.5",
287+
"@rspack/core": "1.7.5",
289288
"@testing-library/jest-dom": "6.9.1",
290289
"@testing-library/react": "16.3.0",
291290
"@testing-library/user-event": "14.6.1",
@@ -295,25 +294,21 @@
295294
"@typescript-eslint/parser": "8.46.2",
296295
"@vitejs/plugin-react": "4.3.4",
297296
"@vitest/coverage-v8": "2.1.8",
298-
"acorn": "8.15.0",
299-
"ast-types": "0.14.2",
300-
"autoprefixer": "10.4.21",
301-
"esbuild": "0.25.11",
297+
"autoprefixer": "10.4.24",
298+
"esbuild": "0.27.2",
302299
"eslint-plugin-react": "7.37.5",
303300
"eslint-plugin-vitest": "0.5.4",
304-
"estree-walker": "3.0.3",
305301
"jsdom": "25.0.1",
306-
"minimatch": "10.0.3",
307-
"next": "16.0.7",
302+
"next": "16.1.6",
308303
"react-icons": "5.5.0",
309-
"rolldown": "1.0.0-beta.45",
310-
"rollup": "4.52.5",
304+
"rolldown": "1.0.0-rc.3",
305+
"rollup": "4.57.1",
311306
"rollup-plugin-esbuild": "6.2.1",
312307
"rollup-plugin-use-client": "1.4.0",
313308
"typescript": "5.6.3",
314-
"vite": "7.1.12",
309+
"vite": "7.3.1",
315310
"vitest": "2.1.8",
316-
"webpack": "5.102.1"
311+
"webpack": "5.105.0"
317312
},
318313
"peerDependencies": {
319314
"react": "^18 || ^19",

0 commit comments

Comments
 (0)