Skip to content

chore: remove unused clustering hooks from src - #1054

Merged
usefulthink merged 1 commit into
visgl:mainfrom
samithahansaka:chore/remove-src-supercluster-duplicates
Aug 12, 2026
Merged

chore: remove unused clustering hooks from src#1054
usefulthink merged 1 commit into
visgl:mainfrom
samithahansaka:chore/remove-src-supercluster-duplicates

Conversation

@samithahansaka

Copy link
Copy Markdown
Contributor

Removes src/hooks/use-supercluster-worker.ts and src/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 in src were never used by anything.

Why this is not a breaking change

  • neither is re-exported from src/index.ts
  • neither is imported anywhere inside src
  • no tests and no docs reference them
  • supercluster is not a dependency of the library
  • they never reached dist, so no bundle ever contained them

./src is part of files, so the sources did ship inside the npm tarball. They still were not reachable: the exports map only declares ., ./server, ./3d and ./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-map versus @vis.gl/react-google-maps) and a doc link. I diffed them to confirm.

Worth noting that useMapViewport existed in three places, not two. examples/custom-marker-clustering has its own older copy which this PR does not touch, so that one is now the remaining duplicate.

npm test and npm run build pass, examples included.

`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 usefulthink left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Awesome, thanks a lot!

@usefulthink
usefulthink merged commit 106f6fb into visgl:main Aug 12, 2026
2 checks passed
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