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

[BREAKING CHANGE] feat: rename appearance to colorScheme #7728

Merged

Conversation

EldarMuhamethanov
Copy link
Contributor

@EldarMuhamethanov EldarMuhamethanov commented Oct 9, 2024


  • Unit-тесты
  • e2e-тесты
  • Release notes
  • Codemods

Описание

Сейчас appearance обозначает цветовую схему приложения 'dark' | 'light', а также используется в компонентах как цветовое оформление компонента. Нужно переименовать упоминания appearance на colorScheme

Изменения

  • Константа Appearance переименована в ColorScheme. Реализован кодмод
  • Тип AppearanceType переименован в ColorSchemeType. Реализован кодмод
  • AppearanceProvider переименован в ColorSchemeProvider, AppearanceProviderProps переименован в ColorSchemeProviderProps. Реализован кодмод
  • Хук useAppearance переименован в useColorScheme. Реализован кодмод
  • В ConfigProvider и ConfigProviderProps свойство appearance переименовано в colorScheme
  • В ConfigProviderContext свойство appearance переименовано в colorScheme
  • Прошелся по коду и заменил все упоминания appearance на colorScheme
  • Удостоверился, что все тесты(Unit и Скришотные) проходят
  • Удостоверился, что stylguide и storybook работает как раньше

Release notes

BREAKING CHANGE

  • Константа Appearance переименована в ColorScheme
    - export const Appearance = {
    + export const ColorScheme = {
      DARK: 'dark',
      LIGHT: 'light',
    } as const;
    
    - const apperance = Appearance.DARK
    + const colorScheme = ColorScheme.DARK
  • Тип AppearanceType переименован в ColorSchemeType
    - const appearance: ApperanceType = Appearance.DARK;
    + const colorScheme: ColorSchemeType = ColorScheme.DARK;
  • AppearanceProvider переименован в ColorSchemeProvider, AppearanceProviderProps переименован в ColorSchemeProviderProps
    - const props: AppearanceProviderProps = {
    + const props: ColorSchemeProviderProps = {
      value: 'dark'
    }
    - <AppearanceProvider value={colorScheme}>
    + <ColorSchemeProvider value={colorScheme}>
      <AdaptivityProvider sizeY="regular">
        <Div style={{ padding: 10 }}>
          <Textarea id="textarea" />
        </Div>
      </AdaptivityProvider>
    - </AppearanceProvider>
    + </ColorSchemeProvider>
  • Хук useAppearance переименован в useColorScheme
    - const appearance = useAppearance();
    + const colorScheme = useColorScheme();
  • В ConfigProvider и ConfigProviderProps свойство appearance переименовано в colorScheme
    <ConfigProvider
      platform="vkcom"
    - appearance="light"
    + colorScheme="light"
    >
      <AdaptivityProvider viewWidth={ViewWidth.DESKTOP} hasPointer>
        <Div>Content</Div>
      </AdaptivityProvider>
    </ConfigProvider>
  • В ConfigProviderContext свойство appearance переименовано в colorScheme
    <ConfigProviderContext.Provider value={{
      ...configContext,
    - appearance: 'light'
    + colorScheme: 'light'
    }}>
      {children}
    </ConfigProviderContext.Provider>
    const {
      ...args,
    - appearance,
    + colorScheme
    } = useConfigProvider();

@EldarMuhamethanov EldarMuhamethanov requested a review from a team as a code owner October 9, 2024 12:25
Copy link
Contributor

github-actions bot commented Oct 9, 2024

size-limit report 📦

Path Size
JS 385.76 KB (+0.01% 🔺)
JS (gzip) 116.75 KB (+0.01% 🔺)
JS (brotli) 95.86 KB (-0.12% 🔽)
JS import Div (tree shaking) 1.46 KB (0%)
CSS 331.77 KB (0%)
CSS (gzip) 41.58 KB (0%)
CSS (brotli) 32.95 KB (0%)

Copy link

codesandbox-ci bot commented Oct 9, 2024

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.

Copy link
Contributor

github-actions bot commented Oct 9, 2024

e2e tests

Playwright Report

Copy link
Contributor

github-actions bot commented Oct 9, 2024

👀 Docs deployed

Commit 83433d2

Copy link

codecov bot commented Oct 9, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.14%. Comparing base (a82b967) to head (83433d2).
Report is 14 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #7728   +/-   ##
=======================================
  Coverage   95.14%   95.14%           
=======================================
  Files         383      383           
  Lines       11343    11343           
  Branches     3718     3718           
=======================================
  Hits        10792    10792           
  Misses        551      551           
Flag Coverage Δ
unittests 95.14% <100.00%> (ø)

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.

Copy link
Contributor

@inomdzhon inomdzhon left a comment

Choose a reason for hiding this comment

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

Крут 🔥

Отметил пару моментов, которые заметил

styleguide/pages/platforms_and_themes.md Outdated Show resolved Hide resolved
styleguide/pages/migration_v6.md Outdated Show resolved Hide resolved
styleguide/pages/integrations_vk_mini_apps.md Outdated Show resolved Hide resolved
EldarMuhamethanov and others added 4 commits October 9, 2024 18:00
revert renaming

Co-authored-by: Inomdzhon Mirdzhamolov <[email protected]>
…rance-to-color-scheme' into e.muhamethanov/7717/rename-appearance-to-color-scheme
inomdzhon
inomdzhon previously approved these changes Oct 9, 2024
@BlackySoul
Copy link
Contributor

Надо здесь тоже поменять appearance

@EldarMuhamethanov
Copy link
Contributor Author

Надо здесь тоже поменять appearance

Точно, все такие пропустил

@EldarMuhamethanov EldarMuhamethanov merged commit be5ef3e into master Oct 14, 2024
28 checks passed
@EldarMuhamethanov EldarMuhamethanov deleted the e.muhamethanov/7717/rename-appearance-to-color-scheme branch October 14, 2024 11:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants