]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-14387 Remove support of legacy browser
authorMathieu Suen <mathieu.suen@sonarsource.com>
Tue, 25 May 2021 12:13:52 +0000 (14:13 +0200)
committersonartech <sonartech@sonarsource.com>
Wed, 26 May 2021 20:13:17 +0000 (20:13 +0000)
server/sonar-docs/src/pages/requirements/requirements.md
server/sonar-web/config/webpack.config.js
server/sonar-web/public/index.html
server/sonar-web/scripts/build.js

index 9b98821984d6273267f25712cd30dd46ab565477..7fe079d4528366794805648e5da774d3fcfdbff2 100644 (file)
@@ -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           |
index d3e3db76a313ccbe6b1830999f8a3a233c889efc..de4f583c043c949b2bc8954c472925b1774e381e 100644 (file)
@@ -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
-      )
     })
   ];
 };
index 11e69bd1c7189bc7831533014f880742cbe81ec0..a9210ca5d679324dbd9974de58b7e24633b7b7eb 100644 (file)
@@ -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>
 
index 4f29e203185543e46331bc406635372300ba5d0e..8d005375e5cbbaa276777c0d13a212fd43007645 100644 (file)
@@ -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!'));
   });
 }