Meteor-Community-Packages / meteor-publish-composite

Meteor.publishComposite provides a flexible way to publish a set of related documents from various collections using a reactive join
https://atmospherejs.com/reywood/publish-composite
MIT License
553 stars 58 forks source link

Remove underscore #158

Closed StorytellerCZ closed 1 year ago

StorytellerCZ commented 1 year ago

Good first issue for Hacktoberfest. Remove the need for underscore package.

Good reference: https://github.com/you-dont-need/You-Dont-Need-Lodash-Underscore

github-actions[bot] commented 1 year ago

Thank you for submitting this issue!

We, the Members of Meteor Community Packages take every issue seriously. Our goal is to provide long-term lifecycles for packages and keep up with the newest changes in Meteor and the overall NodeJs/JavaScript ecosystem.

However, we contribute to these packages mostly in our free time. Therefore, we can't guarantee your issues to be solved within certain time.

If you think this issue is trivial to solve, don't hesitate to submit a pull request, too! We will accompany you in the process with reviews and hints on how to get development set up.

Please also consider sponsoring the maintainers of the package. If you don't know who is currently maintaining this package, just leave a comment and we'll let you know

Nandika-A commented 1 year ago

Hello! I am a beginner. Can I contribute to this issue?

StorytellerCZ commented 1 year ago

@Nandika-A sure, go ahead. Where possible please replace underscore references with native one. See: https://github.com/you-dont-need/You-Dont-Need-Lodash-Underscore for reference. If there currently isn't a native version for the underscore function, skip it for now. Focus on your first PR to just be the easy ones. Then once you have a PR for that you can tackle the remaining underscore functions which will require either implementing our own version of the code or getting a package to do that, but best if that is in another PR so that we can review it faster.

Nandika-A commented 1 year ago

I have replaced all the underscore references whose native versions are available in PR 161. Please let me know if any changes are required.

coderhuBypassion commented 1 year ago

Can I try solving this issue as I'm new too!

StorytellerCZ commented 1 year ago

Yes, the initial easy part has been done by @Nandika-A, so now it is to figure out how to replace functions that hat don't have native equivalent. If the function is easy enough, we could probably create a utilities file with them and just have them in the package or we could import a package that has just that function as lodash I believe is now split into these tiny one function packages.

Nandika-A commented 1 year ago

@StorytellerCZ should I do the rest part also? Underscore is remaining in .any() and .isEqual(), which I had skipped earlier as their natives aren't available.

coderhuBypassion commented 1 year ago

@Nandika-A hnhn sure you can go for it.. its not like asking every time for contribution... Just code well and send PR

reywood commented 1 year ago

@StorytellerCZ should I do the rest part also? Underscore is remaining in .any() and .isEqual(), which I had skipped earlier as their natives aren't available.

I believe Array.some can replace _.any

Nandika-A commented 1 year ago

Yes, @reywood! And there are alternatives to _.isEqual() like JSON.stringify() and deep-equal, but they have some limitations. So should we import another package for this or create a utilities file?

Nandika-A commented 1 year ago

Hello @StorytellerCZ! The function _.isEqual() has its definition in lodash.isequal. Should I create a utilities file for this?

StorytellerCZ commented 1 year ago

That one looks big enough to be worthwhile to import as package.

Nandika-A commented 1 year ago

So should I import it as a Node.js module?

StorytellerCZ commented 1 year ago

Yes, do you know how to do it for packages?

Nandika-A commented 1 year ago

Yes, do you know how to do it for packages?

Yes, it is mentioned in the documentation." npm i lodash.isequal" will import '_.isEqual' as a module.

Nandika-A commented 1 year ago

I have replaced the remaining methods in PR #162 and installed lodash.isequal in node-modules. Please let me know if any changes are required.