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

refactor: add promisified wrapper for MBTiles #1321

Merged
merged 1 commit into from
Aug 28, 2024

Conversation

akx
Copy link
Contributor

@akx akx commented Jul 18, 2024

This adds a small wrapper around the @mapbox/mbtiles MBTiles class to promisify opening them (instead of callback pyramids).

This opens up avenues to further DRY out the code and make things more async and modern.

@akx akx marked this pull request as draft July 18, 2024 06:53
@akx akx marked this pull request as ready for review July 18, 2024 06:53
@akx akx marked this pull request as draft July 31, 2024 15:36
@akx akx force-pushed the mbtiles-promises branch 2 times, most recently from 6475aa4 to cda0eaf Compare July 31, 2024 15:39
@akx
Copy link
Contributor Author

akx commented Jul 31, 2024

Okay, rebased post #1320 merge.

@akx akx marked this pull request as ready for review July 31, 2024 15:41
@akx
Copy link
Contributor Author

akx commented Aug 27, 2024

ping @acalcutt :)

@acalcutt
Copy link
Collaborator

Overall I do think this looks cleaner and I am likely going to merge this.

This one thing I am wondering about id the file name of the wrapper. It seems like pmtiles_adapter.js and mbtiles_wrapper.js should be named more similarly. That is just really a nitpick thing.

Speaking of pmtiles, I probably did not promisify it very well, so I am wondering if you think there are any improvements there with pmtiles like these changes.

Signed-off-by: Aarni Koskela <akx@iki.fi>
@akx
Copy link
Contributor Author

akx commented Aug 28, 2024

This one thing I am wondering about id the file name of the wrapper. It seems like pmtiles_adapter.js and mbtiles_wrapper.js should be named more similarly. That is just really a nitpick thing.

Maybe. I just named the file after the class name, and the class really is just a simple wrapper around MBTiles :)

Copy link
Collaborator

@acalcutt acalcutt left a comment

Choose a reason for hiding this comment

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

Looks cleaner to me. Tested it locally and it seems to work fine

In the future we might want to look at renaming a few of these files, but we can think about it more.

@acalcutt acalcutt merged commit 664afe6 into maptiler:master Aug 28, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants