From f6b61d005f480631296f167b12f4273b8f9b5cd1 Mon Sep 17 00:00:00 2001 From: kaloster Date: Wed, 17 Jan 2024 11:24:05 -0500 Subject: [PATCH 1/2] chore(explorer): enable safari fix browser page --- .../webpack/SUPPORTED_BROWSERS_REGEX.js | 2 +- .../webpack/obsoleteHTMLTemplate.html | 41 ++++++++++-------- .../webpack/webpack.config.dev.js | 10 ++--- .../webpack/webpack.config.prod.js | 6 +-- client/index.html | 2 +- client/index_template.html | 2 +- client/package.json | 4 +- client/src/assets/img/cellxgene.png | Bin 0 -> 13140 bytes client/src/assets/img/chrome.png | Bin 0 -> 122169 bytes client/src/assets/img/edge.png | Bin 0 -> 144710 bytes client/src/assets/img/firefox.png | Bin 0 -> 406046 bytes client/src/assets/img/safari.png | Bin 0 -> 241473 bytes client/src/index.tsx | 6 +++ 13 files changed, 39 insertions(+), 34 deletions(-) create mode 100644 client/src/assets/img/cellxgene.png create mode 100644 client/src/assets/img/chrome.png create mode 100644 client/src/assets/img/edge.png create mode 100644 client/src/assets/img/firefox.png create mode 100644 client/src/assets/img/safari.png diff --git a/client/configuration/webpack/SUPPORTED_BROWSERS_REGEX.js b/client/configuration/webpack/SUPPORTED_BROWSERS_REGEX.js index f7a362251..fedd9a005 100644 --- a/client/configuration/webpack/SUPPORTED_BROWSERS_REGEX.js +++ b/client/configuration/webpack/SUPPORTED_BROWSERS_REGEX.js @@ -1 +1 @@ -module.exports = /((CPU[ +]OS|iPhone[ +]OS|CPU[ +]iPhone|CPU IPhone OS)[ +]+(10[_.]3|10[_.]([4-9]|\d{2,})|(1[1-9]|[2-9]\d|\d{3,})[_.]\d+|11[_.]0|11[_.]([1-9]|\d{2,})|11[_.]2|11[_.]([3-9]|\d{2,})|(1[2-9]|[2-9]\d|\d{3,})[_.]\d+|12[_.]0|12[_.]([1-9]|\d{2,})|12[_.]5|12[_.]([6-9]|\d{2,})|(1[3-9]|[2-9]\d|\d{3,})[_.]\d+|13[_.]0|13[_.]([1-9]|\d{2,})|13[_.]7|13[_.]([8-9]|\d{2,})|(1[4-9]|[2-9]\d|\d{3,})[_.]\d+|14[_.]0|14[_.]([1-9]|\d{2,})|14[_.]4|14[_.]([5-9]|\d{2,})|14[_.]8|14[_.](9|\d{2,})|(1[5-9]|[2-9]\d|\d{3,})[_.]\d+|15[_.]0|15[_.]([1-9]|\d{2,})|(1[6-9]|[2-9]\d|\d{3,})[_.]\d+|16[_.]0|16[_.]([1-9]|\d{2,})|(1[7-9]|[2-9]\d|\d{3,})[_.]\d+|17[_.]0|17[_.]([1-9]|\d{2,})|(1[8-9]|[2-9]\d|\d{3,})[_.]\d+)(?:[_.]\d+)?)|(CFNetwork\/8.* Darwin\/16\.5\.\d+)|(CFNetwork\/8.* Darwin\/16\.6\.\d+)|(CFNetwork\/8.* Darwin\/16\.7\.\d+)|(CFNetwork\/8.* Darwin\/17\.0\.\d+)|(CFNetwork\/8.* Darwin\/17\.2\.\d+)|(CFNetwork\/8.* Darwin\/17\.3\.\d+)|(CFNetwork\/8.* Darwin\/17\.\d+)|(Edge\/(79(?:\.0)?|79(?:\.([1-9]|\d{2,}))?|([8-9]\d|\d{3,})(?:\.\d+)?|83(?:\.0)?|83(?:\.([1-9]|\d{2,}))?|(8[4-9]|9\d|\d{3,})(?:\.\d+)?))|((Chromium|Chrome)\/(61\.0|61\.([1-9]|\d{2,})|(6[2-9]|[7-9]\d|\d{3,})\.\d+|83\.0|83\.([1-9]|\d{2,})|(8[4-9]|9\d|\d{3,})\.\d+)(?:\.\d+)?)|(Firefox\/(60\.0|60\.([1-9]|\d{2,})|(6[1-9]|[7-9]\d|\d{3,})\.\d+)\.\d+)|(Firefox\/(60\.0|60\.([1-9]|\d{2,})|(6[1-9]|[7-9]\d|\d{3,})\.\d+)(pre|[ab]\d+[a-z]*)?)/; +module.exports = /((CPU[ +]OS|iPhone[ +]OS|CPU[ +]iPhone|CPU IPhone OS)[ +]+(10[_.]3|10[_.]([4-9]|\d{2,})|(1[1-9]|[2-9]\d|\d{3,})[_.]\d+|11[_.]0|11[_.]([1-9]|\d{2,})|11[_.]2|11[_.]([3-9]|\d{2,})|(1[2-9]|[2-9]\d|\d{3,})[_.]\d+|12[_.]0|12[_.]([1-9]|\d{2,})|12[_.]5|12[_.]([6-9]|\d{2,})|(1[3-9]|[2-9]\d|\d{3,})[_.]\d+|13[_.]0|13[_.]([1-9]|\d{2,})|13[_.]7|13[_.]([8-9]|\d{2,})|(1[4-9]|[2-9]\d|\d{3,})[_.]\d+|14[_.]0|14[_.]([1-9]|\d{2,})|14[_.]4|14[_.]([5-9]|\d{2,})|14[_.]8|14[_.](9|\d{2,})|(1[5-9]|[2-9]\d|\d{3,})[_.]\d+|15[_.]0|15[_.]([1-9]|\d{2,})|(1[6-9]|[2-9]\d|\d{3,})[_.]\d+|16[_.]0|16[_.]([1-9]|\d{2,})|(1[7-9]|[2-9]\d|\d{3,})[_.]\d+|17[_.]0|17[_.]([1-9]|\d{2,})|(1[8-9]|[2-9]\d|\d{3,})[_.]\d+)(?:[_.]\d+)?)|(CFNetwork\/8.* Darwin\/16\.5\.\d+)|(CFNetwork\/8.* Darwin\/16\.6\.\d+)|(CFNetwork\/8.* Darwin\/16\.7\.\d+)|(CFNetwork\/8.* Darwin\/17\.0\.\d+)|(CFNetwork\/8.* Darwin\/17\.2\.\d+)|(CFNetwork\/8.* Darwin\/17\.3\.\d+)|(CFNetwork\/8.* Darwin\/17\.\d+)|(Edge\/(79(?:\.0)?|79(?:\.([1-9]|\d{2,}))?|([8-9]\d|\d{3,})(?:\.\d+)?|83(?:\.0)?|83(?:\.([1-9]|\d{2,}))?|(8[4-9]|9\d|\d{3,})(?:\.\d+)?))|((Chromium|Chrome)\/(61\.0|61\.([1-9]|\d{2,})|(6[2-9]|[7-9]\d|\d{3,})\.\d+|83\.0|83\.([1-9]|\d{2,})|(8[4-9]|9\d|\d{3,})\.\d+)(?:\.\d+)?)|(Version\/(12\.0|12\.([1-9]|\d{2,})|(1[3-9]|[2-9]\d|\d{3,})\.\d+|13\.0|13\.([1-9]|\d{2,})|(1[4-9]|[2-9]\d|\d{3,})\.\d+|14\.0|14\.([1-9]|\d{2,})|(1[5-9]|[2-9]\d|\d{3,})\.\d+|15\.0|15\.([1-9]|\d{2,})|(1[6-9]|[2-9]\d|\d{3,})\.\d+|16\.0|16\.([1-9]|\d{2,})|(1[7-9]|[2-9]\d|\d{3,})\.\d+)(?:\.\d+)? Safari\/)|(Firefox\/(60\.0|60\.([1-9]|\d{2,})|(6[1-9]|[7-9]\d|\d{3,})\.\d+)\.\d+)|(Firefox\/(60\.0|60\.([1-9]|\d{2,})|(6[1-9]|[7-9]\d|\d{3,})\.\d+)(pre|[ab]\d+[a-z]*)?)/; diff --git a/client/configuration/webpack/obsoleteHTMLTemplate.html b/client/configuration/webpack/obsoleteHTMLTemplate.html index ec459ea5d..ecfe70ce0 100644 --- a/client/configuration/webpack/obsoleteHTMLTemplate.html +++ b/client/configuration/webpack/obsoleteHTMLTemplate.html @@ -11,10 +11,7 @@ font-family: 'Inter, sans serif'; " > - +
- +
Chrome > 60
- - + +
Firefox ≥ 60
- - + +
Edge ≥ 79
+ + +
Safari ≥ 12
+
diff --git a/client/configuration/webpack/webpack.config.dev.js b/client/configuration/webpack/webpack.config.dev.js index e5152224a..d327f4b95 100644 --- a/client/configuration/webpack/webpack.config.dev.js +++ b/client/configuration/webpack/webpack.config.dev.js @@ -31,6 +31,7 @@ const devConfig = { // so it ignores the base_url (/d, /e) and dataset in the url. // e.g., http://localhost:3000/static/assets/heatmap.svg publicPath: "/", + assetModuleFilename: "images/[name][ext][query]", }, module: { rules: [ @@ -41,12 +42,7 @@ const devConfig = { }, { test: /\.(jpg|png|gif|eot|svg|ttf|woff|woff2|otf)$/i, - loader: "file-loader", - options: { - name: "static/assets/[name].[ext]", - // (thuang): This is needed to make sure @font url path is '/static/assets/' - publicPath: "/", - }, + type: "asset/resource", }, ], }, @@ -57,7 +53,7 @@ const devConfig = { }), new FaviconsWebpackPlugin({ logo: "./favicon.png", - prefix: "static/img/", + prefix: "static/assets/", favicons: { icons: { android: false, diff --git a/client/configuration/webpack/webpack.config.prod.js b/client/configuration/webpack/webpack.config.prod.js index d5095c3b6..6be64ca6c 100644 --- a/client/configuration/webpack/webpack.config.prod.js +++ b/client/configuration/webpack/webpack.config.prod.js @@ -35,6 +35,7 @@ const prodConfig = { cache: false, output: { filename: "static/[name]-[contenthash].js", + assetModuleFilename: "images/[name][ext][query]", }, optimization: { minimize: true, @@ -55,10 +56,7 @@ const prodConfig = { }, { test: /\.(jpg|png|gif|eot|svg|ttf|woff|woff2|otf)$/i, - loader: "file-loader", - options: { - name: "static/assets/[name]-[contenthash].[ext]", - }, + type: "asset/resource", }, ], }, diff --git a/client/index.html b/client/index.html index cd49d006c..2df2852b6 100644 --- a/client/index.html +++ b/client/index.html @@ -59,7 +59,7 @@