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

[Docs] propsParser в production-сборке и под флагом #2151

Merged
merged 5 commits into from
Dec 15, 2021

Conversation

eugpoloz
Copy link
Contributor

@eugpoloz eugpoloz commented Dec 13, 2021

Из-за возвращения на react-docgen-typescript с dev-сборкой документации возникли две проблемы:

  1. В dev-режиме она изначально собирается ~2 минуты, что довольно медленно,
  2. Пропсы при хот релоаде не пересобираются.

При этом пропсы компонентов меняются не так часто и кажется, что необходимости ждать 2 минуты каждый раз нет.

Поэтому пока есть такое временное решение:

  • выкидываем propsParser для dev-сборки вообще,
  • react-docgen-typescript остался для prod-сборки,
  • появилась новая команда yarn styleguide:props, чтобы в dev-сборке можно было использовать react-docgen-typescript и посмотреть, какие пропсы и как выведутся в "Свойствах и методах", когда и если это нужно,
    • добавила плейсхолдер для dev-сборки вместо свойств и методов и заметку про новую команду в CONTRIBUTING.md. 😄

Попозже и уже отдельно хочу попробовать дооптимизировать react-docgen-typescript так, чтобы танцы с бубном вокруг парсера были больше не нужны.

@eugpoloz eugpoloz requested a review from a team as a code owner December 13, 2021 12:43
@codesandbox-ci
Copy link

codesandbox-ci bot commented Dec 13, 2021

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 b981e78:

Sandbox Source
VKUI - default example Configuration

@github-actions
Copy link
Contributor

github-actions bot commented Dec 13, 2021

size-limit report 📦

Path Size
JS 59.94 KB (0%)
JS, unstable 24.42 KB (0%)
CSS 30.98 KB (0%)
CSS, unstable 1003 B (0%)

Copy link
Contributor

@ArthurStam ArthurStam left a comment

Choose a reason for hiding this comment

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

  1. Я бы дефолтным сделал typescript парсер. Хочется, чтобы условие было инвертировано. Типа: если дев, то собирай упрощенно, иначе собирай прод. Так меньше шансов, что однажды на прод выедет сборка без пропов.
  2. Если мы ваще не выводим пропы в упрощенном режиме, то можем ли мы не запускать никакой парсер? Или стайлгайдист не даст?

@github-actions
Copy link
Contributor

👀 Styleguide deployed

See the styleguide for this PR at https://vkcom.github.io/VKUI/pull/2151/

@eugpoloz eugpoloz force-pushed the docs/propsParser-in-prod-only branch from 3c1adb7 to b981e78 Compare December 14, 2021 22:53
@github-actions
Copy link
Contributor

Code coverage

lines3051 / 379580.39%
statements3108 / 386780.37%
functions702 / 85682.00%
branches2408 / 325873.91%
branchesTrue0 / 0100.00%

Generated by 🚫 dangerJS against b981e78

@eugpoloz eugpoloz merged commit c0a141d into master Dec 15, 2021
@eugpoloz eugpoloz deleted the docs/propsParser-in-prod-only branch December 15, 2021 09:59
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.

None yet

2 participants