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

refactor: replace trivial lodash functions with native equivalents #323

Closed
wants to merge 9 commits into from

Conversation

sockmaster27
Copy link
Contributor

Builds on #322

@sockmaster27 sockmaster27 marked this pull request as ready for review January 29, 2024 09:18
@magnus-madsen
Copy link
Member

How can we be sure this does not introduce bugs?

@magnus-madsen
Copy link
Member

How confident are you? :)

@sockmaster27
Copy link
Contributor Author

How confident are you? :)

As confident as I will get. Read through it thrice and did all the manual testing I could think of.

Maybe we should maintain a manual test list for situations like this?

@magnus-madsen
Copy link
Member

I think you just have to ensure that it is well-tested. Perhaps by keeping a list of the places you have changed and then being sure that you test in a way that is likely to exercise those code paths.

waitingForPriorityQueue = {}
return values
}

let enqueueDebounced: () => void = makeEnqueueDebounced()

function handleEnqueue() {
if (_.isEmpty(waitingForPriorityQueue)) {
if (Object.keys(waitingForPriorityQueue).length === 0) {
return
}
priorityQueue.push(...emptyWaitingForPriorityQueue())
startQueue()
}

function makeEnqueueDebounced() {
Copy link
Member

Choose a reason for hiding this comment

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

Perhaps this debouce can be in a separate PR?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Then we'd have to keep in the dependency and make a third PR

Copy link
Member

Choose a reason for hiding this comment

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

I think breaking this PR down to a few smaller PRs reduces the risk.

Copy link
Member

Choose a reason for hiding this comment

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

Yep, exactly.

@sockmaster27
Copy link
Contributor Author

I don't remember exactly what I have tested when, so I can go through it one more time if you would prefer

@sockmaster27
Copy link
Contributor Author

@magnus-madsen
Ready for review

@sockmaster27 sockmaster27 changed the title refactor: drop lodash dependency refactor: replace trivial lodash functions with native equivalents Jan 30, 2024
@magnus-madsen
Copy link
Member

magnus-madsen commented Feb 2, 2024

Until we have tests, I think I would only be comfortable if we did this slowly, one file at a time. That way we would minimize breakages and maximize the chance that we can catch all errors.

@magnus-madsen magnus-madsen marked this pull request as draft February 2, 2024 08:55
@magnus-madsen
Copy link
Member

Lets try for some tests. Then we can go file-by-file. I will close this meanwhile. (You can still find it).

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.

2 participants