-
Notifications
You must be signed in to change notification settings - Fork 331
feat: [select]reduce common package size #2577
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| import { customDesignConfig } from './index' | ||
| import { twMerge } from 'tailwind-merge' | ||
| export * from './index' | ||
| // 动态注入twMerge,保证本地联调 | ||
| customDesignConfig.twMerge = twMerge |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,9 @@ | ||
| import { customDesignConfig } from '@opentiny/vue-common' | ||
|
|
||
| import { twMerge } from 'tailwind-merge' | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Codebase verification Based on the gathered information, I can now provide a final response: Reconsider the tailwind-merge implementation strategy The analysis reveals several concerns:
Recommendations:
🔗 Analysis chainConsider impact on package size when adding tailwind-merge Adding Let's analyze the impact: Consider these alternatives to minimize bundle size:
Also applies to: 9-9 Let me gather more information about how This will help us understand:
🏁 Scripts executedThe following scripts were executed for the analysis: Script: #!/bin/bash
# Check the size of tailwind-merge package
curl -s https://bundlephobia.com/api/size?package=tailwind-merge | jq '{
size: .size,
gzip: .gzip,
treeshaking: .hasJSModule,
dependencies: .dependencyCount
}'
# Check if twMerge is actually used in the codebase
rg -l "twMerge" --type ts
Length of output: 468 Script: #!/bin/bash
# Check the actual usage of twMerge in the files
for file in $(rg -l "twMerge" --type ts); do
echo "=== $file ==="
rg "twMerge" -B 2 -A 2 "$file"
done
# Check if there are any existing class merging utilities
rg -l "classNames|clsx|cls|mergeClasses" --type ts
Length of output: 4759 |
||
| import designSaasConfig from '@opentiny/vue-design-saas' | ||
|
|
||
| export * from '@opentiny/vue-common' | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Review re-export strategy Re-exporting everything from Consider replacing the wildcard export with specific exports: -export * from '@opentiny/vue-common'
+export {
+ // List only the necessary exports
+ customDesignConfig,
+ // ... other required exports
+} from '@opentiny/vue-common'
|
||
|
|
||
| // 自定义主题交互规范 | ||
| customDesignConfig.designConfig = designSaasConfig | ||
| customDesignConfig.twMerge = twMerge | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codebase verification
Update tailwind-merge to the latest version 2.5.5
The current version (1.8.0) is significantly outdated compared to the latest version (2.5.5). While no security vulnerabilities were found, it's recommended to update to benefit from the latest improvements and bug fixes.
packages/vue-saas-common/package.json:🔗 Analysis chain
Verify tailwind-merge version and security
The package uses tailwind-merge@^1.8.0. Let's ensure this version is secure and up-to-date.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
Length of output: 428