#50843 Issue 50842 - Decrease 389-console Cockpit component size
Closed 3 years ago by spichugi. Opened 4 years ago by spichugi.
spichugi/389-ds-base gzip-build  into  master

file modified
+5 -2
@@ -52,16 +52,19 @@ 

  	cd src/cockpit/389-console; make -f node_modules.mk install

  

  build-cockpit: install-node-modules

- 	cd src/cockpit/389-console; make -f node_modules.mk build-cockpit-plugin

+ 	cd src/cockpit/389-console; \

+ 	NODE_ENV=production make -f node_modules.mk build-cockpit-plugin

+ 	cd src/cockpit/389-console; rm -rf cockpit_dist/index.min.js.map

  

  dist-bz2: install-node-modules download-cargo-dependencies

  	cd src/cockpit/389-console; \

  	rm -rf cockpit_dist; \

- 	make -f node_modules.mk build-cockpit-plugin; \

+ 	NODE_ENV=production make -f node_modules.mk build-cockpit-plugin; \

  	mv node_modules node_modules.release; \

  	touch cockpit_dist/*

  	mkdir -p $(NODE_MODULES_TEST)

  	touch -r src/cockpit/389-console/package.json $(NODE_MODULES_TEST)

+ 	cd src/cockpit/389-console; rm -rf cockpit_dist/index.min.js.map

  	tar cjf $(GIT_TAG).tar.bz2 --transform "s,^,$(GIT_TAG)/," $$(git ls-files) src/cockpit/389-console/cockpit_dist/ src/cockpit/389-console/node_modules

  	cd src/cockpit/389-console; \

  	rm -rf node_modules; \

@@ -2898,6 +2898,16 @@ 

        "integrity": "sha512-Un7MIEDdUC5gNpcGDV97op1Ywk748MpHcFTHoYs6qnj1Z3j7I53VG3nwZhKzoBZmbdRNnb6WRdFlwl7tSDuZGw==",

        "dev": true

      },

+     "bindings": {

+       "version": "1.5.0",

+       "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz",

+       "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==",

+       "dev": true,

+       "optional": true,

+       "requires": {

+         "file-uri-to-path": "1.0.0"

+       }

+     },

      "block-stream": {

        "version": "0.0.9",

        "resolved": "https://registry.npmjs.org/block-stream/-/block-stream-0.0.9.tgz",
@@ -5184,9 +5194,9 @@ 

        "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs="

      },

      "events": {

-       "version": "3.0.0",

-       "resolved": "https://registry.npmjs.org/events/-/events-3.0.0.tgz",

-       "integrity": "sha512-Dc381HFWJzEOhQ+d8pkNon++bk9h6cdAoAj4iE6Q4y6xgTzySWXlKn05/TVNpjnfRqi/X0EpJEJohPjNI3zpVA==",

+       "version": "3.1.0",

+       "resolved": "https://registry.npmjs.org/events/-/events-3.1.0.tgz",

+       "integrity": "sha512-Rv+u8MLHNOdMjTAFeT3nCjHn2aGlx435FP/sDHNaRhDEMwyI/aB22Kj2qIN8R0cw3z28psEQLYwxVKLsKrMgWg==",

        "dev": true

      },

      "evp_bytestokey": {
@@ -5547,6 +5557,13 @@ 

          }

        }

      },

+     "file-uri-to-path": {

+       "version": "1.0.0",

+       "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz",

+       "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==",

+       "dev": true,

+       "optional": true

+     },

      "fill-range": {

        "version": "4.0.0",

        "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz",
@@ -5731,14 +5748,15 @@ 

        "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8="

      },

      "fsevents": {

-       "version": "1.2.9",

-       "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.9.tgz",

-       "integrity": "sha512-oeyj2H3EjjonWcFjD5NvZNE9Rqe4UW+nQBU2HNeKw0koVLEFIhtyETyAakeAM3de7Z/SW5kcA+fZUait9EApnw==",

+       "version": "1.2.11",

+       "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.11.tgz",

+       "integrity": "sha512-+ux3lx6peh0BpvY0JebGyZoiR4D+oYzdPZMKJwkZ+sFkNJzpL7tXc/wehS49gUAxg3tmMHPHZkA8JU2rhhgDHw==",

        "dev": true,

        "optional": true,

        "requires": {

+         "bindings": "^1.5.0",

          "nan": "^2.12.1",

-         "node-pre-gyp": "^0.12.0"

+         "node-pre-gyp": "*"

        },

        "dependencies": {

          "abbrev": {
@@ -5786,7 +5804,7 @@ 

            }

          },

          "chownr": {

-           "version": "1.1.1",

+           "version": "1.1.3",

            "bundled": true,

            "dev": true,

            "optional": true
@@ -5816,7 +5834,7 @@ 

            "optional": true

          },

          "debug": {

-           "version": "4.1.1",

+           "version": "3.2.6",

            "bundled": true,

            "dev": true,

            "optional": true,
@@ -5843,12 +5861,12 @@ 

            "optional": true

          },

          "fs-minipass": {

-           "version": "1.2.5",

+           "version": "1.2.7",

            "bundled": true,

            "dev": true,

            "optional": true,

            "requires": {

-             "minipass": "^2.2.1"

+             "minipass": "^2.6.0"

            }

          },

          "fs.realpath": {
@@ -5874,7 +5892,7 @@ 

            }

          },

          "glob": {

-           "version": "7.1.3",

+           "version": "7.1.6",

            "bundled": true,

            "dev": true,

            "optional": true,
@@ -5903,7 +5921,7 @@ 

            }

          },

          "ignore-walk": {

-           "version": "3.0.1",

+           "version": "3.0.3",

            "bundled": true,

            "dev": true,

            "optional": true,
@@ -5922,7 +5940,7 @@ 

            }

          },

          "inherits": {

-           "version": "2.0.3",

+           "version": "2.0.4",

            "bundled": true,

            "dev": true,

            "optional": true
@@ -5964,7 +5982,7 @@ 

            "optional": true

          },

          "minipass": {

-           "version": "2.3.5",

+           "version": "2.9.0",

            "bundled": true,

            "dev": true,

            "optional": true,
@@ -5974,12 +5992,12 @@ 

            }

          },

          "minizlib": {

-           "version": "1.2.1",

+           "version": "1.3.3",

            "bundled": true,

            "dev": true,

            "optional": true,

            "requires": {

-             "minipass": "^2.2.1"

+             "minipass": "^2.9.0"

            }

          },

          "mkdirp": {
@@ -5992,24 +6010,24 @@ 

            }

          },

          "ms": {

-           "version": "2.1.1",

+           "version": "2.1.2",

            "bundled": true,

            "dev": true,

            "optional": true

          },

          "needle": {

-           "version": "2.3.0",

+           "version": "2.4.0",

            "bundled": true,

            "dev": true,

            "optional": true,

            "requires": {

-             "debug": "^4.1.0",

+             "debug": "^3.2.6",

              "iconv-lite": "^0.4.4",

              "sax": "^1.2.4"

            }

          },

          "node-pre-gyp": {

-           "version": "0.12.0",

+           "version": "0.14.0",

            "bundled": true,

            "dev": true,

            "optional": true,
@@ -6023,7 +6041,7 @@ 

              "rc": "^1.2.7",

              "rimraf": "^2.6.1",

              "semver": "^5.3.0",

-             "tar": "^4"

+             "tar": "^4.4.2"

            }

          },

          "nopt": {
@@ -6037,13 +6055,22 @@ 

            }

          },

          "npm-bundled": {

-           "version": "1.0.6",

+           "version": "1.1.1",

+           "bundled": true,

+           "dev": true,

+           "optional": true,

+           "requires": {

+             "npm-normalize-package-bin": "^1.0.1"

+           }

+         },

+         "npm-normalize-package-bin": {

+           "version": "1.0.1",

            "bundled": true,

            "dev": true,

            "optional": true

          },

          "npm-packlist": {

-           "version": "1.4.1",

+           "version": "1.4.7",

            "bundled": true,

            "dev": true,

            "optional": true,
@@ -6114,7 +6141,7 @@ 

            "optional": true

          },

          "process-nextick-args": {

-           "version": "2.0.0",

+           "version": "2.0.1",

            "bundled": true,

            "dev": true,

            "optional": true
@@ -6155,7 +6182,7 @@ 

            }

          },

          "rimraf": {

-           "version": "2.6.3",

+           "version": "2.7.1",

            "bundled": true,

            "dev": true,

            "optional": true,
@@ -6182,7 +6209,7 @@ 

            "optional": true

          },

          "semver": {

-           "version": "5.7.0",

+           "version": "5.7.1",

            "bundled": true,

            "dev": true,

            "optional": true
@@ -6235,18 +6262,18 @@ 

            "optional": true

          },

          "tar": {

-           "version": "4.4.8",

+           "version": "4.4.13",

            "bundled": true,

            "dev": true,

            "optional": true,

            "requires": {

              "chownr": "^1.1.1",

              "fs-minipass": "^1.2.5",

-             "minipass": "^2.3.4",

-             "minizlib": "^1.1.1",

+             "minipass": "^2.8.6",

+             "minizlib": "^1.2.1",

              "mkdirp": "^0.5.0",

              "safe-buffer": "^5.1.2",

-             "yallist": "^3.0.2"

+             "yallist": "^3.0.3"

            }

          },

          "util-deprecate": {
@@ -6271,7 +6298,7 @@ 

            "optional": true

          },

          "yallist": {

-           "version": "3.0.3",

+           "version": "3.1.1",

            "bundled": true,

            "dev": true,

            "optional": true
@@ -6423,9 +6450,9 @@ 

        }

      },

      "globule": {

-       "version": "1.2.1",

-       "resolved": "https://registry.npmjs.org/globule/-/globule-1.2.1.tgz",

-       "integrity": "sha512-g7QtgWF4uYSL5/dn71WxubOrS7JVGCnFPEnoeChJmBnyR9Mw8nGoEwOgJL/RC2Te0WhbsEUCejfH8SZNJ+adYQ==",

+       "version": "1.3.0",

+       "resolved": "https://registry.npmjs.org/globule/-/globule-1.3.0.tgz",

+       "integrity": "sha512-YlD4kdMqRCQHrhVdonet4TdRtv1/sZKepvoxNT4Nrhrp5HI8XFfc8kFlGlBn2myBo80aGp8Eft259mbcUJhgSg==",

        "requires": {

          "glob": "~7.1.1",

          "lodash": "~4.17.10",
@@ -8088,9 +8115,9 @@ 

        }

      },

      "node-sass": {

-       "version": "4.12.0",

-       "resolved": "https://registry.npmjs.org/node-sass/-/node-sass-4.12.0.tgz",

-       "integrity": "sha512-A1Iv4oN+Iel6EPv77/HddXErL2a+gZ4uBeZUy+a8O35CFYTXhgA8MgLCWBtwpGZdCvTvQ9d+bQxX/QC36GDPpQ==",

+       "version": "4.13.1",

+       "resolved": "https://registry.npmjs.org/node-sass/-/node-sass-4.13.1.tgz",

+       "integrity": "sha512-TTWFx+ZhyDx1Biiez2nB0L3YrCZ/8oHagaDalbuBSlqXgUPsdkUSzJsVxeDO9LtPB49+Fh3WQl3slABo6AotNw==",

        "requires": {

          "async-foreach": "^0.1.3",

          "chalk": "^1.1.1",
@@ -8099,7 +8126,7 @@ 

          "get-stdin": "^4.0.1",

          "glob": "^7.0.3",

          "in-publish": "^2.0.0",

-         "lodash": "^4.17.11",

+         "lodash": "^4.17.15",

          "meow": "^3.7.0",

          "mkdirp": "^0.5.1",

          "nan": "^2.13.2",
@@ -8109,6 +8136,13 @@ 

          "sass-graph": "^2.2.4",

          "stdout-stream": "^1.4.0",

          "true-case-path": "^1.0.2"

+       },

+       "dependencies": {

+         "lodash": {

+           "version": "4.17.15",

+           "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz",

+           "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A=="

+         }

        }

      },

      "nopt": {
@@ -10369,9 +10403,9 @@ 

        }

      },

      "terser": {

-       "version": "4.4.2",

-       "resolved": "https://registry.npmjs.org/terser/-/terser-4.4.2.tgz",

-       "integrity": "sha512-Uufrsvhj9O1ikwgITGsZ5EZS6qPokUOkCegS7fYOdGTv+OA90vndUbU6PEjr5ePqHfNUbGyMO7xyIZv2MhsALQ==",

+       "version": "4.6.3",

+       "resolved": "https://registry.npmjs.org/terser/-/terser-4.6.3.tgz",

+       "integrity": "sha512-Lw+ieAXmY69d09IIc/yqeBqXpEQIpDGZqT34ui1QWXIUpR2RjbqEkT8X7Lgex19hslSqcWM5iMN2kM11eMsESQ==",

        "dev": true,

        "requires": {

          "commander": "^2.20.0",
@@ -10513,9 +10547,9 @@ 

            }

          },

          "p-limit": {

-           "version": "2.2.1",

-           "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.2.1.tgz",

-           "integrity": "sha512-85Tk+90UCVWvbDavCLKPOLC9vvY8OwEX/RtKF+/1OADJMVlFfEHOiMTPVyxg7mk/dKa+ipdHm0OUkTvCpMTuwg==",

+           "version": "2.2.2",

+           "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.2.2.tgz",

+           "integrity": "sha512-WGR+xHecKTr7EbUEhyLSh5Dube9JtdiG78ufaeLxTgpudf/20KqyMioIUZJAezlTIi6evxuoUs9YXc11cU+yzQ==",

            "dev": true,

            "requires": {

              "p-try": "^2.0.0"
@@ -11183,9 +11217,9 @@ 

        "integrity": "sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg=="

      },

      "webpack": {

-       "version": "4.41.2",

-       "resolved": "https://registry.npmjs.org/webpack/-/webpack-4.41.2.tgz",

-       "integrity": "sha512-Zhw69edTGfbz9/8JJoyRQ/pq8FYUoY0diOXqW0T6yhgdhCv6wr0hra5DwwWexNRns2Z2+gsnrNcbe9hbGBgk/A==",

+       "version": "4.41.5",

+       "resolved": "https://registry.npmjs.org/webpack/-/webpack-4.41.5.tgz",

+       "integrity": "sha512-wp0Co4vpyumnp3KlkmpM5LWuzvZYayDwM2n17EHFr4qxBBbRokC7DJawPJC7TfSFZ9HZ6GsdH40EBj4UV0nmpw==",

        "dev": true,

        "requires": {

          "@webassemblyjs/ast": "1.8.5",
@@ -11208,7 +11242,7 @@ 

          "node-libs-browser": "^2.2.1",

          "schema-utils": "^1.0.0",

          "tapable": "^1.1.3",

-         "terser-webpack-plugin": "^1.4.1",

+         "terser-webpack-plugin": "^1.4.3",

          "watchpack": "^1.6.0",

          "webpack-sources": "^1.4.1"

        },
@@ -11220,12 +11254,12 @@ 

            "dev": true

          },

          "ajv": {

-           "version": "6.10.2",

-           "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.10.2.tgz",

-           "integrity": "sha512-TXtUUEYHuaTEbLZWIKUr5pmBuhDLy+8KYtPYdcV8qC+pOZL+NKqYwvWSRrVXHn+ZmRRAu8vJTAznH7Oag6RVRw==",

+           "version": "6.11.0",

+           "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.11.0.tgz",

+           "integrity": "sha512-nCprB/0syFYy9fVYU1ox1l2KN8S9I+tziH8D4zdZuLT3N6RMlGSGt5FSTpAiHB/Whv8Qs1cWHma1aMKZyaHRKA==",

            "dev": true,

            "requires": {

-             "fast-deep-equal": "^2.0.1",

+             "fast-deep-equal": "^3.1.1",

              "fast-json-stable-stringify": "^2.0.0",

              "json-schema-traverse": "^0.4.1",

              "uri-js": "^4.2.2"
@@ -11253,6 +11287,12 @@ 

              "estraverse": "^4.1.1"

            }

          },

+         "fast-deep-equal": {

+           "version": "3.1.1",

+           "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.1.tgz",

+           "integrity": "sha512-8UEa58QDLauDNfpbrX55Q9jrGHThw2ZMdOky5Gl1CDtVeJDPVrG4Jxx1N8jw2gkWaff5UUuX1KJd+9zGe2B+ZA==",

+           "dev": true

+         },

          "json5": {

            "version": "1.0.1",

            "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz",

@@ -45,7 +45,7 @@ 

      "sizzle": "^2.3.3",

      "stdio": "^0.2.7",

      "style-loader": "^0.23.1",

-     "webpack": "^4.41.2",

+     "webpack": "^4.41.5",

      "webpack-cli": "^3.1.0"

    },

    "dependencies": {
@@ -53,7 +53,7 @@ 

      "bootstrap": "^4.3.1",

      "file-loader": "^4.1.0",

      "handlebars": "^4.5.3",

-     "node-sass": "4.12.0",

+     "node-sass": "^4.13.1",

      "patternfly": "^3.59.3",

      "patternfly-react": "^2.34.3",

      "prop-types": "15.6.2",

@@ -90,10 +90,19 @@ 

      output.filename = "[name].min.js";

  

      plugins.unshift(

+         new webpack.DefinePlugin({

+             "process.env": {

+                 NODE_ENV: JSON.stringify("production")

+             }

+         })

+     );

+     plugins.unshift(new webpack.optimize.AggressiveMergingPlugin());

+     plugins.unshift(

          new CompressionPlugin({

-             asset: "[path].gz[query]",

+             filename: "[path].gz[query]",

              test: /\.(js|html)$/,

-             minRatio: 0.9,

+             threshold: 10240,

+             minRatio: 0.8,

              deleteOriginalAssets: true

          })

      );
@@ -130,15 +139,13 @@ 

                  test: /\.jsx$/,

                  options: {

                      presets: [

-                         '@babel/preset-env',

-                         '@babel/preset-react',

+                         "@babel/preset-env",

+                         "@babel/preset-react",

                          {

-                             plugins: [

-                                 '@babel/plugin-proposal-class-properties'

-                             ]

+                             plugins: ["@babel/plugin-proposal-class-properties"]

                          }

                      ]

-                 },

+                 }

              },

              {

                  exclude: /node_modules/,
@@ -146,21 +153,21 @@ 

                  test: /\.es6$/

              },

              {

-                   // Transform our own .css files with PostCSS and CSS-modules

+                 // Transform our own .css files with PostCSS and CSS-modules

                  test: /\.css$/,

                  exclude: /node_modules/,

-                 use: ['style-loader', 'css-loader'],

+                 use: ["style-loader", "css-loader"]

              },

              {

                  test: /\.css$/,

                  include: /node_modules/,

-                 use: ['style-loader', 'css-loader'],

+                 use: ["style-loader", "css-loader"]

              },

              {

                  test: /\.(png|jpg|gif)$/i,

                  use: [

                      {

-                         loader: 'url-loader',

+                         loader: "url-loader",

                          options: {

                              limit: 8192

                          }

Description: Our Web UI source files are too big and
we should make it compact for the production.
Compress and decrease the size of the files that are generated by webpack.
Fix rpm.mk so it delivers RPMs only with production-ready result files
(we can skip js.map because it is used only for development)
Also, fix minor audit-ci issues.

https://pagure.io/389-ds-base/issue/50842

Reviewed by: ?

rebased onto 126bfa0

4 years ago

Pull-Request has been merged by spichugi

4 years ago

389-ds-base is moving from Pagure to Github. This means that new issues and pull requests
will be accepted only in 389-ds-base's github repository.

This pull request has been cloned to Github as issue and is available here:
- https://github.com/389ds/389-ds-base/issues/3897

If you want to continue to work on the PR, please navigate to the github issue,
download the patch from the attachments and file a new pull request.

Thank you for understanding. We apologize for all inconvenience.

Pull-Request has been closed by spichugi

3 years ago