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

chore: update methods to lodash 4 verios #496

Merged
merged 2 commits into from
Feb 1, 2024

Conversation

taopkorczak
Copy link
Contributor

Related: https://oat-sa.atlassian.net/browse/ADF-1579

Update lodash methods to version 4.
Documentation: https://github.com/lodash/lodash/wiki/Migrating

@taopkorczak taopkorczak changed the base branch from master to develop December 4, 2023 06:09
Copy link

@olga-kulish olga-kulish left a comment

Choose a reason for hiding this comment

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

Please ensure that you are following correct upgrade guide.

https://github.com/lodash/lodash/wiki/Migrating is about moving from underscore library to lodash library, it's not our case.
But we need https://github.com/lodash/lodash/wiki/Changelog (see also https://github.com/lodash/lodash/wiki/Deprecations)
Yes, many updates are similar, but not all.

For example, there's no need to change from each to forEach, because they are the same function in lodash: https://lodash.com/docs/4.17.15#forEach (each is an alias for forEach)
I don't mind this change, just let's ensure we didn't miss other changes we actually needed to do.

Notice an interesting comment in Kyril's PR: oat-sa/tao-core-ui-fe#568 (comment)

"Why did you change it from remove to pull?"
"Lodash changed _.remove implementation a bit - predicate is now a function, and to remove elements from array by value - it's recommended to use _.pull"

For example, here https://github.com/oat-sa/extension-tao-itemqti/blob/feature/ADF-1579/update-lodash-to-4/views/js/qtiCreator/widgets/interactions/helpers/pairScoringForm.js#L143
the same thing is used.

I didn't notice anything about this in the changelog, so maybe it's actually backwards-compatible and no change is needed? If not, maybe it's more reliable to not only follow the changelog, but also to compare the documentation:
New docs: https://lodash.com/docs/4.17.15.
Old docs: https://lodash.com/docs/2.4.2
Create a list of lodash functions used in these repositories, and compare docs for them.

Copy link

github-actions bot commented Feb 1, 2024

Version

Target Version 12.41.1
Last version 12.41.0

There are 0 BREAKING CHANGE, 0 feature, 0 fix

Copy link

github-actions bot commented Feb 1, 2024

Front-end summary Node 18

💯 Total ✅ Passed ⏭️ Skipped ❌ Failed
16 16 0 0

@wazelin wazelin merged commit 1e772d4 into develop Feb 1, 2024
5 of 6 checks passed
@wazelin wazelin deleted the feature/ADF-1579/update-lodash-to-4 branch February 1, 2024 18:05
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.

3 participants