Skip to content

Commit

Permalink
Updates for v9.0.0-alpha.0 (#207)
Browse files Browse the repository at this point in the history
* Begin upgrading mui to 5.2

- Install mui 5.2
- Remove material-ui 4
- Replace peerDependencies
- Upgrade minimum node version (in preparation for next)

* Replace import and comment instances for mui

* Upgrade react version for mui

* Run mui preset-safe codemods

Note: consider readjusting sizing values if necessary

* Use preset-safe on test directory

Note: consider fixing accordion test manually, as it errored during
codemod run

* Remove @global usage for CssBaseline

(For JSS => emotion migration)

* Manual updates for MUI 5
(where codemods didn't work)

* Move emotion to dev dependencies

* Upgrade next and react

* creeateMuiTheme -> creeateTheme, due to deprecation

* IntersectionObserver fix

* proper theme creation

* MUI migration fixes

* Migrate from JSS

* Manual migration from JSS

removeMakeStyels

* remove mui/styles

* Re-add `classes` where not properly removed

* Fix declaration ordering/placement issues

Also: remove adaptV4Theme usage

* MIU 5 JSS to styled migration

* Continue updating product usage

- Match code styles from other commits
- Ensure necessary variables are used/defined

* selectors fixes

* babel -> swr

* linter

* classes exports from UI-components

* fetchServerSideProps

* LazyHydrate progress

* Fix variable order in plp/Sort.js

* Update package installation process

- Update push-build command to use --sig and npm run build (over yarn)
- Installed peer dependencies properly with npm8
- Update enzyme-adapter-react

* Revert LazyHydrate to pre-upgrade guide state

* Fix carousel styling

- Ensure defaultClass.root is used over passed in classes.root for
  Carousel
- Update thumbnails Tab wrapper usage
- Fix spaces in selectors where necessary

* Continue correcting selectors for carousel

- Migrate JSS selector code to styled for hovering => expand
- Fix expand media query

* Updates to main navigation

- Added 'material-ui-popup-state' to manage hover/popup menus for main navigation
- Updated NavTab to use the aforementioned library

* Removed webpack dev middleware from plugin since it was causing hot reloading issues

* General updates for tests

* Updated github test workflow definition

* Another update to try and fix the tests workflow

* Version bump to v9.0.0-alpha.0

* Updates to (temporarily!) skip uncooperative tests

Co-authored-by: Christopher Buenaventura <[email protected]>
Co-authored-by: sudo97 <[email protected]>
Co-authored-by: dijs <[email protected]>
  • Loading branch information
4 people authored Jan 25, 2022
1 parent 489f632 commit 483d359
Show file tree
Hide file tree
Showing 184 changed files with 38,690 additions and 10,601 deletions.
31 changes: 31 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
module.exports = {
env: {
browser: true,
es2021: true,
jest: true,
node: true,
},
extends: [
'eslint:recommended',
'plugin:react/recommended',
'plugin:react-hooks/recommended',
'plugin:prettier/recommended',
],
parserOptions: {
ecmaFeatures: {
jsx: true,
},
ecmaVersion: 13,
sourceType: 'module',
},
plugins: ['react'],
rules: {
'no-unused-vars': ['error', { ignoreRestSiblings: true }],
'react/display-name': 'off',
'react/prop-types': [2, { ignore: ['children'] }],
indent: ['error', 2, { offsetTernaryExpressions: true }],
'linebreak-style': ['error', 'unix'],
quotes: ['error', 'single', { avoidEscape: true }],
semi: ['error', 'never'],
},
}
10 changes: 8 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,17 @@ jobs:
node-version: [12.x]

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v2
with:
persist-credentials: false
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- name: Reconfigure git to use HTTP authentication
run: >
git config --global url."https://github.com/".insteadOf
ssh://[email protected]/
- name: npm install and test
run: |
npm ci
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v12.14.0
v12.22.0
2 changes: 1 addition & 1 deletion .storybook/stories/BackToTop.stories.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react'
import { Pets } from '@material-ui/icons'
import { Pets } from '@mui/icons-material'
import { withKnobs, select } from '@storybook/addon-knobs'
import BackToTop from '../../src/BackToTop'

Expand Down
2 changes: 1 addition & 1 deletion .storybook/stories/ExpandableSection.stories.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react'
import { withKnobs, text, boolean } from '@storybook/addon-knobs'
import ExpandableSection from '../../src/ExpandableSection'
import { Typography } from '@material-ui/core'
import { Typography } from '@mui/material'

export default { title: 'ExpandableSection', decorators: [withKnobs] }

Expand Down
5 changes: 4 additions & 1 deletion .storybook/stories/MediaCarousel.stories.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import React from 'react'
import { createMuiTheme, MuiThemeProvider } from '@material-ui/core/styles'
import {
createTheme as createMuiTheme,
ThemeProvider as MuiThemeProvider,
} from '@mui/material/styles'
import MediaCarousel from '../../src/carousel/MediaCarousel'

export default { title: 'MediaCarousel' }
Expand Down
2 changes: 1 addition & 1 deletion .storybook/stories/Offline.stories.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react'
import { Pets } from '@material-ui/icons'
import { Pets } from '@mui/icons-material'
import { withKnobs, text } from '@storybook/addon-knobs'
import Offline from '../../src/Offline'

Expand Down
2 changes: 1 addition & 1 deletion .storybook/stories/QuantitySelector.stories.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useState } from 'react'
import { ArrowDownward, ArrowUpward } from '@material-ui/icons'
import { ArrowDownward, ArrowUpward } from '@mui/icons-material'
import QuantitySelector from '../../src/QuantitySelector'

export default { title: 'QuantitySelector' }
Expand Down
2 changes: 1 addition & 1 deletion .storybook/stories/Rating.stories.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react'
import { Pets } from '@material-ui/icons'
import { Pets } from '@mui/icons-material'
import Rating from '../../src/Rating'

export default { title: 'Rating' }
Expand Down
2 changes: 1 addition & 1 deletion .storybook/stories/ToolbarButton.stories.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react'
import { Pets } from '@material-ui/icons'
import { Pets } from '@mui/icons-material'
import ToolbarButton from '../../src/ToolbarButton'

export default { title: 'ToolbarButton' }
Expand Down
29 changes: 29 additions & 0 deletions .swcrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"jsc": {
"parser": {
"syntax": "ecmascript",
"jsx": true,
"dynamicImport": false,
"privateMethod": false,
"functionBind": false,
"exportDefaultFrom": false,
"exportNamespaceFrom": false,
"decorators": false,
"decoratorsBeforeExport": false,
"topLevelAwait": false,
"importMeta": false
},
"transform": null,
"target": "es5",
"loose": false,
"externalHelpers": false,
"keepClassNames": false
},
"module": {
"type": "commonjs",
"strict": false,
"strictMode": true,
"lazy": false,
"noInterop": false
}
}
16 changes: 8 additions & 8 deletions babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,20 @@ module.exports = {
[
'babel-plugin-transform-imports',
{
'@material-ui/core': {
transform: '@material-ui/core/${member}',
'@mui/material': {
transform: '@mui/material/${member}',
preventFullImport: true,
},
'@material-ui/styles': {
transform: '@material-ui/styles/${member}',
'@mui/styles': {
transform: '@mui/styles/${member}',
preventFullImport: true,
},
'@material-ui/icons': {
transform: '@material-ui/icons/${member}',
'@mui/icons-material': {
transform: '@mui/icons-material/${member}',
preventFullImport: true,
},
'@material-ui/lab': {
transform: '@material-ui/lab/${member}',
'@mui/lab': {
transform: '@mui/lab/${member}',
preventFullImport: true,
},
},
Expand Down
4 changes: 2 additions & 2 deletions docs/buildDocs.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ const fs = require('fs')
const path = require('path')
const reactDocGen = require('react-docgen')
const documentation = require('documentation')
import { createMuiTheme } from '@material-ui/core/styles'
import getStylesCreator from '@material-ui/styles/getStylesCreator'
import { createTheme as createMuiTheme } from '@mui/material/styles'
import getStylesCreator from '@mui/styles/getStylesCreator'
import moduleParser from './moduleParser'
import globby from 'globby'

Expand Down
Loading

0 comments on commit 483d359

Please sign in to comment.