aboutsummaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorMathieu Suen <mathieu.suen@sonarsource.com>2021-05-25 14:13:52 +0200
committersonartech <sonartech@sonarsource.com>2021-05-26 20:13:17 +0000
commit50b3f5db008f26197966b2e8778c4df9e7109749 (patch)
tree4bf098db28bcb6c02358b25944db7f788aa578c7 /server
parentb63595c8c4f57a9029bb4f4b29fe6422c35904a7 (diff)
downloadsonarqube-50b3f5db008f26197966b2e8778c4df9e7109749.tar.gz
sonarqube-50b3f5db008f26197966b2e8778c4df9e7109749.zip
SONAR-14387 Remove support of legacy browser
Diffstat (limited to 'server')
-rw-r--r--server/sonar-docs/src/pages/requirements/requirements.md1
-rw-r--r--server/sonar-web/config/webpack.config.js74
-rw-r--r--server/sonar-web/public/index.html1
-rw-r--r--server/sonar-web/scripts/build.js5
4 files changed, 1 insertions, 80 deletions
diff --git a/server/sonar-docs/src/pages/requirements/requirements.md b/server/sonar-docs/src/pages/requirements/requirements.md
index 9b98821984d..7fe079d4528 100644
--- a/server/sonar-docs/src/pages/requirements/requirements.md
+++ b/server/sonar-docs/src/pages/requirements/requirements.md
@@ -62,7 +62,6 @@ To get the full experience SonarQube has to offer, you must enable JavaScript in
| Browser | |
| --------------------------- | --------------------------------------- |
-| Microsoft Internet Explorer | ![](/images/check.svg) IE 11 |
| Microsoft Edge | ![](/images/check.svg) Latest |
| Mozilla Firefox | ![](/images/check.svg) Latest |
| Google Chrome | ![](/images/check.svg) Latest |
diff --git a/server/sonar-web/config/webpack.config.js b/server/sonar-web/config/webpack.config.js
index d3e3db76a31..de4f583c043 100644
--- a/server/sonar-web/config/webpack.config.js
+++ b/server/sonar-web/config/webpack.config.js
@@ -29,30 +29,6 @@ const InterpolateHtmlPlugin = require('./InterpolateHtmlPlugin');
const paths = require('./paths');
const utils = require('./utils');
-/*
- This webpack config is actually two: one for modern browsers and one for the legacy ones (e.g. ie11)
-
- The modern one transpilies the code to ES2018 (i.e. with classes, async functions, etc.) and
- does not include any polyfills. It's included in the result index.html using <script type="module">.
- Legacy browsers ignore this tag.
-
- The legacy one transpilies the code to ES5 and polyfills ES5+ features (promises, generators, etc.).
- It's included in the result index.html using <script nomodule>. Modern browsers do not load such scripts.
-
- There is a trick to have both scripts in the index.html. We generate this file only once, during the
- build for modern browsers. We want unique file names for each version to invalidate browser cache.
- For modern browsers we generate a file suffix using the content hash (as previously). For legacy ones
- we can't do the same, because we need to know the file names without the build.
-
- To work-around the problem, we use a build timestamp which is added to the legacy build file names.
- This way assuming that the build generates exactly the same entry chunks, we know the name of the
- legacy files. Inside index.html template we use a simple regex to replace the file hash of a modern
- file name to the timestamp. To simplify the regex we use ".m." suffix for modern files.
-
- This whole thing might be simplified when (if) the following issue is resolved:
- https://github.com/jantimon/html-webpack-plugin/issues/1051
-*/
-
module.exports = ({ production = true, release = false }) => {
const timestamp = Date.now();
@@ -214,56 +190,6 @@ module.exports = ({ production = true, release = false }) => {
hints: 'error'
}
: undefined
- }),
-
- Object.assign({ name: 'legacy' }, commonConfig, {
- entry: [
- !production && require.resolve('react-dev-utils/webpackHotDevClient'),
- require.resolve('./polyfills'),
- !production && require.resolve('react-error-overlay'),
- './src/main/js/app/utils/setPublicPath.js',
- './src/main/js/app/index.ts'
- ].filter(Boolean),
- output: {
- path: paths.appBuild,
- pathinfo: !production,
- filename: production ? `js/[name].${timestamp}.js` : 'js/[name].js',
- chunkFilename: production ? `js/[name].${timestamp}.chunk.js` : 'js/[name].chunk.js'
- },
- module: {
- rules: [
- {
- test: /(\.js$|\.ts(x?)$)/,
- exclude: p => {
- // Transpile D3 packages.
- if (/\/d3/.test(p)) {
- return false;
- }
- // Ignore anything else in node_modules/.
- return /node_modules/.test(p);
- },
- use: [
- {
- loader: 'babel-loader',
- options: {
- configFile: path.join(__dirname, '../babel.config.legacy.js')
- }
- },
- {
- loader: 'ts-loader',
- options: {
- configFile: 'tsconfig.legacy.json',
- transpileOnly: true
- }
- }
- ]
- },
- ...commonRules
- ]
- },
- plugins: [...commonPlugins, !production && new webpack.HotModuleReplacementPlugin()].filter(
- Boolean
- )
})
];
};
diff --git a/server/sonar-web/public/index.html b/server/sonar-web/public/index.html
index 11e69bd1c71..a9210ca5d67 100644
--- a/server/sonar-web/public/index.html
+++ b/server/sonar-web/public/index.html
@@ -45,7 +45,6 @@
</script>
<% for (let chunk in htmlWebpackPlugin.files.chunks) { %>
<script type="module" src="%WEB_CONTEXT%/<%= htmlWebpackPlugin.files.chunks[chunk].entry %>"></script>
- <script nomodule src="%WEB_CONTEXT%/<%= htmlWebpackPlugin.files.chunks[chunk].entry.replace(/m\.[\w\d]+/, htmlWebpackPlugin.options.timestamp) %>"></script>
<% } %>
</body>
diff --git a/server/sonar-web/scripts/build.js b/server/sonar-web/scripts/build.js
index 4f29e203185..8d005375e5c 100644
--- a/server/sonar-web/scripts/build.js
+++ b/server/sonar-web/scripts/build.js
@@ -41,10 +41,7 @@ function build() {
process.exit(1);
}
reportBuildStats(stats.stats[0], 'modern');
- if (release) {
- console.log();
- reportBuildStats(stats.stats[1], 'legacy');
- }
+
console.log(chalk.green.bold('Compiled successfully!'));
});
}