Skip to content

Commit 2ee2300

Browse files
authored
Update dependencies (#1105)
Noteworthy updates - Storybook v7 -> Storybook v8 - css-loader v6 -> v7 - http-proxy-middleware v2 -> v3
1 parent 46f6012 commit 2ee2300

File tree

8 files changed

+2469
-3891
lines changed

8 files changed

+2469
-3891
lines changed

.storybook/main.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,16 @@ import webpackConfig from './webpack';
33
export default {
44
stories: ['../stories/**/*.stories.tsx'],
55
webpackFinal: config => webpackConfig(config),
6-
addons: ['@storybook/addon-essentials'],
6+
addons: ['@storybook/addon-essentials', '@storybook/addon-webpack5-compiler-babel'],
77
framework: {
88
name: '@storybook/react-webpack5',
99
options: {}
1010
},
11+
// Storybook 8 changed the default component analysis tool from react-docgen-typescript to react-docgen.
12+
// This has caused problems with the building of our stories; so the `typescript` below opts out of this change.
13+
typescript: {
14+
reactDocgen: "react-docgen-typescript",
15+
},
1116
core: {
1217
disableTelemetry: true, // 👈 Disables telemetry
1318
}

.storybook/manager.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import { addons } from '@storybook/addons';
1+
import { addons } from '@storybook/manager-api';
2+
23
import { create as createTheme } from '@storybook/theming/create';
34

45
const ensemblTheme = createTheme({

.storybook/webpack.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ export default (config) => {
2929
sourceMap: true,
3030
modules: {
3131
auto: true, // will match all files with a pattern /\.module\.\w+$/
32-
localIdentName: '[local]__[name]__[hash:base64:5]'
32+
localIdentName: '[local]__[name]__[hash:base64:5]',
33+
namedExport: false, // since v 7.0 it is true by default, should we refactor our code to "import * as styles ..."?
34+
exportLocalsConvention: 'as-is', // consequence of using `namedExport: false` (the loader in this mode also camel-cases css class names). If namedExports were true, this field wouldn't have been needed
3335
}
3436
}
3537
},

package-lock.json

Lines changed: 2396 additions & 3831 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 44 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -32,73 +32,73 @@
3232
"dependencies": {
3333
"@ensembl/ensembl-genome-browser": "0.6.10",
3434
"@react-spring/web": "9.7.3",
35-
"@reduxjs/toolkit": "2.2.1",
36-
"@sentry/browser": "7.105.0",
35+
"@reduxjs/toolkit": "2.2.3",
36+
"@sentry/browser": "7.110.1",
37+
"@storybook/addon-essentials": "8.0.8",
3738
"classnames": "2.5.1",
3839
"comlink": "4.4.1",
39-
"core-js": "3.36.0",
40-
"d3": "7.8.5",
41-
"express": "4.18.3",
42-
"filesize": "10.1.0",
40+
"core-js": "3.37.0",
41+
"d3": "7.9.0",
42+
"express": "4.19.2",
43+
"filesize": "10.1.1",
4344
"graphql": "16.8.1",
4445
"graphql-request": "6.1.0",
45-
"http-proxy-middleware": "2.0.6",
46+
"http-proxy-middleware": "3.0.0",
4647
"idb": "8.0.0",
4748
"jszip": "3.10.1",
4849
"lodash": "4.17.21",
4950
"react": "18.3.0-next-0ffc7f632-20230330",
5051
"react-dom": "18.3.0-next-0ffc7f632-20230330",
51-
"react-redux": "9.1.0",
52-
"react-router": "6.22.2",
53-
"react-router-dom": "6.22.2",
52+
"react-redux": "9.1.1",
53+
"react-router": "6.22.3",
54+
"react-router-dom": "6.22.3",
5455
"redux": "5.0.1",
5556
"redux-observable": "3.0.0-rc.2",
5657
"redux-thunk": "3.1.0",
5758
"rxjs": "7.8.1"
5859
},
5960
"devDependencies": {
60-
"@babel/core": "7.24.0",
61-
"@babel/plugin-transform-modules-commonjs": "7.23.3",
62-
"@babel/preset-env": "7.24.0",
63-
"@babel/preset-react": "7.23.3",
64-
"@babel/preset-typescript": "7.23.3",
61+
"@babel/core": "7.24.4",
62+
"@babel/plugin-transform-modules-commonjs": "7.24.1",
63+
"@babel/preset-env": "7.24.4",
64+
"@babel/preset-react": "7.24.1",
65+
"@babel/preset-typescript": "7.24.1",
6566
"@faker-js/faker": "8.4.1",
66-
"@storybook/addon-essentials": "7.6.17",
67-
"@storybook/addons": "7.6.17",
68-
"@storybook/react": "7.6.17",
69-
"@storybook/react-webpack5": "7.6.17",
70-
"@storybook/theming": "7.6.17",
67+
"@storybook/addon-webpack5-compiler-babel": "3.0.3",
68+
"@storybook/manager-api": "8.0.8",
69+
"@storybook/react": "8.0.8",
70+
"@storybook/react-webpack5": "8.0.8",
71+
"@storybook/theming": "8.0.8",
7172
"@svgr/webpack": "8.1.0",
7273
"@testing-library/jest-dom": "6.4.2",
73-
"@testing-library/react": "14.2.1",
74+
"@testing-library/react": "15.0.2",
7475
"@testing-library/user-event": "14.5.2",
7576
"@types/d3": "7.4.3",
7677
"@types/express": "4.17.21",
7778
"@types/jest": "29.5.12",
78-
"@types/lodash": "4.14.202",
79-
"@types/node": "20.11.25",
80-
"@types/prettier": "3.0.0",
81-
"@types/react": "18.2.64",
82-
"@types/react-dom": "18.2.20",
79+
"@types/lodash": "4.17.0",
80+
"@types/node": "20.12.7",
81+
"@types/react": "18.2.79",
82+
"@types/react-dom": "18.2.25",
8383
"@types/react-redux": "7.1.33",
8484
"@types/react-router-dom": "5.3.3",
8585
"@types/webpack-env": "1.18.4",
8686
"@types/webpack-hot-middleware": "2.25.9",
8787
"@types/webpack-node-externals": "3.0.4",
88-
"@typescript-eslint/eslint-plugin": "7.1.1",
89-
"@typescript-eslint/parser": "7.1.1",
88+
"@typescript-eslint/eslint-plugin": "7.5.0",
89+
"@typescript-eslint/parser": "7.5.0",
9090
"babel-jest": "29.7.0",
9191
"babel-loader": "9.1.3",
9292
"babel-plugin-react-remove-properties": "0.3.0",
9393
"compression-webpack-plugin": "11.1.0",
9494
"copy-webpack-plugin": "12.0.2",
95-
"css-loader": "6.10.0",
95+
"css-loader": "7.1.1",
9696
"css-minimizer-webpack-plugin": "6.0.0",
9797
"eslint": "8.57.0",
9898
"eslint-config-prettier": "9.1.0",
9999
"eslint-plugin-jest": "27.9.0",
100100
"eslint-plugin-prettier": "5.1.3",
101-
"eslint-plugin-react": "7.34.0",
101+
"eslint-plugin-react": "7.34.1",
102102
"eslint-plugin-react-hooks": "4.6.0",
103103
"fake-indexeddb": "5.0.2",
104104
"fork-ts-checker-webpack-plugin": "9.0.2",
@@ -110,29 +110,29 @@
110110
"jest-transform-stub": "2.0.0",
111111
"licence-manager": "git+https://github.com/Ensembl/ensembl-licence-manager.git#36b534d28ff26d345b4ba4da0cbc18e1e0f7a6b7",
112112
"lint-staged": "15.2.2",
113-
"mini-css-extract-plugin": "2.8.1",
114-
"msw": "2.2.2",
113+
"mini-css-extract-plugin": "2.9.0",
114+
"msw": "2.2.14",
115115
"nodemon": "3.1.0",
116-
"postcss": "8.4.35",
116+
"postcss": "8.4.38",
117117
"postcss-loader": "8.1.1",
118-
"postcss-preset-env": "9.5.0",
118+
"postcss-preset-env": "9.5.5",
119119
"prettier": "3.2.5",
120120
"rimraf": "5.0.5",
121121
"source-map-loader": "5.0.0",
122-
"storybook": "7.6.17",
123-
"style-loader": "3.3.4",
124-
"stylelint": "16.2.1",
122+
"storybook": "8.0.8",
123+
"style-loader": "4.0.0",
124+
"stylelint": "16.3.1",
125125
"stylelint-config-standard": "36.0.0",
126126
"stylelint-webpack-plugin": "5.0.0",
127127
"terser-webpack-plugin": "5.3.10",
128128
"ts-multipick": "1.0.0",
129129
"ts-node": "10.9.2",
130-
"typescript": "5.4.2",
131-
"webpack": "5.90.3",
132-
"webpack-bundle-analyzer": "4.10.1",
130+
"typescript": "5.4.5",
131+
"webpack": "5.91.0",
132+
"webpack-bundle-analyzer": "4.10.2",
133133
"webpack-cli": "5.1.4",
134-
"webpack-dev-middleware": "7.0.0",
135-
"webpack-dev-server": "5.0.2",
134+
"webpack-dev-middleware": "7.2.1",
135+
"webpack-dev-server": "5.0.4",
136136
"webpack-manifest-plugin": "5.0.0",
137137
"webpack-merge": "5.10.0",
138138
"webpack-node-externals": "3.0.0",
@@ -142,8 +142,8 @@
142142
"msw": {
143143
"typescript": "$typescript"
144144
},
145-
"react": "$react",
146-
"react-dom": "$react-dom"
145+
"react": "18.3.0-next-0ffc7f632-20230330",
146+
"react-dom": "18.3.0-next-0ffc7f632-20230330"
147147
},
148148
"browserslist": [
149149
"> 1% and last 2 versions",

src/server/middleware/proxyMiddleware.ts

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,15 @@ const serverConfig = getConfigForServer();
3333
* while directing requests for the genome browser backend to your locally running server,
3434
* change the body of the createApiProxyMiddleware function as follows:
3535
36-
const apiProxyMiddleware = createHttpProxyMiddleware(
37-
['/api/**', '!/api/browser/**'],
38-
{
39-
target: 'https://staging-2020.ensembl.org',
40-
changeOrigin: true,
41-
secure: false
42-
}
43-
);
36+
const apiProxyMiddleware = createHttpProxyMiddleware({
37+
pathFilter: ['/api/**', '!/api/browser/**'],
38+
target: 'https://staging-2020.ensembl.org',
39+
changeOrigin: true,
40+
secure: false
41+
});
4442
45-
const browserProxyMiddleware = createHttpProxyMiddleware('/api/browser/**', {
43+
const browserProxyMiddleware = createHttpProxyMiddleware({
44+
pathFilter: '/api/browser/**',
4645
target: 'http://localhost:3333',
4746
pathRewrite: {
4847
'^/api/browser': '/api' // rewrite path
@@ -55,7 +54,8 @@ const serverConfig = getConfigForServer();
5554
*/
5655

5756
const createApiProxyMiddleware = () => {
58-
const apiProxyMiddleware = createHttpProxyMiddleware('/api', {
57+
const apiProxyMiddleware = createHttpProxyMiddleware({
58+
pathFilter: '/api',
5959
target: 'https://staging-2020.ensembl.org',
6060
changeOrigin: true,
6161
secure: false
@@ -68,7 +68,8 @@ const createApiProxyMiddleware = () => {
6868

6969
const createStaticAssetsMiddleware = () => {
7070
// proxy all requests for static assets to the server that runs webpack dev middleware
71-
return createHttpProxyMiddleware('/static', {
71+
return createHttpProxyMiddleware({
72+
pathFilter: '/static',
7273
target: 'http://localhost:8081'
7374
});
7475
};

webpack/client/common.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,9 @@ export default (env: Record<string, unknown>): Configuration => {
5656
modules: {
5757
auto: true, // will match all files with a pattern /\.module\.\w+$/
5858
localIdentName: '[local]__[name]__[hash:base64:5]',
59-
getLocalIdent: buildClassName
59+
getLocalIdent: buildClassName,
60+
namedExport: false, // since v 7.0 it is true by default, should we refactor our code to "import * as styles ..."?
61+
exportLocalsConvention: 'as-is' // consequence of using `namedExport: false` (the loader in this mode also camel-cases css class names). If namedExports were true, this field wouldn't have been needed
6062
}
6163
}
6264
},

webpack/server/common.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,9 @@ export default (): Configuration => {
5757
modules: {
5858
auto: true, // will match all files with a pattern /\.module\.\w+$/
5959
localIdentName: '[local]__[name]__[hash:base64:5]',
60-
getLocalIdent: buildClassName
60+
getLocalIdent: buildClassName,
61+
namedExport: false, // since v 7.0 it is true by default, should we refactor our code to "import * as styles ..."?
62+
exportLocalsConvention: 'as-is' // consequence of using `namedExport: false` (the loader in this mode also camel-cases css class names). If namedExports were true, this field wouldn't have been needed
6163
}
6264
}
6365
},

0 commit comments

Comments
 (0)