Drop encoding library

Commit f4a43cca440535a63592877c9bdbbe28636d803c attempted to fix a IE
bug in the SOL library.  Unfortunately, it did it by pulling in the
entire NPM encoding library, which is insanely large (190kb after
minification and compression).  This is almost equivalent to the rest of
our javascript put together!  That's nuts, and I don't think anyone
would argue that's a binary hit worth taking for IE9 support.

This commit removes it, and swaps in an inline polyfill from the mozilla
recommendations, that compresses much....much smaller.

Before this patchset build prints:
app.bundle.js.gz    522 KiB          [emitted]  [big]

After this patchset:
app.bundle.js.gz    332 KiB          [emitted]  [big]

If you don't want to break out a calculator, that's 190KB savings in the
root filesystem, and should cut the initial page load time (on slow
connections) by nearly 30 percent.

Note: text-encodings was never pinned in the package-lock.json, hence
why you don't see a diff removing it from package lock.  This was a miss
on the original commiters part, although it doesn't really matter, as
it's now removed.

PS: A reviewer may note, I could've moved the polyfill into its own
file.  Considering the serial console is the only page that uses that,
and it's not that big I elected not to, to make removing it analagous
with removing xterm/the serial console.

Bonus content!
Added a (commented out) webpack config that allows you to generate the
webui as individual gzipped fragments, instead of one bundle.  This
allows you to see file sizes on a package by package basis, and was how
I found this commit in question.

Testing:
This is where this patchset gets hairy.  I dont' have an IE9 instance to
test on.  Given it's low usage, and the fact that it's a relatively
straightforward change we can probably just wait for someone to tell us
it's broken again.

Enjoy the sweet sweet savings.

Signed-off-by: Ed Tanous <ed@tanous.net>
Change-Id: I2820ff1c4b33d725ebc63490793a72fe600b8ed3
Signed-off-by: Ed Tanous <ed@tanous.net>
4 files changed
tree: 59c398cc8f3fd85a1cf624a276cbe67ae4de506f
  1. app/
  2. .clang-format
  3. .gitignore
  4. config.json
  5. format-code.sh
  6. karma.conf.js
  7. LICENSE
  8. MAINTAINERS
  9. package-lock.json
  10. package.json
  11. postcss.config.js
  12. README.md
  13. sonar-project.properties
  14. webpack.config.js
README.md

OpenBMC Web User Interface

The OpenBMC WebUI is a Web-based user interface for the OpenBMC firmware stack. The WebUI uses AngularJS. Features include:

  • View system overview data such as model information and serial number
  • View and manage event logs
  • Inventory data
  • Sensor data
  • Power On/Off server operations
  • Reboot BMC
  • SOL console
  • Remote KVM
  • Virtual media
  • Date and time settings
  • IPv4 network settings
  • Manage and update BMC and Host firmware
  • LDAP
  • SSL certificates
  • Local user management

Requirements

nodejs (>= 4.2.6) npm (>= 6.0.1)

Note The default installation of your Linux distro may not come with the required versions above. See the following for more information on updating:

https://docs.npmjs.com/troubleshooting/try-the-latest-stable-version-of-node https://docs.npmjs.com/troubleshooting/try-the-latest-stable-version-of-npm

Installation

npm install

Note This must be run from within the phosphor-webui git repository.

Running locally

npm run-script server

This will start a server instance and begin listening for connections at http://localhost:8080. This development server provides live reloading on code changes. NOTE: Browsing to https://<BMC> and accepting the self-signed certificate might be required to prevent your browser from blocking traffic to the BMC.

Logging in

Enter the BMC Host or BMC IP address, username, and password. The default username and password are root/0penBmc.

Note that some OpenBMC implementations use bmcweb for its backend. For security reasons, bmcweb will need to be recompiled and loaded onto the target BMC Host before the above redirect command will work. The option to turn on within bmcweb is BMCWEB_INSECURE_DISABLE_XSS_PREVENTION. In order to test locally, you will also need to disable CSRF by turning on BMCWEB_INSECURE_DISABLE_CSRF_PREVENTION.