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

feat(usePatchChildren): opportunity to provide props #6135

Merged
merged 5 commits into from
Nov 27, 2023

Conversation

inomdzhon
Copy link
Contributor

@inomdzhon inomdzhon commented Nov 24, 2023

  • Unit-тесты

Описание

Добавил два новых аргумента:

  1. возможность прокидывать параметры помимо ref/getRootRef;
  2. возможность прокинуть дополнительный обработчик ref.

Изменения

  • переименовал из usePatchChildrenRef() на usePatchChildren() (см. feat(usePatchChildren): opportunity to provide props #6135 (comment))
  • getMergedSameEventsByProps() – функция, которая объединяет две схожие функции в одну из двух входных
    параметров.
  • в lib/utils добавились новые валидаторы isDOMTypeElement() и isValidNotReactFragmentElement();

@inomdzhon inomdzhon self-assigned this Nov 24, 2023
@inomdzhon inomdzhon requested a review from a team as a code owner November 24, 2023 14:21
Copy link
Contributor

github-actions bot commented Nov 24, 2023

size-limit report 📦

Path Size
JS 342.81 KB (+0.09% 🔺)
JS (gzip) 104.77 KB (+0.12% 🔺)
JS (brotli) 86.5 KB (-0.04% 🔽)
JS import Div (tree shaking) 1.43 KB (0%)
CSS 259.36 KB (0%)
CSS (gzip) 33.9 KB (0%)
CSS (brotli) 27.52 KB (0%)

Copy link

codesandbox-ci bot commented Nov 24, 2023

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit b0915c4:

Sandbox Source
VKUI TypeScript Configuration

Copy link
Contributor

github-actions bot commented Nov 24, 2023

e2e tests

Playwright Report

Copy link
Contributor

github-actions bot commented Nov 24, 2023

👀 Docs deployed

Commit b0915c4

Copy link

codecov bot commented Nov 24, 2023

Codecov Report

Attention: 4 lines in your changes are missing coverage. Please review.

Comparison is base (d2c19cb) 79.35% compared to head (b0915c4) 79.53%.
Report is 1 commits behind head on master.

Files Patch % Lines
packages/vkui/src/hooks/usePatchChildren.ts 93.33% 2 Missing ⚠️
...es/vkui/src/components/HoverPopper/HoverPopper.tsx 50.00% 1 Missing ⚠️
packages/vkui/src/components/Popover/Popover.tsx 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6135      +/-   ##
==========================================
+ Coverage   79.35%   79.53%   +0.18%     
==========================================
  Files         312      313       +1     
  Lines        9833     9867      +34     
  Branches     3306     3321      +15     
==========================================
+ Hits         7803     7848      +45     
+ Misses       2030     2019      -11     
Flag Coverage Δ
unittests 79.53% <93.10%> (+0.18%) ⬆️

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

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

mendrew
mendrew previously approved these changes Nov 24, 2023
Copy link
Contributor

@mendrew mendrew left a comment

Choose a reason for hiding this comment

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

Филигранная работа с этими ref. 🥇

packages/vkui/src/hooks/usePatchChildrenRef.ts Outdated Show resolved Hide resolved
mendrew
mendrew previously approved these changes Nov 24, 2023
Copy link
Contributor

@mendrew mendrew left a comment

Choose a reason for hiding this comment

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

💠 Спасибо! 💅

SevereCloud
SevereCloud previously approved these changes Nov 27, 2023
Функция, которая объединяет две схожие функции в одну из двух входных
параметров.
- 2-ой аргумент: добавляем возможность прокидывать параметры помимо
  `ref`/`getRootRef`.
- 3-ий аргумент: возможность прокинуть дополнительный обработчик `ref`.

В `lib/utils` добавились новые валидаторы `isDOMTypeElement()` и
 `isValidNotReactFragmentElement()`.
@inomdzhon inomdzhon changed the title feat(usePatchChildrenRef): opportunity to provide props feat(~usePatchChildrenRef~ usePatchChildren): opportunity to provide props Nov 27, 2023
@inomdzhon inomdzhon changed the title feat(~usePatchChildrenRef~ usePatchChildren): opportunity to provide props feat(-usePatchChildrenRef- usePatchChildren): opportunity to provide props Nov 27, 2023
@inomdzhon inomdzhon changed the title feat(-usePatchChildrenRef- usePatchChildren): opportunity to provide props feat(usePatchChildren): opportunity to provide props Nov 27, 2023
@inomdzhon inomdzhon dismissed stale reviews from SevereCloud and mendrew via b0915c4 November 27, 2023 08:06
@inomdzhon inomdzhon force-pushed the imirdzhamolov/feat/extend-usePatchChildrenRef branch from 5730f67 to b0915c4 Compare November 27, 2023 08:06
@inomdzhon inomdzhon merged commit 2945305 into master Nov 27, 2023
24 checks passed
@inomdzhon inomdzhon deleted the imirdzhamolov/feat/extend-usePatchChildrenRef branch November 27, 2023 08:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants