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

Remove LoDash dependency #1467

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ChrisMBarr
Copy link
Contributor

My Angular project uses ChordsheetJS and it gave this this warning upon build about Chordsheet using LoDash, which is not an ESM module

2024-11-29 11_32_59-package json - LyricConverter - Visual Studio Code

Looking into it, I saw ChordsheetJS only used LoDash's _.get() method, and it only ever used it to access a single property. Seems like an easy one to just access directly with a helper method that has a default/fallback of an empty string

Copy link

codeclimate bot commented Nov 29, 2024

Code Climate has analyzed commit bc9ccd1 and detected 0 issues on this pull request.

View more on Code Climate.

@ChrisMBarr
Copy link
Contributor Author

Not sure what the deal is with that failure, it seems unrelated to any of the changes I made since all the tests pass

@martijnversluis
Copy link
Owner

Hey @ChrisMBarr. Thanks so much for taking the time to look at this! I do agree it would be great to drop all runtime dependencies.

Unfortunately, being able to get any key from metadata is critical to support the chordpro standard. For example, there are official metadata directives and you can define and use arbitrary values (like {x_myapp_some_setting}). It is also possible to get array values. See also the docs for metadata.get.

This means, if we remove the dependency, that we have to cover the existing functionality.

If you would like help with that, surely let me know! 🙏

@ChrisMBarr
Copy link
Contributor Author

Oh ok, I didn't realize that get was a public method! Ok, I have something I can fall back to using something like this: https://github.com/you-dont-need/You-Dont-Need-Lodash-Underscore#_get

@martijnversluis
Copy link
Owner

Ok, I have something I can fall back to using something like this: https://github.com/you-dont-need/You-Dont-Need-Lodash-Underscore#_get

That sure looks like a great replacement!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Awaiting
Development

Successfully merging this pull request may close these issues.

2 participants