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

sdds-serv: add TextArea component #1263

Merged
merged 4 commits into from
Jun 25, 2024

Conversation

denivladislav
Copy link
Contributor

@denivladislav denivladislav commented Jun 22, 2024

TextArea

  • TextArea портирован в sdds

What/why changed

  • свойство resize помечено как deprecated в библиотеках plasma-{b2c, web}
  • добавлен в sdds-serv
📦 Published PR as canary version: Canary Versions

✨ Test out this PR locally via:

npm install @salutejs/[email protected]
npm install @salutejs/[email protected]
npm install @salutejs/[email protected]
npm install @salutejs/[email protected]
npm install @salutejs/[email protected]
npm install @salutejs/[email protected]
# or 
yarn add @salutejs/[email protected]
yarn add @salutejs/[email protected]
yarn add @salutejs/[email protected]
yarn add @salutejs/[email protected]
yarn add @salutejs/[email protected]
yarn add @salutejs/[email protected]

Copy link
Contributor

Theme Builder app deployed!

https://plasma.sberdevices.ru/pr/plasma-theme-builder-pr-1263/

Copy link
Contributor

⚡ Component performance testing

Result: 🟢 OK

Copy link
Contributor

⚡ Component performance testing

Result: 🟢 OK

type TextAreaComponentType = ForwardRefExoticComponent<TextAreaProps & RefAttributes<HTMLTextAreaElement>>;

const mergedConfig = mergeConfig(textAreaConfig, config);
const TextAreaComponent = component(mergedConfig) as TextAreaComponentType;
Copy link
Collaborator

Choose a reason for hiding this comment

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

а здесь точно нужно явное приведение типов? Разве то, что генерирует функция не подойдёт?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Без приведения ловил ошибку ts2742

Copy link
Collaborator

Choose a reason for hiding this comment

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

а можешь показать, что за ошибка?

Copy link
Contributor Author

@denivladislav denivladislav Jun 24, 2024

Choose a reason for hiding this comment

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

Без каста TextAreaComponentType прилетает ts2742:
The inferred type of 'TextArea' cannot be named without a reference to '../../../../plasma-new-hope/node_modules/@salutejs/plasma-core'. This is likely not portable. A type annotation is necessary.

typeAnnotation.mov

Copy link
Collaborator

Choose a reason for hiding this comment

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

а, ну такую проблему мы уже решали

Copy link
Collaborator

Choose a reason for hiding this comment

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

в файле plasma/packages/plasma-new-hope/src/components/TextArea/TextArea.types.tsx, вместо импорта из plasma-core, скопируй файл TextareaHTMLAttributes в директорию /plasma/packages/plasma-new-hope/src/types. И добавь в этот файл по аналогии с InputHTMLAttributes (который лежит там же) вот эту инфу:

// INFO: Issue об этом решении - https://github.com/salute-developers/plasma/issues/1219

Copy link
Collaborator

Choose a reason for hiding this comment

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

@neretin-trike Вопрос на миллион, в b2c/web у нас тоже кастинг -

const TextAreaComponent = component(mergedConfig) as ForwardRefExoticComponent<
    TextAreaProps & RefAttributes<HTMLTextAreaElement>
>;

кастинг - это проблема?

Copy link
Collaborator

Choose a reason for hiding this comment

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

лучше без него обходиться там, где это возможно. В b2/web это нужно для обратной совместимости

Copy link
Contributor Author

Choose a reason for hiding this comment

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

поправил

@denivladislav denivladislav requested review from Yakutoc and removed request for shuga2704 June 24, 2024 07:47
Copy link
Contributor

⚡ Component performance testing

Result: 🟢 OK

Copy link
Contributor

⚡ Component performance testing

Result: 🟢 OK

Copy link
Contributor

⚡ Component performance testing

Result: 🟢 OK

@denivladislav denivladislav added this pull request to the merge queue Jun 25, 2024
Merged via the queue into dev with commit b38568e Jun 25, 2024
29 checks passed
@denivladislav denivladislav deleted the PLASMA-3061/add-textarea-component-to-sdds branch June 25, 2024 10:08
This was referenced Jul 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants