Skip to content

Commit

Permalink
docs: update v15 migration guide
Browse files Browse the repository at this point in the history
  • Loading branch information
DSil committed Mar 26, 2024
1 parent 2fbe2ad commit 94f87d2
Showing 1 changed file with 31 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,41 @@ redirect_from:
This migration guide focuses on the process of migrating from Orbit v14 to v15.0, as some breaking changes were introduced.
With this guide, we aim to walk through all the breaking changes and how they can be addressed, allowing the migration to be smoother and effortlessly.

This version marks the removal of `styled-components`. The whole styling of Orbit components is now done using Tailwind exclusively. This also means that our support for `styled-components` related issues is now finished.

## Breaking changes

### OrbitProvider changes

The `OrbitProvider` component has changed and no longer includes the `ThemeProvider` from `styled-components`.

**This should not have any impact if you are not using `styled-components` in your project.**

The `useTheme` hook is still available and can be used to access the theme values, as usual.

If you are still using `styled-components` in your project, you will need to wrap your application (and the `OrbitProvider`) with the `ThemeProvider` from `styled-components` and pass it the same `theme` you are passing to `OrbitProvider`.

```jsx
import { ThemeProvider } from "styled-components";
import { OrbitProvider } from "@kiwicom/orbit-components";

const App = () => (
<ThemeProvider theme={theme}>
<OrbitProvider theme={theme}>
<App />
</OrbitProvider>
</ThemeProvider>
);
```

### mediaQueries util function removed

The `mediaQueries` function is no longer available. This was a styled-components util function that is now no longer expected to be used, as we move away from StyledComponents.
If needed, the tokens and breakpoint values are still accessible via the `getBreakpointWidth` function and the `QUERIES` and `TOKEN` constants.
Check [the documentation](/development/utilities/media-queries/) for more information on how to use these.

### rtl utils removed

The `rtl` utility functions have been removed. They were used to handle RTL styles in the `styled-components` version of Orbit.

With the removal of `styled-components`, these functions are no longer available through `orbit-components`.

0 comments on commit 94f87d2

Please sign in to comment.