chore: remove unused clustering hooks from src - #1054
Merged
usefulthink merged 1 commit intoAug 12, 2026
Merged
Conversation
`useSuperclusterWorker` and `useMapViewport` were added to `src/hooks` alongside the worker clustering example in visgl#891, but the example imports its own copies under `examples/worker-marker-clustering/src/hooks`, so the ones in `src` were never used. They are not exported from `src/index.ts`, not imported anywhere inside `src`, and have no tests, so they never reached `dist`. `./src` is part of `files`, so the sources did ship in the tarball, but the `exports` map has no entry that would let anything import them. `supercluster` is not a dependency of the library either. Removing them is not a breaking change. Refs visgl#1049
usefulthink
approved these changes
Aug 12, 2026
usefulthink
left a comment
Collaborator
There was a problem hiding this comment.
Awesome, thanks a lot!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Removes
src/hooks/use-supercluster-worker.tsandsrc/hooks/use-map-viewport.ts, as discussed in #1049.Both were added alongside the worker clustering example in #891. The example imports its own copies under
examples/worker-marker-clustering/src/hooks, so the ones insrcwere never used by anything.Why this is not a breaking change
src/index.tssrcsuperclusteris not a dependency of the librarydist, so no bundle ever contained them./srcis part offiles, so the sources did ship inside the npm tarball. They still were not reachable: theexportsmap only declares.,./server,./3dand./examples.css, so there is no specifier that resolves to them.Nothing is lost
Both deleted files are byte-identical to the copies under
examples/worker-marker-clustering/src/hooks, apart from one import path (./use-mapversus@vis.gl/react-google-maps) and a doc link. I diffed them to confirm.Worth noting that
useMapViewportexisted in three places, not two.examples/custom-marker-clusteringhas its own older copy which this PR does not touch, so that one is now the remaining duplicate.npm testandnpm run buildpass, examples included.