Remove password strength meter component #195
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request seeks to remove the Password Strength Meter component, but primarily exists to prompt a discussion around how to decrease the size of the JavaScript we publish. (In other words, I'm not attached to the idea of actually removing the component)
The password strength meter component inflates the size of the bundled JavaScript. It's the difference of
76.3kb
excluded vs.898.2kb
included (12x increase). This is due to its use of the underlyingzxcvbn
dependency.This size inflation is seen on most login.gov public-facing sites, including the brochure site and the IDP. This cost has incurred a high cost in effort spent toward workarounds for the large size (LG-3995, LG-3716).
The JavaScript implementation published in the design system is also not currently used in any login.gov projects. This includes
identity-idp
for which it was presumably intended. The IDP implements a copy of the component JavaScript (source), perhaps due to the need for internationalization of labels which the design system variant does not support. It has also fallen out-of-sync with the design system.Some options for mitigating this could include...
identity-idp
main.js
), where a consuming project must opt-in to use the componentzxcvbn
dependency from the design system, where a consuming project must provide this themselves (e.g. bywindow.zxcvbn
global)zxcvbn
on-demand, and only when the component is being initialized if a password meter element is present on the page