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

Upgrade to MUI v5, mobx-state-tree v5, mobx-react v6, mobx-react v7 #2949

Merged
merged 104 commits into from
Jun 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
104 commits
Select commit Hold shift + click to select a range
060526a
T1
cmdcolin Apr 10, 2022
161bb35
Incremental
cmdcolin Apr 10, 2022
23d9054
Incremental
cmdcolin Apr 10, 2022
b708563
Remove styled engine
cmdcolin Apr 10, 2022
d37a34c
WIP
cmdcolin Apr 18, 2022
6149356
Misc updates
cmdcolin Apr 19, 2022
8e90c60
T1
cmdcolin Apr 19, 2022
7807a6d
More replacements
cmdcolin Apr 19, 2022
4c03acc
Restore re-exports
cmdcolin Apr 19, 2022
c209f89
Try to add some plugin back-compat
cmdcolin Apr 19, 2022
c9ad26f
Add a querySelectorAll do-nothing stub to avoid crash
cmdcolin Apr 19, 2022
628cbb8
Add mui/styles to peerdeps
cmdcolin May 11, 2022
9ddb7df
Fix lint
cmdcolin May 11, 2022
9b71f07
Remove adaptV4Theme
cmdcolin May 11, 2022
498c73f
Remove adaptV4Theme
cmdcolin May 11, 2022
61cd6af
Bump demo yarn.locks
cmdcolin May 11, 2022
0add31c
More style fixes
cmdcolin May 11, 2022
d3c25f1
Fix trackselector look and feel
cmdcolin May 11, 2022
1abba7c
Restore variant dense toolbar
cmdcolin May 11, 2022
eb15897
Require using dense on the MenuList component itself instead of theme…
cmdcolin May 11, 2022
7aba9e3
Fix refnameautocomplete crash
cmdcolin May 11, 2022
ee66084
Use compact setting on data-grid, standardize accordion timeout:150
cmdcolin May 11, 2022
4ff4b01
Smaller icons viewcontainer
cmdcolin May 11, 2022
2f8f8fc
Smaller refnameautocomplete icons
cmdcolin May 11, 2022
86f6ec2
Run format
cmdcolin May 11, 2022
5731502
Remove merge conflict yarn.lock
cmdcolin May 11, 2022
dbf7b9b
Smaller minicontrols
cmdcolin May 11, 2022
e257b2f
Smaller tracklabel icons
cmdcolin May 11, 2022
388947b
Updates
cmdcolin May 11, 2022
e72df56
Fix some theme tests
cmdcolin May 11, 2022
92ebf2f
Theme typescript
cmdcolin May 15, 2022
6697597
More typescripting
cmdcolin May 15, 2022
478d866
More typescripting
cmdcolin May 15, 2022
d0973f0
More typescripting
cmdcolin May 15, 2022
0710f94
More typescripting
cmdcolin May 15, 2022
b5262c0
More typescripting
cmdcolin May 15, 2022
8ea4381
Have to use important on the embedded viewcontainer
cmdcolin May 15, 2022
848bcd1
T1
cmdcolin May 15, 2022
be24f22
Merge origin/main
cmdcolin May 20, 2022
769243a
Update deps
cmdcolin May 22, 2022
3499ea7
Merge origin/main
cmdcolin Jun 7, 2022
3918423
Bump deps
cmdcolin Jun 7, 2022
5cda502
Better working styles with tss-react
cmdcolin Jun 9, 2022
979180b
Rest of components
cmdcolin Jun 9, 2022
7549f1f
Move some of the scrollbar styling into web/desktop specific css
cmdcolin Jun 9, 2022
b948809
Run lint
cmdcolin Jun 9, 2022
9ecc333
Add peerDep on tss-react
cmdcolin Jun 9, 2022
9ab3880
Note about editabletypography passing props to useStyles being a ts-i…
cmdcolin Jun 9, 2022
68c6662
Back down to react 17, can still use types 18
cmdcolin Jun 9, 2022
7899468
Merge origin/main
cmdcolin Jun 9, 2022
8701426
Cleanup merge
cmdcolin Jun 9, 2022
751e080
Smaller menu
cmdcolin Jun 9, 2022
6f71ef3
Remove unused tsc that caused error
cmdcolin Jun 9, 2022
95d6c38
Fix css styling
cmdcolin Jun 9, 2022
a251f8a
Bump yarn.lock
cmdcolin Jun 9, 2022
979407b
Simplify some theme tsc
cmdcolin Jun 9, 2022
21fdb89
Use react 17 for component test
cmdcolin Jun 9, 2022
264cc35
Remove @mui/lab, was generating odd forwardRef errors and likely not …
cmdcolin Jun 9, 2022
6495fb4
Fix deprecations warning during build and desktop styles
cmdcolin Jun 9, 2022
86b35c4
try 16
cmdcolin Jun 9, 2022
c6c3b9b
Use main alert instead of lab
cmdcolin Jun 9, 2022
7d2f543
Merge origin/main
cmdcolin Jun 9, 2022
52ce393
Remove @mui/lab completely from codebase
cmdcolin Jun 9, 2022
8346fe6
Updates to fix styling on embedded component
cmdcolin Jun 9, 2022
8c046b2
Add comment about muiCache
cmdcolin Jun 9, 2022
7c25412
Tsc in component_test
cmdcolin Jun 9, 2022
e13fafc
Remove @mui/styles
cmdcolin Jun 9, 2022
ea35d30
ReExport as @material/core names
cmdcolin Jun 9, 2022
a18a4c7
Increase timeout
cmdcolin Jun 9, 2022
d5e1a49
Merge origin/main
cmdcolin Jun 11, 2022
e15b22d
Convert svinspector to typescript
cmdcolin Jun 11, 2022
701e1a5
Merge origin/main
cmdcolin Jun 11, 2022
97d3ced
Fix all the icons getting bundled
cmdcolin Jun 12, 2022
6f9cfba
Merge origin/main
cmdcolin Jun 13, 2022
977efec
Small refactor
cmdcolin Jun 14, 2022
84bbc90
Merge origin/main
cmdcolin Jun 14, 2022
e333a8b
Merge origin/main
cmdcolin Jun 15, 2022
f363ef3
Merge mui5_react18
cmdcolin Jun 15, 2022
a8e3898
Merge smaller_bundle_mui5
cmdcolin Jun 15, 2022
1dc341a
Add fixes for jest 28
cmdcolin Jun 15, 2022
ad7ce77
More ReExports
cmdcolin Jun 15, 2022
7eae89b
Remove some ts-ignore
cmdcolin Jun 16, 2022
9045fc1
Merge origin/main
cmdcolin Jun 17, 2022
7143d23
Add patch for theme from @garrettjstevens"
cmdcolin Jun 17, 2022
7ce52a8
Fix missing reexport for mui/list
cmdcolin Jun 17, 2022
65b3295
Merge origin/main
cmdcolin Jun 17, 2022
caec613
Add missing avatar export
cmdcolin Jun 17, 2022
1715449
Support multiple styles of theme specification
cmdcolin Jun 18, 2022
7c778c4
Restore ts-loader for storybook
cmdcolin Jun 18, 2022
8b14bcc
Adapt makeStyles from tss-react to reexports better
cmdcolin Jun 18, 2022
3eca95f
Add alpha reexport
cmdcolin Jun 21, 2022
8107ccb
Re-export the tss-react makestyles
cmdcolin Jun 21, 2022
221006c
Update packages/core/ReExports/modules.tsx
cmdcolin Jun 21, 2022
c5654aa
Merge origin/main
cmdcolin Jun 21, 2022
6daa868
Merge origin/main
cmdcolin Jun 21, 2022
e87be98
Use lgv tick display str for the svg export
cmdcolin Jun 21, 2022
fc2d830
Merge origin/main
cmdcolin Jun 21, 2022
4769629
Use rowHeight instead of density=compact
cmdcolin Jun 21, 2022
04b4893
Merge origin/main
cmdcolin Jun 23, 2022
e9e9662
Couple more lab re-exports
cmdcolin Jun 23, 2022
88843f4
Minor cleanup
cmdcolin Jun 23, 2022
93c8102
Update aliases
cmdcolin Jun 23, 2022
026e66d
Avoid trying to do modifications tag fetch on too large of region
cmdcolin Jun 23, 2022
e317fc2
Keep drawing things in small spaces insertion
cmdcolin Jun 23, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@
"monorepo/no-internal-import": "off",
"prettier/prettier": "warn",
"react/no-danger": "warn",
"react/prop-types": "off",
"react/destructuring-assignment": "error",
"react/no-unused-prop-types": "error",
"react/no-unused-state": "error",
"react/prefer-stateless-function": "error",
"react/prop-types": "error",
"spaced-comment": [
"error",
"always",
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,14 @@ jobs:
cd website/
yarn build
buildwholerepo:
name: Build whole repo on node 14 and ubuntu-latest
name: Build whole repo on node 16 and ubuntu-latest
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js 14
- name: Use Node.js 16
uses: actions/setup-node@v2
with:
node-version: '14'
node-version: '16'
- name: Install deps (with cache)
uses: bahmutov/npm-install@v1
- name: Build codebase
Expand Down
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

node scripts/pre-commit.js
1 change: 1 addition & 0 deletions component_test/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ machine, try:
```
yarn build # running build from root of the repo copies files to component_test/packed
cd component_test
rm -f yarn.lock
rm -rf node_modules
yarn cache clean
yarn
Expand Down
2 changes: 1 addition & 1 deletion component_test/cypress/integration/basic.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ describe('JBrowse embedded view', () => {
cy.visit('/')
// eslint-disable-next-line testing-library/await-async-query,testing-library/prefer-screen-queries
cy.findByTestId('Blockset-pileup').findByTestId(
'prerendered_canvas_{GRCh38}10:29,838,733..29,838,818-0',
'prerendered_canvas_{GRCh38}10:29,838,733..29,838,818-0_done',
{ timeout: 10000 },
)
})
Expand Down
4 changes: 2 additions & 2 deletions component_test/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
"@types/react-dom": "^17.0.15",
"cypress": "^9.2.1",
"node-polyfill-webpack-plugin": "^1.1.4",
"react": "^18.0.0",
"react-dom": "^18.0.0",
"react": "^17.0.0",
"react-dom": "^17.0.0",
"react-scripts": "^5.0.1",
"serve": "^13.0.2",
"start-server-and-test": "^1.14.0",
Expand Down
2 changes: 1 addition & 1 deletion component_test/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ function View() {
assembly,
tracks,
location: '10:29,838,655..29,838,737',
onChange: patch => {
onChange: (patch: unknown) => {
setPatches(previous => previous + JSON.stringify(patch) + '\n')
},
defaultSession,
Expand Down
23 changes: 23 additions & 0 deletions config/jest/console.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,31 @@ jest.spyOn(console, 'error').mockImplementation((...args) => {
if (String(args[0]).includes('volvox.2bit_404')) {
return undefined
}

if (String(args).includes('popupState')) {
return undefined
}

if (String(args).includes('hydrateRoot')) {
return undefined
}

if (
String(args).includes('A suspended resource finished loading inside a test')
) {
return undefined
}

if (String(args).includes('was not wrapped in act')) {
return undefined
}
if (
String(args).includes(
'attempting to unmount was rendered by another copy of React',
)
) {
return undefined
}

return originalError.call(console, ...args)
})
2 changes: 1 addition & 1 deletion config/jest/cssTransform.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

module.exports = {
process() {
return 'module.exports = {};'
return { code: 'module.exports = {};' }
},
getCacheKey() {
// The output is always the same.
Expand Down
8 changes: 5 additions & 3 deletions config/jest/fileTransform.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ module.exports = {
const assetFilename = JSON.stringify(path.basename(filename))

if (filename.match(/\.svg$/)) {
return `module.exports = {
return {
code: `module.exports = {
__esModule: true,
default: ${assetFilename},
ReactComponent: (props) => ({
Expand All @@ -22,9 +23,10 @@ module.exports = {
children: ${assetFilename}
})
}),
};`
};`,
}
}

return `module.exports = ${assetFilename};`
return { code: `module.exports = ${assetFilename};` }
},
}
7 changes: 7 additions & 0 deletions config/jest/textEncoder.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { TextEncoder, TextDecoder } from 'web-encoding'
if (!global.TextEncoder) {
global.TextEncoder = TextEncoder
}
if (!global.TextDecoder) {
global.TextDecoder = TextDecoder
}
4 changes: 4 additions & 0 deletions demos/jbrowse-react-circular-genome-view-vanillajs/yarn.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1


4 changes: 4 additions & 0 deletions demos/jbrowse-react-linear-genome-view-vanillajs/yarn.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1


3 changes: 2 additions & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,13 @@ module.exports = {
],
coveragePathIgnorePatterns: ['!*.d.ts', 'makeWorkerInstance.ts'],
setupFiles: [
'<rootDir>/config/jest/textEncoder.js',
'<rootDir>/config/jest/createRange.js',
'<rootDir>/config/jest/fetchMock.js',
'<rootDir>/config/jest/console.js',
'<rootDir>/config/jest/crypto.js',
'jest-localstorage-mock',
],
testURL: 'http://localhost',
testEnvironmentOptions: { url: 'http://localhost' },
testEnvironment: 'jsdom',
}
54 changes: 25 additions & 29 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,8 @@
"pretest-ci": "cd products/jbrowse-react-linear-genome-view;yarn build;cd ../../",
"test-ci": "cross-env NODE_OPTIONS='--max-old-space-size=7000' jest --ci --coverage && jest --env node --testMatch '**/*testmod.js'",
"built-test-ci": "jest --ci integration.test.js",
"test": "jest"
},
"husky": {
"hooks": {
"pre-commit": "node scripts/pre-commit.js"
}
"test": "jest",
"prepare": "husky install"
},
"devDependencies": {
"@babel/cli": "^7.2.3",
Expand All @@ -37,7 +33,10 @@
"@babel/preset-react": "^7.0.0",
"@babel/preset-typescript": "^7.3.3",
"@craco/craco": "^6.4.3",
"@material-ui/core": "^4.12.2",
"@emotion/cache": "^11.7.1",
"@emotion/react": "^11.9.0",
"@emotion/styled": "^11.8.1",
"@mui/material": "^5.0.0",
"@oclif/dev-cli": "^1.26.9",
"@oclif/test": "^1.2.7",
"@storybook/addon-actions": "^6.5.0",
Expand All @@ -48,7 +47,7 @@
"@storybook/manager-webpack5": "^6.5.0",
"@storybook/react": "^6.5.0",
"@testing-library/jest-dom": "^5.16.1",
"@testing-library/react": "^12.1.2",
"@testing-library/react": "^13.3.0",
"@types/base64-js": "^1.2.5",
"@types/buffer-crc32": "^0.2.0",
"@types/cli-progress": "^3.9.2",
Expand Down Expand Up @@ -76,15 +75,15 @@
"@types/node": "^14.14.0",
"@types/node-fetch": "^2.5.7",
"@types/normalize-wheel": "^1.0.0",
"@types/object.fromentries": "^2.0.0",
"@types/object.fromentries": "^2.0.1",
"@types/offscreencanvas": "^2019.6.4",
"@types/pako": "^1.0.1",
"@types/pluralize": "^0.0.29",
"@types/range-parser": "^1.2.3",
"@types/rbush": "^3.0.0",
"@types/react": "^17.0.0",
"@types/react": "^18.0.0",
"@types/react-color": "^3.0.4",
"@types/react-dom": "^17.0.0",
"@types/react-dom": "^18.0.0",
"@types/react-virtualized-auto-sizer": "^1.0.0",
"@types/rimraf": "^3.0.2",
"@types/set-value": "^2.0.0",
Expand All @@ -97,13 +96,13 @@
"babel-loader": "^8.2.5",
"canvas": "^2.9.1",
"chai": "^4.3.4",
"concurrently": "^6.4.0",
"concurrently": "^7.2.1",
"core-js": "^3.19.3",
"cross-env": "^7.0.2",
"cross-spawn": "^7.0.1",
"dependency-graph": "^0.9.0",
"electron": "18.2.4",
"electron-builder": "^22.14.5",
"dependency-graph": "^0.11.0",
"electron": "19.0.4",
"electron-builder": "^23.0.3",
"electron-mock-ipc": "^0.3.8",
"electron-notarize": "^1.0.0",
"eslint-config-prettier": "^8.5.0",
Expand All @@ -114,18 +113,19 @@
"eslint-plugin-react-hooks": "^4.3.0",
"eslint-plugin-tsdoc": "^0.2.4",
"file-loader": "^6.2.0",
"find-yarn-workspace-root": "^1.2.1",
"find-yarn-workspace-root": "^2.0.0",
"get-yarn-workspaces": "^1.0.2",
"husky": "^4.2.5",
"jest": "^27.0.0",
"husky": "^8.0.0",
"jest": "^28.1.1",
"jest-environment-jsdom": "^28.0.0",
"jest-fetch-mock": "^3.0.3",
"jest-image-snapshot": "^4.5.1",
"jest-image-snapshot": "^5.1.0",
"jest-localstorage-mock": "^2.4.3",
"lerna": "^4.0.0",
"lerna": "^5.1.2",
"lerna-changelog": "^2.2.0",
"mobx": "^5.0.0",
"mobx-react": "^6.0.0",
"mobx-state-tree": "3.14.1",
"mobx": "^6.0.0",
"mobx-react": "^7.0.0",
"mobx-state-tree": "^5.0.0",
"nock": "^13.2.1",
"node-polyfill-webpack-plugin": "^1.1.4",
"npm-run-all": "^4.1.5",
Expand All @@ -136,7 +136,7 @@
"rimraf": "^3.0.2",
"rxjs": "^6.0.0",
"semver": "^7.3.4",
"ts-loader": "^8.0.0",
"ts-loader": "^9.3.0",
"ts-node": "^10.4.0",
"tslib": "^2.0.1",
"typescript": "^4.7.0",
Expand All @@ -146,9 +146,5 @@
"webpack-dev-server": "^4.7.3"
},
"version": "0.0.0",
"dependencies": {},
"resolutions": {
"@types/react": "^17.0.0",
"webpack": "5.70.0"
}
"dependencies": {}
}
8 changes: 2 additions & 6 deletions packages/__mocks__/@testing-library/react.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
import { StylesProvider } from '@material-ui/core/styles'
import { createTheme, ThemeProvider } from '@mui/material/styles'
// eslint-disable-next-line import/no-extraneous-dependencies
import React from 'react'

const react = jest.requireActual('@testing-library/react')
const generateClassName = (rule, styleSheet) =>
`${styleSheet.options.classNamePrefix}-${rule.key}`
const render = args => {
return react.render(
<StylesProvider generateClassName={generateClassName}>
{args}
</StylesProvider>,
<ThemeProvider theme={createTheme()}>{args}</ThemeProvider>,
)
}

Expand Down
Loading