-
Notifications
You must be signed in to change notification settings - Fork 20
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(plasma-new-hope): add emotion support #1276
Conversation
Theme Builder app deployed! https://plasma.sberdevices.ru/pr/plasma-theme-builder-pr-1276/ |
Documentation preview deployed! website:https://plasma.sberdevices.ru/pr/pr-1276/ |
⚡ Component performance testingResult: 🟢 OK |
⚡ Component performance testingResult: 🟢 OK |
@@ -94,7 +95,7 @@ export { addFocus } | |||
// @public (undocumented) | |||
export const BodyL: FunctionComponent<PropsType< { | |||
size: { | |||
l: string; | |||
l: PolymorphicClassName; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Note]:
Изменения связанные с тем как описывают типы пакеты @emotion/react
и @linaria
для @linaria
это просто string, то для @emotion/react
export interface SerializedStyles {
name: string;
styles: string;
map?: string;
next?: SerializedStyles;
}
export type PolymorphicClassName = string | SerializedStyles;
поэтому запись стало такой
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
В файле - packages/plasma-new-hope/src/engines/types.ts
находятся эти изменения.
⚡ Component performance testingResult: 💀 WASTED Performance tests are broken. |
@@ -0,0 +1,5 @@ | |||
{ | |||
"module": "es/index.js", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Сделано по аналогии со styled-components
У нас так же есть суб директория - packages/plasma-new-hope/styled-components
в которой лежит package.json
с точно таким же описанием.
⚡ Component performance testingResult: 🟢 OK |
⚡ Component performance testingResult: 🟢 OK |
@@ -9,6 +9,7 @@ perl -p -i -e "s/import { styled } from '\@linaria\/react'/import styled from 's | |||
perl -p -i -e "s/import { css } from '\@linaria\/core'/import { css } from 'styled-components'/g" $files | |||
|
|||
rm -rf src-sc/engines/linaria.tsx | |||
perl -p -i -e "s/import { css as cssLibrary } from '\@linaria\/core'/import { css as cssLibrary } from 'styled-components'/g" src-sc/engines/index.ts | |||
perl -p -i -e "s/linaria/styled-components/g" src-sc/engines/index.ts src-sc/engines/common.tsx | |||
rm -rf src-sc/engines/emotion.tsx |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Support emotion engine
@emotion
What/why changed
Для поддержки пакет
@emotion
расширили возможности в пакетеplasma-new-hope
В целом алгоритм такой же как и с работой
styled-components
.Делаем копию списка компонентов и заменяем использование пакетов
И появилась новая директория emotion на уровне самого пакета поставки
📦 Published PR as canary version:
Canary Versions
✨ Test out this PR locally via: