Skip to content

chore(superset-ui-core): forward-compat fixes for TypeScript 6.0 (Phase B) - #39535

Merged
rusackas merged 4 commits into
masterfrom
ts6-migration/phase-b-superset-ui-core
Jun 30, 2026
Merged

rusackas merged 4 commits into
masterfrom
ts6-migration/phase-b-superset-ui-core

Conversation

@rusackas

@rusackas rusackas commented Apr 22, 2026 •

Copy link
Copy Markdown
Member

Part of #39539 (TypeScript 5.4 → 6.0 migration tracking issue).

SUMMARY

Part of the TypeScript 5.4.5 → 6.0 migration, split per-package so reviews stay small. This PR is scoped to packages/superset-ui-core only. All changes compile cleanly on TypeScript 5.4.5 (current CI) and eliminate the TS 6.0 errors in that package, so future upgrade PRs will have strictly fewer errors to resolve.

No runtime behaviour changes. Every fix is either a signature widening, a type-only cast at a boundary where our code is known-safe, or a stricter internal type.

What changed, and why:

  • forwardRef callbacks use ForwardedRef<T> instead of RefObject<T> (AsyncEsmComponent, DropdownContainer, ModalTrigger). TS 6.0 narrows RefObject's contract, so forwardRef's callback parameter no longer assigns to it. ForwardedRef<T> is the correct type and accepts both object refs and callback refs. ModalTrigger additionally adds a typeof ref !== 'function' guard before mutating ref.current.
  • StatefulChart: cast onRenderFailure to the shared HandlerFunction type so the stricter 6.0 inference matches the SuperChart prop shape.
  • AntdEnhanced: drop the wider IconType.component from the spread so {...rest} can no longer override the explicit <BaseIconComponent component={...}> binding. This surfaced under 6.0's stricter JSX attribute checking because IconType.component is ForwardRefExoticComponent<CustomIconComponentProps> (wider than BaseIconProps['component']), and the spread was silently overwriting the explicit attribute.
  • Select / AsyncSelect: targeted as unknown as ... casts for sorter / filter / deselect / select call sites against antd's BaseOptionType | DefaultOptionType and SelectHandler shapes. Our handlers read properties that always exist on the narrower AntdLabeledValue, so the wider antd shape is safe at runtime.
  • VirtualTable: accept width?: number from react-resize-detector's 6.0 callback signature, defaulting missing width to 0.
  • TableCollection: cast columns / rowClassName / onChange to antd's generic ColumnsType<object> and TableProps<object> variants at the JSX boundary.
  • TimezoneSelector: cast our comparator to antd's LabeledValue-based sorter signature; our comparator only reads timezoneName, which always exists on TimezoneOption.
  • connection/types: widen FetchRetryOptions' retryDelay / retryOn to accept Error | null / Response | null, matching the fetch-retry library.
  • fetchTimeRange: rename the catch variable and narrow via Parameters<typeof getClientErrorObject>[0] + an inline { statusText?: string } cast, since TS 6.0 defaults caught values to unknown.
  • lruCache: guard the Map iterator's .value before Map#delete, because TS 6.0 types IteratorResult.value as string | undefined until it's narrowed.
  • InteractiveTableUtils: initialise columnRef to null for strictPropertyInitialization.
  • types/assets.d.ts: add declare module '*.css' for side-effect CSS imports.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

N/A — type-level changes only.

TESTING INSTRUCTIONS

  • cd superset-frontend && npm run type — should pass on TS 5.4.5 (current CI).
  • Optional forward-compat check: install TypeScript 6.0.3 locally (npm install [email protected] --no-save) then run npx tsc --project packages/superset-ui-core/tsconfig.json --noEmit. Before this PR that reports 24+ errors in superset-ui-core; after this PR it reports 0.
  • Visually smoke-test the touched components in Explore / Dashboard / SQL Lab: Select / AsyncSelect (filter, deselect, sort), TimezoneSelector (report schedules), TableCollection, VirtualTable, ModalTrigger, any icon from AntdEnhanced, and StatefulChart.

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • Migration is atomic, supports rollback & is backwards-compatible
    • Confirm DB migration upgrade and downgrade tested
    • Runtime estimates and downtime expectations provided
  • Introduces new feature or API
  • Removes existing feature or API

🤖 Generated with Claude Code

@bito-code-review

bito-code-review Bot commented Apr 22, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Agent Run #e1dd2c

Actionable Suggestions - 0
Review Details
  • Files reviewed - 15 · Commit Range: 9b5d89b..9b5d89b
    • superset-frontend/packages/superset-ui-core/src/chart/components/StatefulChart.tsx
    • superset-frontend/packages/superset-ui-core/src/components/AsyncEsmComponent/index.tsx
    • superset-frontend/packages/superset-ui-core/src/components/DropdownContainer/DropdownContainer.tsx
    • superset-frontend/packages/superset-ui-core/src/components/Icons/AntdEnhanced.tsx
    • superset-frontend/packages/superset-ui-core/src/components/ModalTrigger/index.tsx
    • superset-frontend/packages/superset-ui-core/src/components/Select/AsyncSelect.tsx
    • superset-frontend/packages/superset-ui-core/src/components/Select/Select.tsx
    • superset-frontend/packages/superset-ui-core/src/components/Table/VirtualTable.tsx
    • superset-frontend/packages/superset-ui-core/src/components/Table/utils/InteractiveTableUtils.ts
    • superset-frontend/packages/superset-ui-core/src/components/TableCollection/index.tsx
    • superset-frontend/packages/superset-ui-core/src/components/TimezoneSelector/index.tsx
    • superset-frontend/packages/superset-ui-core/src/connection/types.ts
    • superset-frontend/packages/superset-ui-core/src/time-comparison/fetchTimeRange.ts
    • superset-frontend/packages/superset-ui-core/src/utils/lruCache.ts
    • superset-frontend/packages/superset-ui-core/types/assets.d.ts
  • Files skipped - 0
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful
    • Eslint (Linter) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at [email protected].

Documentation & Help

AI Code Review powered by Bito Logo

@netlify

netlify Bot commented Apr 22, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for superset-docs-preview ready!

Name Link
🔨 Latest commit 63acf3a
🔍 Latest deploy log https://app.netlify.com/projects/superset-docs-preview/deploys/6a3426a9c0088500084a76b1
😎 Deploy Preview https://deploy-preview-39535--superset-docs-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@codecov

codecov Bot commented Apr 22, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 86.95652% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 64.33%. Comparing base (74ae5a4) to head (bd26ca8).
⚠️ Report is 52 commits behind head on master.

Files with missing lines Patch % Lines
...rset-ui-core/src/components/ModalTrigger/index.tsx 83.33% 1 Missing ⚠️
...rset-ui-core/src/components/Select/AsyncSelect.tsx 80.00% 1 Missing ⚠️
...rset-ui-core/src/components/Table/VirtualTable.tsx 50.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master   #39535   +/-   ##
=======================================
  Coverage   64.33%   64.33%           
=======================================
  Files        2651     2651           
  Lines      144766   144778   +12     
  Branches    33401    33409    +8     
=======================================
+ Hits        93131    93141   +10     
- Misses      49965    49967    +2     
  Partials     1670     1670           
Flag Coverage Δ
javascript 68.49% <86.95%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@rusackas rusackas changed the title chore(superset-ui-core): forward-compat fixes for TypeScript 6.0 chore(superset-ui-core): forward-compat fixes for TypeScript 6.0 (Phase B) Apr 22, 2026
@rusackas
rusackas force-pushed the ts6-migration/phase-b-superset-ui-core branch from 9b5d89b to a2fc6cf Compare May 11, 2026 16:53

@bito-code-review bito-code-review Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review Agent Run #1665a5

Actionable Suggestions - 2
  • superset-frontend/packages/superset-ui-core/src/components/AsyncEsmComponent/index.tsx - 1
  • superset-frontend/packages/superset-ui-core/src/components/ModalTrigger/index.tsx - 1
Review Details
  • Files reviewed - 15 · Commit Range: a2fc6cf..a2fc6cf
    • superset-frontend/packages/superset-ui-core/src/chart/components/StatefulChart.tsx
    • superset-frontend/packages/superset-ui-core/src/components/AsyncEsmComponent/index.tsx
    • superset-frontend/packages/superset-ui-core/src/components/DropdownContainer/DropdownContainer.tsx
    • superset-frontend/packages/superset-ui-core/src/components/Icons/AntdEnhanced.tsx
    • superset-frontend/packages/superset-ui-core/src/components/ModalTrigger/index.tsx
    • superset-frontend/packages/superset-ui-core/src/components/Select/AsyncSelect.tsx
    • superset-frontend/packages/superset-ui-core/src/components/Select/Select.tsx
    • superset-frontend/packages/superset-ui-core/src/components/Table/VirtualTable.tsx
    • superset-frontend/packages/superset-ui-core/src/components/Table/utils/InteractiveTableUtils.ts
    • superset-frontend/packages/superset-ui-core/src/components/TableCollection/index.tsx
    • superset-frontend/packages/superset-ui-core/src/components/TimezoneSelector/index.tsx
    • superset-frontend/packages/superset-ui-core/src/connection/types.ts
    • superset-frontend/packages/superset-ui-core/src/time-comparison/fetchTimeRange.ts
    • superset-frontend/packages/superset-ui-core/src/utils/lruCache.ts
    • superset-frontend/packages/superset-ui-core/types/assets.d.ts
  • Files skipped - 0
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful
    • Eslint (Linter) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at [email protected].

Documentation & Help

AI Code Review powered by Bito Logo

@rusackas
rusackas force-pushed the ts6-migration/phase-b-superset-ui-core branch from a2fc6cf to c733d58 Compare May 11, 2026 23:58

@bito-code-review bito-code-review Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review Agent Run #e35dab

Actionable Suggestions - 1
  • superset-frontend/packages/superset-ui-core/src/components/TimezoneSelector/index.tsx - 1
Review Details
  • Files reviewed - 15 · Commit Range: c733d58..c733d58
    • superset-frontend/packages/superset-ui-core/src/chart/components/StatefulChart.tsx
    • superset-frontend/packages/superset-ui-core/src/components/AsyncEsmComponent/index.tsx
    • superset-frontend/packages/superset-ui-core/src/components/DropdownContainer/DropdownContainer.tsx
    • superset-frontend/packages/superset-ui-core/src/components/Icons/AntdEnhanced.tsx
    • superset-frontend/packages/superset-ui-core/src/components/ModalTrigger/index.tsx
    • superset-frontend/packages/superset-ui-core/src/components/Select/AsyncSelect.tsx
    • superset-frontend/packages/superset-ui-core/src/components/Select/Select.tsx
    • superset-frontend/packages/superset-ui-core/src/components/Table/VirtualTable.tsx
    • superset-frontend/packages/superset-ui-core/src/components/Table/utils/InteractiveTableUtils.ts
    • superset-frontend/packages/superset-ui-core/src/components/TableCollection/index.tsx
    • superset-frontend/packages/superset-ui-core/src/components/TimezoneSelector/index.tsx
    • superset-frontend/packages/superset-ui-core/src/connection/types.ts
    • superset-frontend/packages/superset-ui-core/src/time-comparison/fetchTimeRange.ts
    • superset-frontend/packages/superset-ui-core/src/utils/lruCache.ts
    • superset-frontend/packages/superset-ui-core/types/assets.d.ts
  • Files skipped - 0
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful
    • Eslint (Linter) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at [email protected].

Documentation & Help

AI Code Review powered by Bito Logo

rusackas pushed a commit that referenced this pull request May 19, 2026
Per @Bito's review on #39535:

- TimezoneSelector: replace direct `antd/es/select` LabeledValue import
  with the re-export from `@superset-ui/core/components` (per CLAUDE.md
  rule against direct Ant Design imports).

- ModalTrigger: handle callback refs in addition to object refs. The
  previous `if (ref && typeof ref !== 'function')` branch silently
  no-op'd whenever a parent passed a function ref, so they couldn't
  access close/open/showModal.

Not applying the AsyncEsmComponent ref-type suggestion: the existing
`@ts-expect-error` directive above the call site is the deliberate
workaround for the PropsWithoutRef incompatibility, and changing the
ref type would make that directive unused and warn.
@rusackas
rusackas force-pushed the ts6-migration/phase-b-superset-ui-core branch from c733d58 to 49dbed2 Compare May 19, 2026 05:29
@bito-code-review

bito-code-review Bot commented May 21, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Agent Run #63b5ad

Actionable Suggestions - 0
Additional Suggestions - 1
  • superset-frontend/packages/superset-ui-core/src/chart/components/StatefulChart.tsx - 1
    • Redundant type cast · Line 486-486
      Unnecessary type cast: `(error: Error) => void` is structurally compatible with `HandlerFunction` (`(...args: unknown[]) => void`). TypeScript allows this assignment without casting.
      Code suggestion
      --- superset-frontend/packages/superset-ui-core/src/chart/components/StatefulChart.tsx
      +++ superset-frontend/packages/superset-ui-core/src/chart/components/StatefulChart.tsx
       @@ -483,7 +483,7 @@
                  enableNoResults={enableNoResults}
                  noResults={NoDataComponent && <NoDataComponent />}
                  onRenderSuccess={onRenderSuccess}
      -          onRenderFailure={onRenderFailure as HandlerFunction | undefined}
      +          onRenderFailure={onRenderFailure}
                  hooks={hooks}
                />
              );
Filtered by Review Rules

Bito filtered these suggestions based on rules created automatically for your feedback. Manage rules.

  • superset-frontend/packages/superset-ui-core/src/components/Table/utils/InteractiveTableUtils.ts - 1
Review Details
  • Files reviewed - 15 · Commit Range: e90521e..49dbed2
    • superset-frontend/packages/superset-ui-core/src/chart/components/StatefulChart.tsx
    • superset-frontend/packages/superset-ui-core/src/components/AsyncEsmComponent/index.tsx
    • superset-frontend/packages/superset-ui-core/src/components/DropdownContainer/DropdownContainer.tsx
    • superset-frontend/packages/superset-ui-core/src/components/Icons/AntdEnhanced.tsx
    • superset-frontend/packages/superset-ui-core/src/components/ModalTrigger/index.tsx
    • superset-frontend/packages/superset-ui-core/src/components/Select/AsyncSelect.tsx
    • superset-frontend/packages/superset-ui-core/src/components/Select/Select.tsx
    • superset-frontend/packages/superset-ui-core/src/components/Table/VirtualTable.tsx
    • superset-frontend/packages/superset-ui-core/src/components/Table/utils/InteractiveTableUtils.ts
    • superset-frontend/packages/superset-ui-core/src/components/TableCollection/index.tsx
    • superset-frontend/packages/superset-ui-core/src/components/TimezoneSelector/index.tsx
    • superset-frontend/packages/superset-ui-core/src/connection/types.ts
    • superset-frontend/packages/superset-ui-core/src/time-comparison/fetchTimeRange.ts
    • superset-frontend/packages/superset-ui-core/src/utils/lruCache.ts
    • superset-frontend/packages/superset-ui-core/types/assets.d.ts
  • Files skipped - 0
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful
    • Eslint (Linter) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at [email protected].

Documentation & Help

AI Code Review powered by Bito Logo

rusackas pushed a commit that referenced this pull request May 27, 2026
Per @Bito's review on #39535:

- TimezoneSelector: replace direct `antd/es/select` LabeledValue import
  with the re-export from `@superset-ui/core/components` (per CLAUDE.md
  rule against direct Ant Design imports).

- ModalTrigger: handle callback refs in addition to object refs. The
  previous `if (ref && typeof ref !== 'function')` branch silently
  no-op'd whenever a parent passed a function ref, so they couldn't
  access close/open/showModal.

Not applying the AsyncEsmComponent ref-type suggestion: the existing
`@ts-expect-error` directive above the call site is the deliberate
workaround for the PropsWithoutRef incompatibility, and changing the
ref type would make that directive unused and warn.
@rusackas
rusackas force-pushed the ts6-migration/phase-b-superset-ui-core branch from 49dbed2 to 4388c65 Compare May 27, 2026 23:18

@bito-code-review bito-code-review Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review Agent Run #d7878b

Actionable Suggestions - 1
  • superset-frontend/packages/superset-ui-core/src/utils/lruCache.ts - 1
Additional Suggestions - 3
  • superset-frontend/packages/superset-ui-core/src/components/Icons/AntdEnhanced.tsx - 1
    • Unclear destructured placeholder name · Line 335-335
      The name `_ignoredComponent` is ambiguous — it does not convey that this destructuring is intentional to block a conflicting `component` prop from passing through. The underscore prefix alone does not communicate the purpose. Renaming to reflect its blocking role would improve maintainability.
      Code suggestion
      --- superset-frontend/packages/superset-ui-core/src/components/Icons/AntdEnhanced.tsx (line 335)
       335:-        component: _ignoredComponent,
       335:+        component: _componentFromProps,
  • superset-frontend/packages/superset-ui-core/src/time-comparison/fetchTimeRange.ts - 1
    • Variable name reuse in catch block · Line 109-109
      The catch block reuses the variable name `response` (line 109) after it was already used for the successful HTTP response (line 82). While the scopes don't overlap, using `caught` consistently maintains clearer semantics and avoids potential confusion during code review or debugging. The original code's bug (accessing `response.statusText` before `await getClientErrorObject`) is correctly fixed by the new logic ordering.
      Code suggestion
      --- a/superset-frontend/packages/superset-ui-core/src/time-comparison/fetchTimeRange.ts
      +++ b/superset-frontend/packages/superset-ui-core/src/time-comparison/fetchTimeRange.ts
       @@ -106,11 +106,10 @@ export const fetchTimeRange = async (
          } catch (caught) {
            // Forward-compat: TS 6.0 types caught values as `unknown`; cast to the
            // shape getClientErrorObject accepts and narrow for statusText access.
      -    const response = caught as Parameters<typeof getClientErrorObject>[0];
      -    const clientError = await getClientErrorObject(response);
      +    const clientError = await getClientErrorObject(
      +      caught as Parameters<typeof getClientErrorObject>[0],
      +    );
            return {
              error:
                clientError.message ||
                clientError.error ||
      -        (response as { statusText?: string }).statusText,
      +        (caught as { statusText?: string }).statusText,
            };
          }
        };
  • superset-frontend/packages/superset-ui-core/src/components/ModalTrigger/index.tsx - 1
    • Incomplete eslint-disable directive · Line 100-100
      The eslint-disable-line comment on line 100 lacks specificity. It should specify the exact rule(s) being suppressed (e.g., `@typescript-eslint/no-explicit-any`) rather than disabling all rules on the line. This prevents masking unrelated violations and improves maintainability.
Review Details
  • Files reviewed - 15 · Commit Range: f566ca1..4388c65
    • superset-frontend/packages/superset-ui-core/src/chart/components/StatefulChart.tsx
    • superset-frontend/packages/superset-ui-core/src/components/AsyncEsmComponent/index.tsx
    • superset-frontend/packages/superset-ui-core/src/components/DropdownContainer/DropdownContainer.tsx
    • superset-frontend/packages/superset-ui-core/src/components/Icons/AntdEnhanced.tsx
    • superset-frontend/packages/superset-ui-core/src/components/ModalTrigger/index.tsx
    • superset-frontend/packages/superset-ui-core/src/components/Select/AsyncSelect.tsx
    • superset-frontend/packages/superset-ui-core/src/components/Select/Select.tsx
    • superset-frontend/packages/superset-ui-core/src/components/Table/VirtualTable.tsx
    • superset-frontend/packages/superset-ui-core/src/components/Table/utils/InteractiveTableUtils.ts
    • superset-frontend/packages/superset-ui-core/src/components/TableCollection/index.tsx
    • superset-frontend/packages/superset-ui-core/src/components/TimezoneSelector/index.tsx
    • superset-frontend/packages/superset-ui-core/src/connection/types.ts
    • superset-frontend/packages/superset-ui-core/src/time-comparison/fetchTimeRange.ts
    • superset-frontend/packages/superset-ui-core/src/utils/lruCache.ts
    • superset-frontend/packages/superset-ui-core/types/assets.d.ts
  • Files skipped - 0
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful
    • Eslint (Linter) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at [email protected].

Documentation & Help

AI Code Review powered by Bito Logo

rusackas pushed a commit that referenced this pull request Jun 8, 2026
Per @Bito's review on #39535:

- TimezoneSelector: replace direct `antd/es/select` LabeledValue import
  with the re-export from `@superset-ui/core/components` (per CLAUDE.md
  rule against direct Ant Design imports).

- ModalTrigger: handle callback refs in addition to object refs. The
  previous `if (ref && typeof ref !== 'function')` branch silently
  no-op'd whenever a parent passed a function ref, so they couldn't
  access close/open/showModal.

Not applying the AsyncEsmComponent ref-type suggestion: the existing
`@ts-expect-error` directive above the call site is the deliberate
workaround for the PropsWithoutRef incompatibility, and changing the
ref type would make that directive unused and warn.
@rusackas
rusackas force-pushed the ts6-migration/phase-b-superset-ui-core branch from 4388c65 to cab7179 Compare June 8, 2026 14:25
@bito-code-review

bito-code-review Bot commented Jun 8, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Agent Run #3a9877

Actionable Suggestions - 0
Additional Suggestions - 4
  • superset-frontend/packages/superset-ui-core/src/components/ModalTrigger/index.tsx - 1
    • Missing callback ref test coverage · Line 60-60
      The new `ForwardedRef` type annotation is correct for `forwardRef`. However, the test suite lacks coverage for ref forwarding behavior — no test verifies that callback refs receive the expected `{ close, open, showModal }` value. Without such a test, a regression in ref handling would go undetected.
  • superset-frontend/packages/superset-ui-core/src/components/Select/AsyncSelect.tsx - 1
    • Repeated type cast pattern · Line 327-331
      The `as unknown as` type cast pattern is repeated 6 times across the file. Extracting this into a utility type or helper function would improve maintainability.
  • superset-frontend/packages/superset-ui-core/src/components/TableCollection/index.tsx - 1
    • Misleading version comment · Line 311-313
      The comment references 'TS 6.0' but this codebase uses TypeScript 5.4.5. The type mismatch exists now due to react-table vs antd Table generic differences, not a future version. Consider rewording to: '// Type widening: react-table column types differ from antd Table's ColumnsType surface.'
    • superset-frontend/packages/superset-ui-core/src/components/Select/Select.tsx - 1
      • Forward-compat type assertion · Line 213-229
        The `as unknown as` cast for `sortSelectedFirst` is intentional for antd TS 6.0 compatibility. The comment explains the rationale. Consider extracting the repeated type pattern into a shared type alias to reduce duplication.
    • Filtered by Review Rules

      Bito filtered these suggestions based on rules created automatically for your feedback. Manage rules.

      • superset-frontend/packages/superset-ui-core/src/connection/types.ts - 1
      Review Details
      • Files reviewed - 15 · Commit Range: defa5fc..cab7179
        • superset-frontend/packages/superset-ui-core/src/chart/components/StatefulChart.tsx
        • superset-frontend/packages/superset-ui-core/src/components/AsyncEsmComponent/index.tsx
        • superset-frontend/packages/superset-ui-core/src/components/DropdownContainer/DropdownContainer.tsx
        • superset-frontend/packages/superset-ui-core/src/components/Icons/AntdEnhanced.tsx
        • superset-frontend/packages/superset-ui-core/src/components/ModalTrigger/index.tsx
        • superset-frontend/packages/superset-ui-core/src/components/Select/AsyncSelect.tsx
        • superset-frontend/packages/superset-ui-core/src/components/Select/Select.tsx
        • superset-frontend/packages/superset-ui-core/src/components/Table/VirtualTable.tsx
        • superset-frontend/packages/superset-ui-core/src/components/Table/utils/InteractiveTableUtils.ts
        • superset-frontend/packages/superset-ui-core/src/components/TableCollection/index.tsx
        • superset-frontend/packages/superset-ui-core/src/components/TimezoneSelector/index.tsx
        • superset-frontend/packages/superset-ui-core/src/connection/types.ts
        • superset-frontend/packages/superset-ui-core/src/time-comparison/fetchTimeRange.ts
        • superset-frontend/packages/superset-ui-core/src/utils/lruCache.ts
        • superset-frontend/packages/superset-ui-core/types/assets.d.ts
      • Files skipped - 0
      • Tools
        • Whispers (Secret Scanner) - ✔︎ Successful
        • Detect-secrets (Secret Scanner) - ✔︎ Successful
        • Eslint (Linter) - ✔︎ Successful

      Bito Usage Guide

      Commands

      Type the following command in the pull request comment and save the comment.

      • /review - Manually triggers a full AI review.

      • /pause - Pauses automatic reviews on this pull request.

      • /resume - Resumes automatic reviews.

      • /resolve - Marks all Bito-posted review comments as resolved.

      • /abort - Cancels all in-progress reviews.

      Refer to the documentation for additional commands.

      Configuration

      This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at [email protected].

      Documentation & Help

      AI Code Review powered by Bito Logo

rusackas pushed a commit that referenced this pull request Jun 17, 2026
Per @Bito's review on #39535:

- TimezoneSelector: replace direct `antd/es/select` LabeledValue import
  with the re-export from `@superset-ui/core/components` (per CLAUDE.md
  rule against direct Ant Design imports).

- ModalTrigger: handle callback refs in addition to object refs. The
  previous `if (ref && typeof ref !== 'function')` branch silently
  no-op'd whenever a parent passed a function ref, so they couldn't
  access close/open/showModal.

Not applying the AsyncEsmComponent ref-type suggestion: the existing
`@ts-expect-error` directive above the call site is the deliberate
workaround for the PropsWithoutRef incompatibility, and changing the
ref type would make that directive unused and warn.
@rusackas
rusackas force-pushed the ts6-migration/phase-b-superset-ui-core branch from cab7179 to f89965e Compare June 17, 2026 17:52
@rusackas
rusackas requested a review from aminghadersohi June 17, 2026 20:04
@bito-code-review

bito-code-review Bot commented Jun 17, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Agent Run #f7bb7b

Actionable Suggestions - 0
Additional Suggestions - 3
  • superset-frontend/packages/superset-ui-core/src/components/TableCollection/index.tsx - 2
    • Unsafe type assertion pattern · Line 311-314
      The `as unknown as` double-assertion on `mappedColumns` silently drops type information. If antd's `ColumnsType` diverges from `mapColumns`'s output shape (e.g., missing `key`, extra fields), runtime rendering or sorting bugs will occur without TypeScript warnings.
    • Inconsistent generic widening across props · Line 327-329
      The `getRowClassName as unknown as TableProps['rowClassName']` cast widens the callback signature from `(record: Record) => string` to antd's more general callback type. This is consistent with the columns pattern but the three identical casts signal a systemic type-gap rather than isolated adjustments.
    • superset-frontend/packages/superset-ui-core/src/components/ModalTrigger/index.tsx - 1
      • Type change may break consumers · Line 59-60
        The ref type changed from `ModalTriggerRef | null` to `ForwardedRef`. While more semantically correct for the `forwardRef` API, this may require updates in external code that was typed against the old interface.
    • Review Details
      • Files reviewed - 15 · Commit Range: 45c261a..66e701a
        • superset-frontend/packages/superset-ui-core/src/chart/components/StatefulChart.tsx
        • superset-frontend/packages/superset-ui-core/src/components/AsyncEsmComponent/index.tsx
        • superset-frontend/packages/superset-ui-core/src/components/DropdownContainer/DropdownContainer.tsx
        • superset-frontend/packages/superset-ui-core/src/components/Icons/AntdEnhanced.tsx
        • superset-frontend/packages/superset-ui-core/src/components/ModalTrigger/index.tsx
        • superset-frontend/packages/superset-ui-core/src/components/Select/AsyncSelect.tsx
        • superset-frontend/packages/superset-ui-core/src/components/Select/Select.tsx
        • superset-frontend/packages/superset-ui-core/src/components/Table/VirtualTable.tsx
        • superset-frontend/packages/superset-ui-core/src/components/Table/utils/InteractiveTableUtils.ts
        • superset-frontend/packages/superset-ui-core/src/components/TableCollection/index.tsx
        • superset-frontend/packages/superset-ui-core/src/components/TimezoneSelector/index.tsx
        • superset-frontend/packages/superset-ui-core/src/connection/types.ts
        • superset-frontend/packages/superset-ui-core/src/time-comparison/fetchTimeRange.ts
        • superset-frontend/packages/superset-ui-core/src/utils/lruCache.ts
        • superset-frontend/packages/superset-ui-core/types/assets.d.ts
      • Files skipped - 0
      • Tools
        • Whispers (Secret Scanner) - ✔︎ Successful
        • Detect-secrets (Secret Scanner) - ✔︎ Successful
        • Eslint (Linter) - ✔︎ Successful

      Bito Usage Guide

      Commands

      Type the following command in the pull request comment and save the comment.

      • /review - Manually triggers a full AI review.

      • /pause - Pauses automatic reviews on this pull request.

      • /resume - Resumes automatic reviews.

      • /resolve - Marks all Bito-posted review comments as resolved.

      • /abort - Cancels all in-progress reviews.

      Refer to the documentation for additional commands.

      Configuration

      This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at [email protected].

      Documentation & Help

      AI Code Review powered by Bito Logo

@aminghadersohi aminghadersohi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

connection/types.ts:32 (error: Error | null) — The widening of `FetchRetryOptions` callbacks from `Error` to `Error | null` and `Response` to `Response | null` correctly matches `fetch-retry`'s actual call-site signature, but it is a TypeScript-breaking change for downstream consumers.

Parameter types are contravariant: a consumer who wrote:
```ts
const myDelay = (attempt: number, error: Error, response: Response) => 1000;
```
and assigned it to `FetchRetryOptions['retryDelay']` will now get a TS compile error, because `(error: Error) => ...` is not assignable to `(error: Error | null) => ...`.

Since `FetchRetryOptions` is a public export of `superset-ui-core`, this should be noted in `UPDATING.md`.

rusackas and others added 4 commits June 18, 2026 10:11
Scoped to packages/superset-ui-core. All changes compile cleanly on
TypeScript 5.4.5 (current CI) and eliminate TS 6.0 errors in this package.

Key fixes:

- forwardRef callbacks use ForwardedRef<T> instead of RefObject<T>
  (AsyncEsmComponent, DropdownContainer, ModalTrigger). ModalTrigger
  also narrows object-ref access with a typeof-function guard.
- StatefulChart: cast onRenderFailure to the shared HandlerFunction type
  so the stricter 6.0 inference matches the SuperChart prop.
- AntdEnhanced: drop the wider IconType.component from the spread so
  {...rest} can no longer override the explicit <BaseIconComponent
  component={...}> binding under 6.0's stricter JSX attribute checking.
- Select / AsyncSelect: widen antd sorter/filter/handler call-sites with
  targeted `as unknown as ...` casts against antd's BaseOptionType /
  DefaultOptionType / SelectHandler shapes. Behaviour unchanged; only
  the type boundary moves.
- VirtualTable: accept width?: number from react-resize-detector's 6.0
  callback signature, defaulting missing width to 0.
- TableCollection: cast columns / rowClassName / onChange to antd's
  generic ColumnsType<object> and TableProps<object> variants.
- TimezoneSelector: cast our comparator to antd's LabeledValue-based
  sorter signature; our comparator only reads fields that always exist
  on TimezoneOption, so the broader shape is safe at runtime.
- connection/types: widen FetchRetryOptions retryDelay/retryOn to
  accept `Error | null` / `Response | null`, matching fetch-retry.
- fetchTimeRange: rename catch variable and narrow it via the
  getClientErrorObject parameter type, handling TS 6.0's `unknown`
  default for caught values.
- lruCache: guard Map iterator .value before Map#delete (TS 6.0 types
  IteratorResult.value as `string | undefined`).
- InteractiveTableUtils: initialise columnRef to null for strict
  property initialization.
- types/assets.d.ts: add `declare module '*.css'` for CSS side-effect
  imports under 6.0's stricter module resolution.

Part of the TypeScript 5.4 -> 6.0 migration, split per-package to keep
reviews small. No runtime behaviour changes.

Co-Authored-By: Claude Opus 4.7 <[email protected]>
Per @Bito's review on #39535:

- TimezoneSelector: replace direct `antd/es/select` LabeledValue import
  with the re-export from `@superset-ui/core/components` (per CLAUDE.md
  rule against direct Ant Design imports).

- ModalTrigger: handle callback refs in addition to object refs. The
  previous `if (ref && typeof ref !== 'function')` branch silently
  no-op'd whenever a parent passed a function ref, so they couldn't
  access close/open/showModal.

Not applying the AsyncEsmComponent ref-type suggestion: the existing
`@ts-expect-error` directive above the call site is the deliberate
workaround for the PropsWithoutRef incompatibility, and changing the
ref type would make that directive unused and warn.
@rusackas
rusackas force-pushed the ts6-migration/phase-b-superset-ui-core branch from 63acf3a to bd26ca8 Compare June 18, 2026 17:12
@bito-code-review

bito-code-review Bot commented Jun 18, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Agent Run #3b23ac

Actionable Suggestions - 0
Filtered by Review Rules

Bito filtered these suggestions based on rules created automatically for your feedback. Manage rules.

  • superset-frontend/packages/superset-ui-core/src/components/Select/Select.tsx - 1
Review Details
  • Files reviewed - 15 · Commit Range: 67f068a..bd26ca8
    • superset-frontend/packages/superset-ui-core/src/chart/components/StatefulChart.tsx
    • superset-frontend/packages/superset-ui-core/src/components/AsyncEsmComponent/index.tsx
    • superset-frontend/packages/superset-ui-core/src/components/DropdownContainer/DropdownContainer.tsx
    • superset-frontend/packages/superset-ui-core/src/components/Icons/AntdEnhanced.tsx
    • superset-frontend/packages/superset-ui-core/src/components/ModalTrigger/index.tsx
    • superset-frontend/packages/superset-ui-core/src/components/Select/AsyncSelect.tsx
    • superset-frontend/packages/superset-ui-core/src/components/Select/Select.tsx
    • superset-frontend/packages/superset-ui-core/src/components/Table/VirtualTable.tsx
    • superset-frontend/packages/superset-ui-core/src/components/Table/utils/InteractiveTableUtils.ts
    • superset-frontend/packages/superset-ui-core/src/components/TableCollection/index.tsx
    • superset-frontend/packages/superset-ui-core/src/components/TimezoneSelector/index.tsx
    • superset-frontend/packages/superset-ui-core/src/connection/types.ts
    • superset-frontend/packages/superset-ui-core/src/time-comparison/fetchTimeRange.ts
    • superset-frontend/packages/superset-ui-core/src/utils/lruCache.ts
    • superset-frontend/packages/superset-ui-core/types/assets.d.ts
  • Files skipped - 1
    • UPDATING.md - Reason: Filter setting
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful
    • Eslint (Linter) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at [email protected].

Documentation & Help

AI Code Review powered by Bito Logo

@aminghadersohi aminghadersohi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TS6 forward-compat fixes look correct throughout. The FetchRetryOptions breaking change is documented in UPDATING.md. All reviewer threads resolved.

@rusackas rusackas moved this to Propose for Lazy Consensus in Apache Superset 7.0 Jun 22, 2026
@rusackas rusackas moved this from Propose for Lazy Consensus to Lazy Consensus Reached in Apache Superset 7.0 Jun 30, 2026
@rusackas rusackas moved this from Lazy Consensus Reached to Work in Progress in Apache Superset 7.0 Jun 30, 2026
@rusackas
rusackas merged commit a8f4389 into master Jun 30, 2026
68 of 69 checks passed
@rusackas
rusackas deleted the ts6-migration/phase-b-superset-ui-core branch June 30, 2026 20:52
@github-project-automation github-project-automation Bot moved this from Work in Progress to Lazy Consensus Reached in Apache Superset 7.0 Jun 30, 2026
@rusackas rusackas moved this from Lazy Consensus Reached to Completed in Apache Superset 7.0 Jun 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Completed

Development

Successfully merging this pull request may close these issues.

3 participants