Skip to content

feat: add render prop#9918

Open
SevereCloud wants to merge 2 commits into
masterfrom
SevereCloud/feat/add-render-prop
Open

feat: add render prop#9918
SevereCloud wants to merge 2 commits into
masterfrom
SevereCloud/feat/add-render-prop

Conversation

@SevereCloud

@SevereCloud SevereCloud commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

  • Unit-тесты
  • e2e-тесты
  • Дизайн-ревью
  • Документация фичи
  • Release notes

Описание

Добавляем свойство render для компонентов

Release notes

Улучшения

  • Для компонентов добавлено свойство render на ряду с Component

@SevereCloud
SevereCloud requested a review from a team as a code owner June 10, 2026 09:26
@github-actions

github-actions Bot commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size
JS 425.26 KB (+0.04% 🔺)
JS (gzip) 131.14 KB (+0.03% 🔺)
JS (brotli) 108.31 KB (+0.05% 🔺)
JS import Div (tree shaking) 945 B (+16.53% 🔺)
CSS 381.95 KB (0%)
CSS (gzip) 46.76 KB (0%)
CSS (brotli) 36.94 KB (0%)

@SevereCloud
SevereCloud marked this pull request as draft June 10, 2026 09:29
@github-actions

github-actions Bot commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

📊 Найдены изменения в собранных файлах: Отчет

Commit 4691a5f

@codecov

codecov Bot commented Jun 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.21%. Comparing base (ac28ced) to head (4691a5f).
⚠️ Report is 11 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #9918      +/-   ##
==========================================
- Coverage   95.22%   95.21%   -0.01%     
==========================================
  Files         462      461       -1     
  Lines       12535    12529       -6     
  Branches     4490     4485       -5     
==========================================
- Hits        11936    11930       -6     
  Misses        599      599              
Flag Coverage Δ
unittests 95.21% <100.00%> (-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.

@github-actions

github-actions Bot commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

👀 Docs deployed

📦 Package ✅

yarn add @vkontakte/vkui@https://development.s3.prodcloud.vk.team/pull/9918/4691a5fe551cd2aa2d7852ffd4709854e0d98811/pkg/@vkontakte/vkui/_pkg.tgz

Commit 4691a5f

@SevereCloud
SevereCloud force-pushed the SevereCloud/feat/add-render-prop branch from 994ae8b to a8cac1d Compare June 10, 2026 10:32
@github-actions

github-actions Bot commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

e2e tests

Playwright Report

};

if (render) {
return <RenderRootComponent render={render} getRootRef={getRootRef} {...resolvedProps} />;

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.

А точно нужно дополнительный узел в дереве создавать? Нельзя просто?

if (render) return render({ ...resolvedProps, getRootRef });

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Нельзя, так как ругается компилятор

playground

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.

Нашёл несколько моментов, которые стоит поправить перед мержем:

  1. ContentCard сейчас наследует render через TappableOmitProps, но Component у него применяется к внешнему Card, а render проваливается во внутренний Tappable. Получается, что render не является аналогом Component для этого компонента. Нужно либо передавать render во внешний Card, либо явно исключить его из props.

  2. Часть компонентов, которые являются обёртками над RootComponent, типизируются через HTMLAttributesWithRootRef & HasComponent, поэтому render в их публичном API не появляется, хотя технически они его уже могут прокинуть в RootComponent. Нужно либо HasComponent расширить типом render, либо по аналогии создать тип HasRender и подключить ручками

    • Card
    • CardGrid
    • CardScroll
    • Chip
    • FormItemTop
    • GroupContainer
    • GroupExpandedContent

@SevereCloud
SevereCloud marked this pull request as ready for review June 18, 2026 10:15
@vkcom-publisher vkcom-publisher added the pr-needs-work Автоматизация: PR автоматически закроется через 14 дней при отсутствии активности label Jun 25, 2026
@SevereCloud
SevereCloud force-pushed the SevereCloud/feat/add-render-prop branch from a8cac1d to adb290d Compare June 29, 2026 08:20
@SevereCloud SevereCloud removed the pr-needs-work Автоматизация: PR автоматически закроется через 14 дней при отсутствии активности label Jun 29, 2026
@SevereCloud
SevereCloud force-pushed the SevereCloud/feat/add-render-prop branch from adb290d to 9c0cd5f Compare June 29, 2026 08:30
Comment thread packages/vkui/src/components/RootComponent/RootComponent.tsx
Comment thread packages/vkui/src/components/RootComponent/RootComponent.test.tsx
};

if (render) {
return <RenderRootComponent render={render} getRootRef={getRootRef} {...resolvedProps} />;

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.

Нашёл несколько моментов, которые стоит поправить перед мержем:

  1. ContentCard сейчас наследует render через TappableOmitProps, но Component у него применяется к внешнему Card, а render проваливается во внутренний Tappable. Получается, что render не является аналогом Component для этого компонента. Нужно либо передавать render во внешний Card, либо явно исключить его из props.

  2. Часть компонентов, которые являются обёртками над RootComponent, типизируются через HTMLAttributesWithRootRef & HasComponent, поэтому render в их публичном API не появляется, хотя технически они его уже могут прокинуть в RootComponent. Нужно либо HasComponent расширить типом render, либо по аналогии создать тип HasRender и подключить ручками

    • Card
    • CardGrid
    • CardScroll
    • Chip
    • FormItemTop
    • GroupContainer
    • GroupExpandedContent

Comment thread packages/vkui/src/components/ContentCard/ContentCard.tsx Outdated
@vkcom-publisher vkcom-publisher added the pr-needs-work Автоматизация: PR автоматически закроется через 14 дней при отсутствии активности label Jul 10, 2026
@vkcom-publisher

Copy link
Copy Markdown
Contributor

PR закрыт из-за отсутствия активности в течение последних 14 дней. Если это произошло по ошибке или изменения все ещё актуальны, откройте PR повторно.

@inomdzhon inomdzhon added no-stale Добавляет PR в исключения для автоматического закрытия and removed pr-needs-work Автоматизация: PR автоматически закроется через 14 дней при отсутствии активности labels Jul 21, 2026
@inomdzhon inomdzhon reopened this Jul 21, 2026
@SevereCloud
SevereCloud force-pushed the SevereCloud/feat/add-render-prop branch from d19c3d3 to 4691a5f Compare July 22, 2026 07:50
@SevereCloud
SevereCloud requested a review from inomdzhon July 22, 2026 07:56
@inomdzhon

inomdzhon commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Изменил описание Release notes

@SevereCloud может в целом как-то подробней опишем релиз ноут? Может даже замутить пост в блоге для чего и почему и как.

Или отдельную страницу в Кастомизации

image

Референс https://ark-ui.com/docs/guides/composition

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-stale Добавляет PR в исключения для автоматического закрытия

Projects

None yet

4 participants