Skip to content

[Grid] Export new grid as unstable#33479

Merged
siriwatknp merged 11 commits intomui:masterfrom
siriwatknp:system/grid-unstable
Jul 12, 2022
Merged

[Grid] Export new grid as unstable#33479
siriwatknp merged 11 commits intomui:masterfrom
siriwatknp:system/grid-unstable

Conversation

@siriwatknp
Copy link
Member

@siriwatknp siriwatknp commented Jul 12, 2022

Usage

System
From the package perspective, System does not have Grid before so no need to suffix with 2.

import Grid from '@mui/system/Unstable_Grid';

Material UI
Mark it as unstable to inform developers that this component is a new one that we want to test out. Also, use Grid2 to implicitly explain that this is the new version of the Grid.

import Grid from '@mui/material/Unstable_Grid2';

🧪 https://codesandbox.io/s/create-react-app-with-typescript-forked-bisql4?file=/src/App.tsx

I don't want to add the demos for the new grid in this PR because it would be hard to review. I will do it in a separate PR.

Joy UI
// since Joy is still in alpha, I don't think the Unstable is needed.

import Grid from '@mui/joy/Grid';

🧪 https://codesandbox.io/s/joy-cra-typescript-forked-lx29lg?file=/src/App.tsx


@siriwatknp siriwatknp added component: Grid The React component. scope: system The system, the design tokens / styling foundations used across components. eg. @mui/system with MUI labels Jul 12, 2022
@mui-bot
Copy link

mui-bot commented Jul 12, 2022

Details of bundle changes

@material-ui/core: parsed: +1.04% , gzip: +1.22%
@material-ui/system: parsed: +8.51% , gzip: +6.45%

Generated by 🚫 dangerJS against 7128b2a

@siriwatknp siriwatknp requested a review from mnajdova July 12, 2022 03:07
@siriwatknp siriwatknp changed the title [System] Export new grid as unstable [Grid] Export new grid as unstable Jul 12, 2022
MuiFormHelperText: FormHelperTextClassKey;
MuiFormLabel: FormLabelClassKey;
MuiGrid: GridClassKey;
MuiGrid2: Grid2Slot;
Copy link
Member Author

Choose a reason for hiding this comment

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

I think we can start to use slot instead of class key.

Copy link
Member

@mnajdova mnajdova left a comment

Choose a reason for hiding this comment

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

Naming looks good 👌

@siriwatknp siriwatknp merged commit d1d1654 into mui:master Jul 12, 2022
@@ -1,5 +1,5 @@
import * as React from 'react';
import Grid from '@mui/system/Grid';
import Grid from '@mui/system/Unstable_Grid';
Copy link
Member

@oliviertassinari oliviertassinari Jul 15, 2022

Choose a reason for hiding this comment

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

It might have been clearer with:

Suggested change
import Grid from '@mui/system/Unstable_Grid';
import Grid from '@mui/system/Unstable_Grid2';

under the idea that the code namespace is unique inside MUI, and for Joy. I mean, for the developers using both, switching between the libraries based on the project/part of the apps.

daniel-rabe pushed a commit to daniel-rabe/material-ui that referenced this pull request Nov 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component: Grid The React component. package: joy-ui Specific to Joy UI. scope: system The system, the design tokens / styling foundations used across components. eg. @mui/system with MUI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants