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

Export injectionKeys and functions #313

Merged
merged 3 commits into from
Jun 11, 2023
Merged

Conversation

veitbjarsch
Copy link
Contributor

@veitbjarsch veitbjarsch commented May 26, 2023

Background:
Back in Version 0.6.1 it was possible to extend the vue-leaflet plugin with own components interacting with the one of this plugin. I version 0.7.0 many improvements were introduced like typescript and Symbols. Unfortunately this broke the extendability of this repository, because since then it wasn't possible anymore to hook into the provide/inject methods. Back then and now this currently prevents the creation of any library extending the functionality of this plugin in the same vue like style.

Personal Intend:
My personal intend is to create a MarkerCluster component, which interacts with the vue-leaflet components and fits into the dom tree seamlessly. Therefor I need to use the injectionKeys.

PR (see Feature Request):
This PR exports 2 things. The injectionKeys, which are mandatory for the communication between the vue-leaflet components and external ones and the functions which can be used to build on top of it (e.g. the leaflet MarkerClusterGroup is based on the leaftlet FeatureGroup).

Any feedback would be welcome.

@veitbjarsch
Copy link
Contributor Author

@mikeu any chance we can discuss this change or get it merged soon? I think a bunch of people would be happy to extend your awesome work with things like the marker cluster.

@mikeu
Copy link
Contributor

mikeu commented Jun 6, 2023

@veitbjarsch yes, thank you for the contribution! I agree this is needed and will get to it soon. I might have some minor edits around the exported names, but it won't be a difficult one to merge. Should have time later this week, sorry for the delay so far!

@veitbjarsch
Copy link
Contributor Author

Sounds awesome. Yeah names can be adjusted was just a first suggestion from my side. Looking forward to get this PR merged :-)

@mikeu
Copy link
Contributor

mikeu commented Jun 11, 2023

@veitbjarsch I've finally had a chance to test this out locally, and agree it is a great PR that will I think also help to resolve #286. Before merging, we definitely need to change the naming of the export from featureGroup to include "feature" instead of "control".

Additionally, I think I would prefer the exports from lib to be capitalized, i.e. Functions and InjectionKeys. I also slightly prefer the initial letter capitalized for all of the exports from functions, so that we would have e.g. Functions.Circle.setupCircle. Those two sets of changes are definitely preferences though, and I am happy to hear reasons that they might be better as you wrote them in your initial suggestion. What do you think?

And finally, it would be great if you could add an ### Added section to the ## [Unreleased] section of the changelog, with an entry describing this addition! Thanks again for your contribution :)

@mikeu
Copy link
Contributor

mikeu commented Jun 11, 2023

Oh, and one more thought, I believe we should be removing "src/" from the "files" array property in package.json to ensure that custom components which import these elements do so through the compiled exports. Any reason not to make that change in this PR?

@veitbjarsch
Copy link
Contributor Author

Hey,
I implemented your suggestions. I have no special feelings about the capitalization of the first letter. But I agree you already did this in the other exports, so we should keep this equal. I also removed the "src/" from the build in the package.json. We should keep in mind that this is a breaking change because some people might rely on this. That's why I added this to the changelog too.

Btw. I also tried to write some comment in the changelog file, but in my opinion I'm not good in writing these things. So any feedback would be welcome.

@mikeu
Copy link
Contributor

mikeu commented Jun 11, 2023

Thank you @veitbjarsch , looks great to me! I may make a minor edit or two to the changelog wording before cutting the new release (probably "wanna" -> "want to" e.g.), but great to have this as a starting point, and good call on the "breaking" label.

@mikeu mikeu merged commit 51180d2 into vue-leaflet:master Jun 11, 2023
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.

2 participants