mouse0270 / module-credits

Lists the authors of projects on the Manage Modules Window. If a url is provided in the module.json file, it will make the version tag link to the module url.
MIT License
7 stars 7 forks source link

Conflict with DF Chat Enhancements #9

Closed flamewave000 closed 2 years ago

flamewave000 commented 2 years ago

A user reported this conflict here: DF Chat Enhancements: Module Credits #298.

It appears we are both using the marked library, but maybe different versions. Mine uses the marked.parse() function to convert markdown to HTML, while yours appears to use marked() instead.

I just want to reach out and see if we can resolve this some way that works best. I was kind of thinking that since Markdown is a very popular format, maybe a Library Module would make sense, similar to arcanist's Ace Library.

mouse0270 commented 2 years ago

I am actually updating module credits to use esmodule instead, which should solve this conflict as my version of marked wont be used outside of my module. At least that is my understanding.

EDIT: To be clear, I am not opposed to using a library either. I just was working on Module Credits this past weekend to update it to the new version of foundry and decided to switch it to a esmodule to try and self contain my modules a little.

I can install your module (Already using quite a few I am sure DF Chat enhancements is amazing like the rest) and verify if my updated module resolves the conflict.

mouse0270 commented 2 years ago

Just confirmed, in the next release of module credits our modules do not conflict. However, if you do want to expand marked into a library, we can go from there.

mouse0270 commented 2 years ago

Resolved in version 0.0.4.0 (I don't fully understand ES Modules, but if I understand them correctly, this should no longer cause a conflict.)

flamewave000 commented 2 years ago

Sounds good. I think a library module would be good too though so users only need to download one copy of Marked instead of two.

Esmodules essentially "scope" your code so that they can only access things in the globalThis and what ever is directly imported, and nothing outside a module can see inside it. So any regular script running in the window cannot see anything defined inside a module.