Skip to content

Conversation

ErikSin
Copy link
Contributor

@ErikSin ErikSin commented May 20, 2025

Adds exportGeoJSONFile and exportZipFile

@ErikSin ErikSin requested a review from achou11 May 20, 2025 18:25
@awana-lockfile-bot
Copy link

package-lock.json changes

Click to toggle table visibility
Name Status Previous Current
@comapeo/core UPDATED 3.1.2 3.2.0
@types/compress-commons ADDED - 7.0.1
@types/crc32-stream ADDED - 4.0.3
@types/readable-stream ADDED - 4.0.18
@types/zip-stream ADDED - 7.0.0
zip-stream-promise ADDED - 1.0.2

Copy link
Member

@achou11 achou11 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make sure to run the docs generation command after updating the types

@ErikSin
Copy link
Contributor Author

ErikSin commented May 20, 2025

I suppose this brings up the question of what the overall philosophy is behind this repo. Is it simply just a wrapper for core? Or are we creating custom hooks for the consuming modules?

(personal opinion -so not saying it is the right opinion) I think we should be leaning towards customizing the hooks for the usage of the consuming modules. My mentality is that if it is simply a wrapper, creating an entire repo feels like were just doubling the work. To me the advantage of having an entire repo is we can be more granular with the hooks, with the overall goal of simplifying the code for the consuming modules.

Im curious what your opinion is?

I also think that if the mentality around has been more of just a wrapper, then we probably should keep it that way now for consistency. But perhaps worth having a bigger discussion about this in the future!

@achou11
Copy link
Member

achou11 commented May 20, 2025

(personal opinion -so not saying it is the right opinion) I think we should be leaning towards customizing the hooks for the usage of the consuming modules. My mentality is that if it is simply a wrapper, creating an entire repo feels like were just doubling the work. To me the advantage of having an entire repo is we can be more granular with the hooks, with the overall goal of simplifying the code for the consuming modules.

I'm not against doing this in the future, but because of the various unknowns when it comes to usage of the core api via the hooks, I've opted for keeping the implementation as a more direct wrapper for core. Making it more opinionated adds the risk of "mis-anticipating" the desired end-usage, which is something that isn't ideal for a library from a philosophical perspective.

RE: "doubling the work" - I think this is a potentially valid concern, but I haven't seen much evidence of this being a notable issue so far. if there's anything that has felt like this, I think it's because we're doing unnecessary work to wrap the exposed hooks instead of using functional approaches. I believe what I've written in digidem/comapeo-mobile#1081 is related to this.

I also think that if the mentality around has been more of just a wrapper, then we probably should keep it that way now for consistency. But perhaps worth having a bigger discussion about this in the future!

yeah I'd rather keep things consistent right now and stick with this being a flexible wrapper.

@achou11
Copy link
Member

achou11 commented May 20, 2025

To me, the main benefit of this library is consistent APIs for using core in React and centralized invalidation of data when working with core (which is what React Query specifically provides).

I find it preferable to know that what's exposed here maps directly to what core provides. There's one fewer layer to worry about when it comes to understanding how to use core via React.

@ErikSin ErikSin requested a review from achou11 May 20, 2025 19:24
@ErikSin
Copy link
Contributor Author

ErikSin commented May 20, 2025

Make sure to run the docs generation command after updating the types

out of curiosity, is there a reason we dont automate this, specifically as a post push step?

@ErikSin ErikSin merged commit 3be08c0 into main May 20, 2025
5 checks passed
@ErikSin ErikSin deleted the feat-new-export-API branch May 20, 2025 19:36
@achou11
Copy link
Member

achou11 commented May 20, 2025

out of curiosity, is there a reason we dont automate this, specifically as a post push step?

mostly just didn't spend the time to figure it out 😄 also, i personally don't like automations that auto-commit code to a branch i work on, so I haven't prioritized looking into it

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