[Improve][UI] Reduce seatunnel-engine-ui node_modules size (~90 MB)#10973
Open
davidzollo wants to merge 1 commit into
Open
[Improve][UI] Reduce seatunnel-engine-ui node_modules size (~90 MB)#10973davidzollo wants to merge 1 commit into
davidzollo wants to merge 1 commit into
Conversation
- Remove unused direct dependency: date-fns-tz (not imported anywhere) - Replace date-fns parse() with native Date parsing in detail.tsx, removing the 36 MB date-fns package as a direct dependency - Replace @vicons/ionicons5 (33 MB, 2672 files) with four inline SVG components in src/components/icons/index.ts; only 4 icons were used - Replace sass-embedded with sass in devDependencies, eliminating the colorjs.io (8 MB) and rxjs (11 MB) transitive dependency chain - Move tailwindcss, postcss, autoprefixer from dependencies to devDependencies (they are build-time tools, not runtime deps) Estimated node_modules reduction: ~90 MB
Collaborator
|
+1 if ci pass |
DanielLeens
approved these changes
May 29, 2026
Contributor
DanielLeens
left a comment
There was a problem hiding this comment.
Thanks for the cleanup here. I reviewed the full current head from the actual runtime path instead of only checking package.json.
What this PR fixes
- User pain:
seatunnel-engine-uicarries more Node runtime/install weight than it needs for the code paths that are actually used. - Proposed fix: move build-only packages to
devDependencies, remove no-longer-used runtime packages, replace the sidebar icon dependency with local SVG components, and simplify the job-detail time parsing path. - One-line summary: the latest head looks coherent to me, and I do not see a source-level blocker in the UI path.
Call chain I traced
npm install
-> runtime deps only keep real runtime packages
-> build-only deps move to devDependencies
sidebar render
-> src/layouts/main/sidebar/index.tsx
-> imports local icons from src/components/icons/index.ts
-> Naive UI renders the SVG components
job detail page
-> getJobInfo(jobId)
-> res.createTime like "yyyy-MM-dd HH:mm:ss"
-> new Date(res.createTime.replace(' ', 'T'))
-> getRemainTime(...)
Findings
- I did not find any remaining direct source usage of
@vicons/ionicons5,date-fns, ordate-fns-tzin the UI code path touched by this PR. - The local icon replacement is narrow and self-contained.
- The
createTimeparsing change keeps the same local-time interpretation that the previousdate-fns parse(...)path had for this input shape.
CI status
The current Build is still red, but the failing lanes I found are backend / integration lanes such as:
unit-test (8, ubuntu-latest)all-connectors-it-5all-connectors-it-7kafka-connector-itrocketmq-connector-ittransform-v2-it-part-1
At the same time, Build SeaTunnel UI is skipped on this run. So based on the current evidence, I do not see a source-level reason to block this UI dependency cleanup itself.
Merge conclusion
Conclusion: can merge.
Must fix before merge
- No new source-level blocker from me on the latest head.
Keep an eye on
- The remaining red Build lanes above still need to be cleared at the PR level, but I do not have an additional code-path blocker to add from this diff.
Nice scope control on this one.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
The
seatunnel-engine-uimodule'snode_modulesdirectory has grown to 388 MB, with several packages either unused, miscategorised, or replaceable with lighter alternatives. This PR addresses the root causes.Changes
1. Remove unused direct dependencies
date-fns-tz(572 KB) — declared independenciesbut never imported anywhere in the source code.date-fns(36 MB) — only used for a singleparse()call indetail.tsx. Replaced with nativenew Date(str.replace(' ', 'T')), which handles theyyyy-MM-dd HH:mm:ssformat produced by the SeaTunnel backend.2. Replace
@vicons/ionicons5(33 MB) with inline SVG componentsDesktopOutline,ListOutline,PeopleOutline,PersonOutline.src/components/icons/index.tscontaining the four icons as lightweight Vue components (SVG paths copied verbatim from the original package source).sidebar/index.tsxto import from the local file.3. Replace
sass-embeddedwithsassin devDependenciessass-embeddedpulled incolorjs.io(8 MB) andrxjs(11 MB) as transitive dependencies.sasspackage (JavaScript implementation, same API) has no such transitive overhead and is fully compatible with the project's SCSS files.4. Move build-time tools to
devDependenciestailwindcss,postcss,autoprefixerwere incorrectly placed independencies(runtime). Moved todevDependencies(build-time only). This also enables future CI optimisation withnpm install --omit=dev.Estimated savings
date-fns+date-fns-tz@vicons/ionicons5sassvssass-embeddedchainVerification
npm install— clean install succeeds ✓npm run build-only— Vite production build succeeds with 3,151 modules transformed ✓