Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve UIKit Rendering Performance + Speed Up CI Installs #1255

Merged
merged 34 commits into from
Jul 16, 2019

Conversation

sghoweri
Copy link
Contributor

@sghoweri sghoweri commented Jul 9, 2019

Jira

http://vjira2:8080/browse/BDS-1557

Summary

DevOps related updates to upgrade Bolt’s Puppeteer instances to now use Puppeteer Core + launch using an instance of Chrome already installed; significantly speeding up / slimming down local dev installs + shaving nearly a minute off of our Travis CI build!

Also includes a handful of UIKit visual improvements + a ton of IE-specific bug fixes that popped up when testing out these updates.

Before:
image

After:
image

Details

  • This PR updates dependencies and configuration logic for Bolt’s Puppeteer instanced to now use the much lighter weight Puppeteer Core instead (which doesn’t automatically download Chrome when installing). This includes:

    • Web component-specific Jest tests
    • Pre-rendering Pattern Lab’s Web Component-based UI
    • Generating and inlining Critical CSS for Pattern Lab (and soon, the rest of the docs site)
  • Updated NPM dependencies for the root monorepo package.json, in addition to updating dependencies in Pattern Lab's UI (UIKit Workshop), @bolt/core, and Bolt's shared Babel-specific config

  • Fixed the double CLI output issue when Pattern Lab's UIKit assets are compiled

  • Fixed a few misc eslint / prettier related issues flagged after updating dependencies

  • Added / updated several missing polyfills required to get IE 11 working as expected

  • Removed Prettier from getting used to format code in the Pattern Lab code viewer due to major performance issues encountered (now using a lighter weight alternative)

  • Reverted Pattern Lab's iframe to no longer automatically resize when the height changes. This addresses side-effects we've been seeing with sticky / fixed position UI (like modals) + helps improve the already heavy performance load when navigating between pages

  • Updated Pattern Lab's iframe scrollbar / iframe resizer handle to be easier to use while keeping out of the way

  • Improvements to the no-JS / pre-rendered version of the docs site -- the nav + iframe are nav both scrollable / usable!

Prerendering Before vs After Updates

image

What's Up With The New UIKit-specific Packages?

Our modernized Pattern Lab UI had been using two off the shelf Webpack plugins (critical-css-webpack-plugin and prerender-spa-plugin) to handle the pre-rendering and Critical CSS-related work. Unfortunately, these two plugins (and the prerenderer dependency used for pre-rendering) were also using the heavier version of Puppeteer.

This, combined with a lack of recent upstream updates, meant that configuring these Puppeteer instances to use Puppeteer Core + reference the path to a local instance of Chrome installed was incredibly difficult.

For at least the time being, these 3 dependencies have been pulled into the Bolt monorepo to apply the necessary optimizations.

These updates could ultimately get PR’d back to the original projects, however given the lack of recent package updates, my gut tells me that a patch-package-approach would likely wind up being much more permanent than I’m comfortable with.

How to test

sghoweri and others added 29 commits July 6, 2019 12:56
…ng the nav collapse behavior while in vertical mode + hide extra icons
…com/bolt-design-system/bolt into feature/uikit-pre-rendering-updates

# Conflicts:
#	packages/uikit-workshop/package.json
#	yarn.lock
…ate the dependencies in Bolt's shared Babel config
@sghoweri sghoweri marked this pull request as ready for review July 10, 2019 14:30
@sghoweri sghoweri changed the title WIP: Improve UIKit Rendering Performance + Speed Up CI Installs Improve UIKit Rendering Performance + Speed Up CI Installs Jul 10, 2019
@mikemai2awesome
Copy link
Collaborator

mikemai2awesome commented Jul 11, 2019

@sghoweri Side question, this page (https://boltdesignsystem-pg0ps1k83.now.sh/pattern-lab/?p=viewall-visual-styles-rendering-performance) does not belong in the Visual Styles section, can we move it somewhere else? There are already some hidden test pages under button.

@sghoweri
Copy link
Contributor Author

@sghoweri Side question, this page (https://boltdesignsystem-pg0ps1k83.now.sh/pattern-lab/?p=viewall-visual-styles-rendering-performance) does not belong in the Visual Styles section, can we move it somewhere else? There are already some hidden test pages under button.

@mikemai2awesome Move it to a new Ions section? 😉

In all seriousness, I'd be ok hiding those for now (underscores) and we come up with a much more permanent home for supporting pages / sections like that

@mikemai2awesome
Copy link
Collaborator

@sghoweri Sounds like a plan!

Copy link
Collaborator

@mikemai2awesome mikemai2awesome left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just hide some pages as mentioned above.

Copy link
Collaborator

@adamszalapski adamszalapski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks good. I have only one question, why view all pages like (Color Palette, Typography, Accordion etc.) have left, right padding and specific pages not. I now that was the same on previous build but maybe we should change it.

@sghoweri
Copy link
Contributor Author

@mikemai2awesome all set!

@sghoweri
Copy link
Contributor Author

It looks good. I have only one question, why view all pages like (Color Palette, Typography, Accordion etc.) have left, right padding and specific pages not. I now that was the same on previous build but maybe we should change it.

@adamszalapski that's always been the case -- even all the way back with the earliest v1.x releases of Bolt: https://v1-3-0.bolt-design-system.com/pattern-lab/patterns/01-styleguide

Pattern Lab has always (historically) had it's "View All" pages include a little bit of padding in the wrapping template since they displaying a high level overview of everything in the system.

Individual component-specific pages don't have this wrapper (it's just the pure component as-is), hence why they don't have this padding.

# Conflicts:
#	package.json
#	packages/servers/ssr-server/package.json
#	yarn.lock
@sghoweri sghoweri dismissed mikemai2awesome’s stale review July 15, 2019 13:17

Changes requested should be all set!

Copy link
Collaborator

@danielamorse danielamorse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sghoweri tested locally and on stage, ran start and build, reviewed (most) code changes. Approved 👍

I merged in master and resolved conflicts. Just take a look at package.json to make sure it's as expected (see commit).

@sghoweri
Copy link
Contributor Author

@sghoweri tested locally and on stage, ran start and build, reviewed (most) code changes. Approved 👍

I merged in master and resolved conflicts. Just take a look at package.json to make sure it's as expected (see commit).

Excellent - thanks @danielamorse!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants