LG-3764, LG-3716: Use identity-style-guide@3 to deduplicate zxcvbn dependency#4485
LG-3764, LG-3716: Use identity-style-guide@3 to deduplicate zxcvbn dependency#4485
Conversation
Gemfile
Outdated
There was a problem hiding this comment.
We probably should have been using this all along:
https://github.com/uswds/uswds#sass-compilation-requirements
It's more obviously necessary now, as without it, the caret in the USA banner does not display correctly:
Related: uswds/uswds#3860
There was a problem hiding this comment.
This was previously misnamed, fixed between USWDS 2.8.0 and 2.8.1:
zachmargolis
left a comment
There was a problem hiding this comment.
LGTM! Love the asset size decrease, nice work!
There was a problem hiding this comment.
awesome that we're able to clean all these TODOs up!
mitchellhenke
left a comment
There was a problem hiding this comment.
wow this is a great fix to decrease bundle size 👏🏼
|
Noticed a couple minor regressions in some further testing in mobile contexts:
|
|
Another issue seemingly stemming from the external link icon revision: In Safari, the footer links wrap even before they occupy the available width of the flex container: Seems like it may possibly be related to behavior (bug?) specific to Safari where pseudo-element content is treated "as if they were real elements". Looking at potential solutions:
|
Implemented this in b119fd9. |
👍🏼 |
|
Discovered a small issue with how we build Specifically, we reference USWDS components by source, which can contain ES6 (example), and unlike the Follow-ups:
|
**Why**: To use latest USWDS version consistently across all login products and services
**Why**: The zxcvbn dependency is large and should not be included in JavaScript bundles where it is not used. Instead, bundles should use the minimum implementations necessary. This is made possible in the latest version 3.0 of identity-style-guide.
**Why**: Otherwise doesn't appear, because it has no implicit height
**Why**: Avoid unpredictable wrapping in Safari by treating each link as its own column
Rebased after merging #4296. Expecting build to fail now. |
Odd that it's not 🤔 It does locally: |
**Why**: CircleCI sets RAILS_ENV=test by default, which compiles assets to public/packs-test
We configure identity-idp/.circleci/config.yml Lines 16 to 17 in e0bd0b9 ...where Trying ffd7cd7. Edit: Success! And by "success", I mean the build is failing as expected 😄 |
**Why**: These include code which can't be run in legacy browsers. Related: https://github.com/uswds/uswds/tree/develop/examples#general
After much toil yesterday afternoon, I eventually settled with the latter option here. Ideally we don't distribute code which assumes downstream compilation, but since it originates from USWDS and its dependencies, any "fix" ultimately involves bundling a modified version of those dependencies, which can cause more problems than it helps. 410a261 seems to work in my testing. It's still more cumbersome than I'd hope, since there are a handful of these transitive dependencies, and because Babel defaults ( Open to other thoughts. I'd contemplated throwing my hands up and just bundling the precompiled version, but considering this is at the core of what LG-3716 aims to improve, it's not really an option. There's a small semi-related note hidden in USWDS documentation:
https://github.com/uswds/uswds/tree/develop/examples#general Follow-ups:
|







Why: To use latest USWDS version consistently across all login products and services.
Why: The zxcvbn dependency is large and should not be included in JavaScript bundles where it is not used. Instead, bundles should use the minimum implementations necessary. This is made possible in the latest version 3.0 of identity-style-guide.
Related: 18F/identity-design-system#165 (LG-3757)
Impact:
Treemap:
Highlighted segments identify where
zxcvbnis loaded. Previouslyidentity-style-guidewas prebundled, so it was not clearly labelled separate, but you can tell by the fact thatidentity-style-guideinflated bundle size significantly.Bundle Size:
Before:
After: