389ds / 389-ds-base

The enterprise-class Open Source LDAP server for Linux
https://www.port389.org/
Other
212 stars 91 forks source link

Decrease 389-console Cockpit component size #3896

Closed 389-ds-bot closed 4 years ago

389-ds-bot commented 4 years ago

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


Issue 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)

389-ds-bot commented 4 years ago

Comment from spichugi (@droideck) at 2020-01-22 15:45:02

3897

389-ds-bot commented 4 years ago

Comment from spichugi (@droideck) at 2020-01-22 15:45:03

Metadata Update from @droideck:

389-ds-bot commented 4 years ago

Comment from spichugi (@droideck) at 2020-01-22 22:35:33

46daeac58..06d55f9ce 389-ds-base-1.4.1 -> 389-ds-base-1.4.1 b8f99b73b..ed29ead89 389-ds-base-1.4.2 -> 389-ds-base-1.4.2

389-ds-bot commented 4 years ago

Comment from spichugi (@droideck) at 2020-01-22 22:35:39

Metadata Update from @droideck:

389-ds-bot commented 4 years ago

Comment from mhonek (@kenoh) at 2020-01-23 00:32:10

126bfa0 breaks make -f rpm.mk srpms for me (the parent commit works ok). The last words are following:

> 389-console@1.0.0 build /home/vagrant/ds/src/cockpit/389-console
> webpack

Warning: React version not specified in eslint-plugin-react settings. See https://github.com/yannickcr/eslint-plugin-react#configuration.
(node:29652) [ESLINT_LEGACY_OBJECT_REST_SPREAD] DeprecationWarning: The 'parserOptions.ecmaFeatures.experimentalObjectRestSpread' option is deprecated. Use 'parserOptions.ecmaVersion' instead. (found in "standard-react")
(node:29652) [ESLINT_LEGACY_OBJECT_REST_SPREAD] DeprecationWarning: The 'parserOptions.ecmaFeatures.experimentalObjectRestSpread' option is deprecated. Use 'parserOptions.ecmaVersion' instead. (found in "node_modules/eslint-config-standard-jsx/index.js")
(node:29652) [ESLINT_LEGACY_OBJECT_REST_SPREAD] DeprecationWarning: The 'parserOptions.ecmaFeatures.experimentalObjectRestSpread' option is deprecated. Use 'parserOptions.ecmaVersion' instead. (found in "standard")
Browserslist: caniuse-lite is outdated. Please run next command `npm update caniuse-lite browserslist`
~/bin/sh: line 1: 29641 Killed                  npm run build
make[1]: *** [node_modules.mk:7: build-cockpit-plugin] Error 137
make[1]: Leaving directory '/home/vagrant/ds/src/cockpit/389-console'
make: *** [rpm.mk:55: build-cockpit] Error 2

This is an out-of-box build. Any ideas?

389-ds-bot commented 4 years ago

Comment from vashirov (@vashirov) at 2020-01-23 09:53:07

What nodejs and npm versions do you have? It works for me with

$ rpm -q nodejs npm 
nodejs-12.14.1-2.fc31.x86_64
npm-6.13.4-1.12.14.1.2.fc31.x86_64
389-ds-bot commented 4 years ago

Comment from mhonek (@kenoh) at 2020-01-23 10:48:20

Thanks, Viktor. It indeed is an OOM kill (1GB RAM VM). I'm on F30 with:

nodejs-10.16.3-1.fc30.x86_64
npm-6.9.0-1.10.16.3.1.fc30.x86_64
389-ds-bot commented 4 years ago

Comment from mhonek (@kenoh) at 2020-01-23 15:37:24

Funny. I tested with the same specs but on F31 and no OOM kill, works as it should. Maybe they fixed something in nodejs between versions 10 and 12.

389-ds-bot commented 4 years ago

Comment from mreynolds (@mreynolds389) at 2020-01-23 21:12:52

I'm seeing these warnings now with this fix:

WARNING in asset size limit: The following asset(s) exceed the recommended size limit (244 KiB).
This can impact web performance.
Assets: 
  index.min.js.gz (384 KiB)
  static/bootstrap.min.css.map (529 KiB)

WARNING in webpack performance recommendations: 
You can limit the size of your bundles by using import() or require.ensure to lazy load some parts of your application.
For more info visit https://webpack.js.org/guides/code-splitting/

Reopening to investigate if there is more we can do to help performance...

389-ds-bot commented 4 years ago

Comment from mreynolds (@mreynolds389) at 2020-01-23 21:12:52

Metadata Update from @mreynolds389:

389-ds-bot commented 4 years ago

Comment from mreynolds (@mreynolds389) at 2020-01-23 21:13:03

Metadata Update from @mreynolds389:

389-ds-bot commented 4 years ago

Comment from mreynolds (@mreynolds389) at 2020-01-30 17:48:32

Metadata Update from @mreynolds389:

389-ds-bot commented 4 years ago

Comment from spichugi (@droideck) at 2020-02-12 13:21:12

Reopening to investigate if there is more we can do to help performance...

Yeah, we can separate the entry points (now we have only 'index') and it will resolve the issue.

But I'd rather do it together with the final React porting commit, so we can avoid a double refactoring.

389-ds-bot commented 4 years ago

Comment from mreynolds (@mreynolds389) at 2020-02-26 16:05:40

Metadata Update from @mreynolds389:

389-ds-bot commented 4 years ago

Comment from mreynolds (@mreynolds389) at 2020-06-24 16:16:57

Metadata Update from @mreynolds389: