element-plus icon indicating copy to clipboard operation
element-plus copied to clipboard

refactor: buildProps

Open makedopamine opened this issue 9 months ago • 7 comments

This PR brings the following:

  • as const is no longer needed when calling buildProps
  • Stricter type checking for the props parameter of buildProps. Have a look at this test case for details.
  • Simplify the return type of buildProps, which improves type hints in IDEs. Check out tooltip.vue.d.ts before and after to get a rough sense of what’s changed.
  • Upgrade esbuild to support const modifier for type parameters.

makedopamine avatar Mar 20 '25 16:03 makedopamine

github-actions[bot] avatar Mar 20 '25 16:03 github-actions[bot]

Open in Stackblitz

npm i https://pkg.pr.new/element-plus/element-plus@20211

commit: 6cea66f

pkg-pr-new[bot] avatar Mar 20 '25 17:03 pkg-pr-new[bot]

Size Change: +87.7 kB (+6.07%) 🔍

Total Size: 1.53 MB

Filename Size Change
./dist/element-plus/dist/index.full.js 452 kB +43.6 kB (+10.66%) ⚠️
./dist/element-plus/dist/index.full.min.js 299 kB +814 B (+0.27%)
./dist/element-plus/dist/index.full.min.mjs 294 kB +773 B (+0.26%)
./dist/element-plus/dist/index.full.mjs 443 kB +42.5 kB (+10.62%) ⚠️
ℹ️ View Unchanged
Filename Size
./dist/element-plus/dist/index.css 45.4 kB

compressed-size-action

github-actions[bot] avatar Mar 20 '25 17:03 github-actions[bot]

🧪 Playground Preview: https://element-plus.run/?pr=20211 Please comment the example via this playground if needed.

github-actions[bot] avatar Mar 20 '25 17:03 github-actions[bot]

Why did the result of the building increase by 40+k? 🤔

btea avatar Apr 04 '25 01:04 btea

Basically because esbuild changed how it preserves line breaks and comments when minification isn’t enabled. Please have a look at the diff of index.full.js.

makedopamine avatar Apr 09 '25 11:04 makedopamine

There is a code conflict.

btea avatar Apr 21 '25 23:04 btea