Skip to content
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

Circular dependencies in packages/react #2474

Closed
Tracked by #2475
unekinn opened this issue Sep 20, 2024 · 0 comments · Fixed by #2478
Closed
Tracked by #2475

Circular dependencies in packages/react #2474

unekinn opened this issue Sep 20, 2024 · 0 comments · Fixed by #2478
Labels
🕵️ investigate Needs investigation react @digdir/designsystemet-react ⚙️ technical Technical improvements, maintenance or other issues that are not directly linked to a feature

Comments

@unekinn
Copy link
Contributor

unekinn commented Sep 20, 2024

We have some circular dependencies. Here's the circular dependency report from two different tools:

dpdm

> npx dpdm --no-warning --no-tree src/index.ts 

✔ [174/174] Analyze done!
• Circular Dependencies
  01) src/components/index.ts -> src/components/Button/index.ts -> src/components/Button/Button.tsx
  02) src/components/form/Fieldset/FieldsetContext.ts -> src/components/form/useFormField.ts
  03) src/components/form/Select/Select.tsx -> src/components/form/Select/useSelect.ts
  04) src/components/Pagination/Pagination.tsx -> src/components/Pagination/PaginationButton.tsx -> src/components/Pagination/PaginationRoot.tsx
  05) src/components/Pagination/Pagination.tsx -> src/components/Pagination/usePagination.ts
  06) src/components/form/Checkbox/Checkbox.tsx -> src/components/form/Checkbox/useCheckbox.ts
  07) src/components/form/Radio/Radio.tsx -> src/components/form/Radio/useRadio.ts
  08) src/components/form/Switch/Switch.tsx -> src/components/form/Switch/useSwitch.ts
  09) src/components/form/Textfield/index.ts -> src/components/form/Textfield/Textfield.tsx -> src/components/form/CharacterCounter.tsx
  10) src/components/form/Textfield/Textfield.tsx -> src/components/form/Textfield/useTextfield.ts
  11) src/components/form/Textarea/Textarea.tsx -> src/components/form/Textarea/useTextarea.ts
  12) src/components/ToggleGroup/ToggleGroupItem.tsx -> src/components/ToggleGroup/useToggleGroupitem.ts
  13) src/components/form/Search/Search.tsx -> src/components/form/Search/useSearch.ts
  14) src/components/form/Combobox/Combobox.tsx -> src/components/form/Combobox/ComboboxContext.tsx
  15) src/components/form/Combobox/Combobox.tsx -> src/components/form/Combobox/ComboboxContext.tsx -> src/components/form/Combobox/useCombobox.tsx
  16) src/components/form/Combobox/ComboboxContext.tsx -> src/components/form/Combobox/useCombobox.tsx -> src/components/form/Combobox/Custom.tsx
  17) src/components/form/Combobox/ComboboxContext.tsx -> src/components/form/Combobox/useCombobox.tsx -> src/components/form/Combobox/Option/Option.tsx
  18) src/components/form/Combobox/ComboboxContext.tsx -> src/components/form/Combobox/useCombobox.tsx -> src/components/form/Combobox/Option/Option.tsx -> src/components/form/Combobox/Option/useComboboxOption.tsx
  19) src/components/form/Combobox/Option/Option.tsx -> src/components/form/Combobox/Option/useComboboxOption.tsx -> src/components/form/Combobox/utilities.ts
  20) src/components/form/Combobox/Option/Option.tsx -> src/components/form/Combobox/Option/useComboboxOption.tsx -> src/components/form/Combobox/utilities.ts
  21) src/components/form/Combobox/Combobox.tsx -> src/components/form/Combobox/internal/ComboboxError.tsx
  22) src/components/form/Combobox/Combobox.tsx -> src/components/form/Combobox/internal/ComboboxInput.tsx
  23) src/components/form/Combobox/Combobox.tsx -> src/components/form/Combobox/internal/ComboboxLabel.tsx
  24) src/components/form/Combobox/Combobox.tsx -> src/components/form/Combobox/internal/ComboboxNative.tsx

madge

> npx madge --extensions ts,tsx ./src --circular

Processed 270 files (1.2s) (8 warnings)

✖ Found 23 circular dependencies!

1) components/index.ts > components/Button/index.ts > components/Button/Button.tsx
2) components/Pagination/Pagination.tsx > components/Pagination/PaginationButton.tsx > components/Pagination/PaginationRoot.tsx
3) components/Pagination/Pagination.tsx > components/Pagination/usePagination.ts
4) components/ToggleGroup/ToggleGroupItem.tsx > components/ToggleGroup/useToggleGroupitem.ts
5) components/form/Checkbox/Checkbox.tsx > components/form/Checkbox/useCheckbox.ts
6) components/form/Fieldset/FieldsetContext.ts > components/form/useFormField.ts
7) components/form/Combobox/Combobox.tsx > components/form/Combobox/ComboboxContext.tsx
8) components/form/Combobox/Combobox.tsx > components/form/Combobox/ComboboxContext.tsx > components/form/Combobox/useCombobox.tsx
9) components/form/Combobox/ComboboxContext.tsx > components/form/Combobox/useCombobox.tsx > components/form/Combobox/Custom.tsx
10) components/form/Combobox/ComboboxContext.tsx > components/form/Combobox/useCombobox.tsx > components/form/Combobox/Option/Option.tsx
11) components/form/Combobox/ComboboxContext.tsx > components/form/Combobox/useCombobox.tsx > components/form/Combobox/Option/Option.tsx > components/form/Combobox/Option/useComboboxOption.tsx
12) components/form/Combobox/Option/Option.tsx > components/form/Combobox/Option/useComboboxOption.tsx > components/form/Combobox/utilities.ts
13) components/form/Combobox/Combobox.tsx > components/form/Combobox/internal/ComboboxError.tsx
14) components/form/Combobox/Combobox.tsx > components/form/Combobox/internal/ComboboxInput.tsx
15) components/form/Combobox/Combobox.tsx > components/form/Combobox/internal/ComboboxLabel.tsx
16) components/form/Combobox/Combobox.tsx > components/form/Combobox/internal/ComboboxNative.tsx
17) components/form/Radio/Radio.tsx > components/form/Radio/useRadio.ts
18) components/form/Search/Search.tsx > components/form/Search/useSearch.ts
19) components/form/Select/Select.tsx > components/form/Select/useSelect.ts
20) components/form/Switch/Switch.tsx > components/form/Switch/useSwitch.ts
21) components/form/CharacterCounter.tsx > components/form/Textfield/index.ts > components/form/Textfield/Textfield.tsx
22) components/form/Textfield/Textfield.tsx > components/form/Textfield/useTextfield.ts
23) components/form/Textarea/Textarea.tsx > components/form/Textarea/useTextarea.ts
@unekinn unekinn added ⚙️ technical Technical improvements, maintenance or other issues that are not directly linked to a feature 🕵️ investigate Needs investigation labels Sep 20, 2024
@mimarz mimarz added the react @digdir/designsystemet-react label Sep 20, 2024
@github-project-automation github-project-automation bot moved this from 📄 Todo to ✅ Done in Team Design System Sep 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🕵️ investigate Needs investigation react @digdir/designsystemet-react ⚙️ technical Technical improvements, maintenance or other issues that are not directly linked to a feature
Projects
Status: ✅ Done
Development

Successfully merging a pull request may close this issue.

2 participants