-
Notifications
You must be signed in to change notification settings - Fork 237
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
Replace keypather
with lodash.get
#1155
Conversation
26fc95d
to
456f0d3
Compare
456f0d3
to
901a81d
Compare
This looks great and seems hunky dory on my machine. Do we think this could break some existing prototypes where users have made use of |
Hmm, possibly... it would be nice if we could find if there were any such prototypes on GitHub 🤔 |
Only 1500ish results to check... https://github.com/search?l=JavaScript&q=%22keypather%22&type=Code |
we've never documented keypather or told people to use it/aware of people using it, in which case we don't normally consider it part of our 'api' to be included in 'breaking changes' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given @joelanman's comment that we don't consider this a breaking change, I think this is ready to go with a fix entry in the CHANGELOG. dependabot is going to be so pleased.
keypather is a bit unloved and Dependabot complains about it. We can replace it with the `_.get` function from lodash [[1]]. This also saves a little bit of disk space, as we have to install lodash loads anyway. [1]: https://lodash.com/docs/4.17.15#get
901a81d
to
d6d8c93
Compare
I've update the CHANGELOG👍 When do we want to merge this? |
There shouldn't be any harm in merging straight away? We could potentially do a 11.0.1 release with this so anybody who's upgrading now doesn't get the Big Scary Security Warning? |
@domoscargin sounds good to me on both counts |
keypather
with lodash.get
As a prototype developer that's re-used keypather in the kit, I'd like to know a bit more about this change. I like that this fixes the security issue, and lodash looks like a good replacement - is the API similar, and is it pretty much a straight swap? |
Hi @fofr - we haven't gone into much detail on this in the release notes, since we only used govuk-prototype-kit/lib/utils.js Line 5 in 266226c
We were specifically interested in If you're making use of other At a glance:
For immutable actions, looks like the
For |
keypather is quite old and has some security issues with one of its dependencies. This replaces it with a function from lodash, which is already installed anyway. Re-applies same update from the GOV.UK Prototype Kit here: alphagov/govuk-prototype-kit#1155
keypather is quite old and has some security issues with one of its dependencies. This replaces it with a function from lodash, which is already installed anyway. Re-applies same update from the GOV.UK Prototype Kit here: alphagov/govuk-prototype-kit#1155
keypather is a bit unloved and Dependabot complains about it. We can replace it with the
_.get
function from lodash [1]. This also saves a little bit of disk space, as we have to install lodash loads anyway.This PR checks that everything is a-okay by adding some small tests for
checked
, which uses keypather, and then doing the switch.