Repository navigation
Trim the UI boot bundle and fold lazy-only enum chunks into one - #34202
Conversation
The boot bundle carried code the first screen never runs: all of lodash-es (react-tour's UMD build requires "lodash", which the global alias turned into the whole lodash-es namespace), oidc-client (one value import used only by SSO Test Login), dompurify/html-react-parser/remove-markdown (StringUtils) and the analytics core (AuthProvider only needs the session helper). Lazy-only, import-free enum modules (src/generated, src/enums, *.enum.ts, *.interface.ts, types.ts) now share one `app-enums` chunk instead of one sub-1 KiB chunk each, and a build guard fails if an enum-only chunk appears again. `--mode analyze` now builds like production so the treemap matches what ships. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
❌ PR checklist incompleteThis PR cannot be merged until the following are addressed on its linked issue:
The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically. Maintainers can bypass this check by adding the |
|
| Count | Rule |
|---|---|
| 12 | react-hooks/exhaustive-deps |
| 1 | openmetadata-imports/no-api-calls-in-iteration |
| 1 | no-restricted-imports |
All findings
| Location | Rule | Message | |
|---|---|---|---|
| 🟡 | src/components/Auth/AuthProviders/AuthProvider.tsx:300:9 |
react-hooks/exhaustive-deps |
The 'onLoginHandler' function makes the dependencies of useMemo Hook (at line 954) change on every render. Move it inside the useMemo callback. Alternatively, w |
| 🟡 | src/components/Auth/AuthProviders/AuthProvider.tsx:380:6 |
react-hooks/exhaustive-deps |
React Hook useCallback has missing dependencies: 'navigate', 'setApplicationLoading', 'setCurrentUser', and 'setIsAuthenticated'. Either include them or remove |
| 🟡 | src/components/Auth/AuthProviders/AuthProvider.tsx:435:9 |
react-hooks/exhaustive-deps |
The 'resetUserDetails' function makes the dependencies of useMemo Hook (at line 954) change on every render. To fix this, wrap the definition of 'resetUserDetai |
| 🟡 | src/components/Auth/AuthProviders/AuthProvider.tsx:552:6 |
react-hooks/exhaustive-deps |
React Hook useEffect has missing dependencies: 'handleStoreProtectedRedirectPath', 'resetUserDetails', and 'setIsAuthenticated'. Either include them or remove t |
| 🟡 | src/components/Auth/AuthProviders/AuthProvider.tsx:554:9 |
react-hooks/exhaustive-deps |
The 'handleFailedLogin' function makes the dependencies of useMemo Hook (at line 954) change on every render. Move it inside the useMemo callback. Alternatively |
| 🟡 | src/components/Auth/AuthProviders/AuthProvider.tsx:610:5 |
react-hooks/exhaustive-deps |
React Hook useCallback has missing dependencies: 'authConfig?.provider', 'handledVerifiedUser', 'navigate', and 'resetUserDetails'. Either include them or remov |
| 🟡 | src/components/Auth/AuthProviders/AuthProvider.tsx:660:9 |
react-hooks/exhaustive-deps |
The 'initializeAxiosInterceptors' function makes the dependencies of useMemo Hook (at line 954) change on every render. To fix this, wrap the definition of 'ini |
| 🟡 | src/components/Auth/AuthProviders/AuthProvider.tsx:943:6 |
react-hooks/exhaustive-deps |
React Hook useEffect has a missing dependency: 'fetchAuthConfig'. Either include it or remove the dependency array. |
| 🟡 | src/components/Certification/Certification.component.tsx:129:9 |
react-hooks/exhaustive-deps |
The 'handleScroll' function makes the dependencies of useMemo Hook (at line 235) change on every render. Move it inside the useMemo callback. Alternatively, wra |
| 🟡 | src/components/Certification/Certification.component.tsx:271:6 |
react-hooks/exhaustive-deps |
React Hook useEffect has missing dependencies: 'currentCertificate' and 'getCertificationData'. Either include them or remove the dependency array. If 'setSelec |
| 🟡 | src/components/KnowledgeCenter/KnowledgeCard/KnowledgeCard.tsx:240:9 |
react-hooks/exhaustive-deps |
The 'handleToggleDelete' function makes the dependencies of useCallback Hook (at line 258) change on every render. Move it inside the useCallback callback. Alte |
| 🟡 | src/components/Topic/TopicVersion/TopicVersion.component.tsx:206:5 |
react-hooks/exhaustive-deps |
React Hook useMemo has missing dependencies: 'dataProducts', 'domains', and 't'. Either include them or remove the dependency array. |
| 🟡 | src/pages/ContextCenterPage/ContextCenterAIContextPage/ContextCenterAIContextPage.tsx:62:40 |
openmetadata-imports/no-api-calls-in-iteration |
Avoid issuing one API request per item. Fetch at the data owner, use a bulk endpoint, or use useQueries with an intentional concurrency policy. |
| 🟡 | src/utils/DataAssetsVersionHeaderUtils.tsx:17:1 |
no-restricted-imports |
'../assets/svg/external-links.svg' import is restricted from being used by a pattern. Do not import SVG icons directly from assets/ paths; use the designated ab |
Fix locally (fast - only checks files changed in this branch):
make ui-checkstyle-changed|
✅ SSO Login Nightly — PASSED View workflow run · Commit
Totals: 79 passed · 0 failed · 0 flaky · 0 skipped · duration 18m 56s |
…tringUtils #34244 changed stripMarkdown in StringUtils while this branch moved it to RichTextStringUtils. Keep the move, port the HTML block-boundary handling, and point the new DataProductDescriptionField caller at RichTextStringUtils. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
vite.config.ts now holds configuration only. The custom plugins live in vite/plugins.ts and the chunk classifier (with its module-graph helpers) in vite/chunks.ts. Build output is byte-identical. vite/** is added wherever CI lists vite.config.ts (dist cache key, visual-regression and bundle-input path filters, Playwright impact map), so a plugin change still invalidates the cache and triggers those jobs. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
#34141 removed the vendor-untitled-icons chunk group and the icon barrel rewrite from vite.config.ts; this branch had moved both into vite/chunks.ts and vite/plugins.ts, so drop them there. KnowledgeCard keeps upstream's getSafeHttpUrl (StringUtils) alongside stripMarkdown (RichTextStringUtils). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Code Review ✅ Approved 1 closed / 1 findings🟡 Medium risk · The UI bundle graph and SSO test-login configuration alter bounded runtime behavior. Trims the boot bundle by 6% (69 KiB) by removing ✅ 1 closed✅ Performance: StringUtils re-export pulls dompurify/html-parser back into boot
OptionsDisplay: compact → Counting what did not apply, without listing it. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
|
🚦 Removed from the merge queue —
|



Summary
The first page load downloaded code the first screen never runs, and the build emitted ~50 chunks that were nothing but a TS
enumobject each. This PR removes the first and prevents the second. antd is deliberately left alone; it is being removed separately.Numbers (production build, brotli)
index.html)First-view JS (boot + the page's static chunks): sign-in 997 → 946, My Data 1,118 → 1,054, Settings 1,120 → 1,062, Explore 1,630 → 1,557, Table details 2,218 → 2,134, Glossary 2,386 → 2,302, Data quality 1,896 → 1,821 KiB.
Removed from boot
oidc-client(62 KiB)getCandidateUserManagerConfig(SSO Test Login only) didnew WebStorageStateStoreinsideAuthProvider.util.tsSettingsSso/SsoTestLogin/candidateUserManagerConfig.ts;AuthProvider.util.tskeepsimport type. OIDC providers still get it with their (already lazy) authenticatoranalyticscoreAuthProviderimportsresetWebAnalyticSession, which lived next to the analytics instanceutils/WebAnalyticsSessionUtils.ts(needs only@analytics/session-utils)stringToHTML/stripMarkdown/decodeHtmlEntitiesmoved toutils/RichTextStringUtils.ts, and every caller in this repo imports them from there.StringUtilsre-exports them for now because Collate importsstripMarkdownfrom it. That keepsdompurify/html-react-parser/remove-markdownin boot (~18 KiB) until the re-export is dropped after the Collate side is checked.Enum chunks
TS enums are runtime objects, and quicktype emits 3,265 of them across 713
src/generatedfiles. An enum module shared by several lazy routes became its own sub-1 KiB chunk.classifyChunknow puts lazy-only, import-free enum modules (src/generated,src/enums,*.enum.ts,*.interface.ts,types.ts) into oneapp-enumschunk.getModuleInfo) so anything the shell imports stays out. Import-free only, because a group also captures its members' dependencies.no-enum-only-chunksplugin fails the production build and lists each offending chunk with its source file. With the grouping switched off it reports 49; with it on, 0.Also
vite build --mode analyzewas unminified and bundled React's development build (NODE_ENV="analyze"), sobundle-stats.htmlreported roughly 2× the shipped size. It now builds exactly like production.Not in this PR
An earlier revision also moved react-tour onto CJS
lodashto get lodash-es out ofmain.js. Visual regression caught Explore crashing withpy is not a function.main.jshad been initialising the whole lodash-es namespace as a side effect; without that, some lodash-es modules that Rolldown wraps in lazy init were never initialised for the routes that use them. Reverted; worth revisiting separately.Test plan
vite buildpasses on current main; enum guard passesundefined. main and this PR both have exactly 176, all the same pre-existingvendor-antdbinding. The reverted lodash change showed up to 8 extra per page, so the check catches this class of bugjest --findRelatedTestson changed files: 1,217 suites pass; re-ran the StringUtils / SsoTestLogin / Explore / Topic / KnowledgeCard suites after the follow-up commit (240 tests)🤖 Generated with Claude Code