Skip to content

feat: migrate select component to TypeScript#46

Open
devin-ai-integration[bot] wants to merge 3 commits into
devin/1776080787-ts-migration-basefrom
devin/migrate-select
Open

feat: migrate select component to TypeScript#46
devin-ai-integration[bot] wants to merge 3 commits into
devin/1776080787-ts-migration-basefrom
devin/migrate-select

Conversation

@devin-ai-integration
Copy link
Copy Markdown

@devin-ai-integration devin-ai-integration Bot commented Apr 13, 2026

Description

Migrates the entire select component from JavaScript to TypeScript. This includes all sub-modules:

  • select/ - Core Select class component, InputWrapper, MenuWrapper, FilterableMenu, FilterInput, and utility helpers
  • multi-select/ - MultiSelect, Menu, FilterableMenu, Input, SelectionList
  • multi-select-option/ - MultiSelectOption with Checkbox
  • multi-select-field/ - MultiSelectField class component with Field wrapper
  • single-select/ - SingleSelect, Menu, FilterableMenu, Input, Selection
  • single-select-option/ - SingleSelectOption with checkmark SVG
  • single-select-field/ - SingleSelectField class component with Field wrapper
  • simple-single-select/ - SimpleSingleSelect with keyboard navigation hooks, Menu with Popper/Layer, SelectedValue with combobox ARIA, OptionsList with IntersectionObserver
  • simple-single-select-field/ - SimpleSingleSelectField with Field wrapper

Changes made:

  • Renamed all .js source files to .ts/.tsx (40+ files)
  • Removed all PropTypes imports and runtime prop type definitions
  • Added TypeScript interfaces for all component props and exported them
  • Typed class components with React.Component<Props, State>
  • Added component-level tsconfig.json with ES2023 lib and node types
  • Updated d2.config.js entry point from src/index.js to src/index.ts
  • Updated package.json build script to include post-build rename and added typecheck script
  • Updated all test file imports to reference .tsx/.ts extensions
  • Updated all story file imports to reference .tsx/.ts extensions
  • Updated jest.mock() paths in test files to reference new .tsx paths
  • Added src/locales/index.d.ts type declaration for i18n module
  • Preserved labelId prop on Field in SimpleSingleSelectField for correct aria-labelledby association

Verification:

  • tsc --noEmit passes with zero errors
  • eslint passes with zero errors
  • yarn build succeeds (134 files renamed, 114 imports updated by post-build script)
  • Unit tests: 9 test suites fail due to pre-existing dependency resolution issues (unbuilt sibling packages like @dhis2/ui-constants, @dhis2-ui/box). These same 9 failures exist on the base branch before the migration. The 1 test suite that can resolve its dependencies (debounce.spec.js) passes.

Known issues

  • None introduced by this PR. Pre-existing test failures due to unbuilt sibling package dependencies.

Checklist

  • API docs are generated
  • Tests were added
  • Storybook demos were added

Story and test files were not converted to TypeScript per migration guidelines - only their imports were updated to reference the new .tsx/.ts source files.

Link to Devin session: https://app.devin.ai/sessions/8a839787d0b845dd926f26d18c106875
Requested by: @eirikhaugstulen

Co-Authored-By: Eirik <eirik.haugstulen@gmail.com>
@devin-ai-integration
Copy link
Copy Markdown
Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

Co-Authored-By: Eirik <eirik.haugstulen@gmail.com>
@devin-ai-integration devin-ai-integration Bot marked this pull request as ready for review April 13, 2026 16:10
devin-ai-integration[bot]

This comment was marked as resolved.

Co-Authored-By: Eirik <eirik.haugstulen@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant