-
Notifications
You must be signed in to change notification settings - Fork 8
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
feat: sort entries by references before add #913
Conversation
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.
Looking good 👏
Maybe we should mention in code or the PR description that this logic is "inspired" by the import CLI.
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.
In general I prefer using native JS methods, especially if it's straightforward, because of the following reasons:
- it improves code readability - it's safer to assume that more people are familiar with native JS methods than methods from 3rd party lib
- it reduces dependency on the 3rd party lib
- in most of the cases it doesn't bring any value as the language provides decent alternatives
I'd ask you to refrain from such methods asmap
,filter
,get
etc. from lodash where they don't bring more to the table compared to the native methods.
I will be happy to discuss it further, there's a high chance I'm missing something so feel free to let me know :)
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.
🥇
🎉 This PR is included in version 2.6.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
In order to avoid errors when creating entries using the contentful-merge cli, we introduced a sort on the Add task where we make sure we order the Add changeset in a way that the referenced entries come before the entries they are referenced in.