Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
0825b6b
feat: Add stubbed map sharing API
gmaclennan Nov 25, 2025
26b4e28
fix naming & jsdoc for useRequestCancelMapShare
gmaclennan Dec 1, 2025
7ee3fbd
fix MapShare type
gmaclennan Dec 1, 2025
69a1cea
Return shareId from accept map share mutation.
gmaclennan Dec 1, 2025
a024869
increase timeout for sendMapShare stub
gmaclennan Dec 1, 2025
1af841d
Add reason to reject response
gmaclennan Dec 3, 2025
371e486
add other map hooks to package exports
achou11 Dec 9, 2025
5111aa4
initial integration with map-server (WIP)
gmaclennan Jan 27, 2026
9e9fe6d
MapServerContext impl
gmaclennan Feb 5, 2026
8a01ddd
WIP received map shares store
gmaclennan Feb 6, 2026
c8a5746
add map shares stores
gmaclennan Feb 9, 2026
586e92d
wrap providers in single provider
gmaclennan Feb 10, 2026
6d346ad
cleanup and fix
gmaclennan Feb 10, 2026
aab58d0
finish up implementation
gmaclennan Feb 11, 2026
9ab5364
add hooks tests
gmaclennan Feb 11, 2026
4e0e989
Merge branch 'main' into feat/map-sharing
gmaclennan Feb 11, 2026
ace042e
update package-lock
gmaclennan Feb 11, 2026
0a2b962
update readme and docs
gmaclennan Feb 11, 2026
536f3a5
fix useMapStyleUrl test & types
gmaclennan Feb 11, 2026
0eaaf91
fix types and lint errors
gmaclennan Feb 11, 2026
66e0746
fix linting errors
gmaclennan Feb 11, 2026
6e140d3
update to latest map-server
gmaclennan Feb 11, 2026
a71b9e4
add download progress tests
gmaclennan Feb 11, 2026
df658b0
add additional tests for error paths
gmaclennan Feb 11, 2026
6e5f63e
fix dependencies
gmaclennan Feb 12, 2026
b5c84d4
fix: map style json URL should use 'default' not 'custom'
gmaclennan Feb 12, 2026
0430f7a
feat: map import, delete & info hooks
gmaclennan Feb 13, 2026
0a6bf97
support expo File for map import
gmaclennan Feb 13, 2026
cec8afa
remove expo-file-system dep
gmaclennan Feb 13, 2026
22f6d95
don't use ky at runtime for expo compat
gmaclennan Feb 13, 2026
fdb2443
fix: use uppercase method names for requests
gmaclennan Feb 16, 2026
1a3d354
fix: don't use suspense for map info query
gmaclennan Feb 16, 2026
fe3d245
parse json for response errors
gmaclennan Feb 16, 2026
ac30cbd
consistent HTTPErrors
gmaclennan Feb 16, 2026
bbcf530
fix: expo/fetch only accepts string not URL as input
gmaclennan Feb 16, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 54 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,60 @@ React wrapper for working with [`@comapeo/core`](https://github.com/digidem/coma
npm install react @tanstack/react-query@5 @comapeo/core-react @comapeo/schema @comapeo/core @comapeo/ipc
```

## Setup

### Basic Setup

Wrap your application with `ClientApiProvider` and a React Query `QueryClientProvider`:

```tsx
import { ClientApiProvider } from '@comapeo/core-react'
import { QueryClient, QueryClientProvider } from '@tanstack/react-query'

const queryClient = new QueryClient()

function App() {
return (
<QueryClientProvider client={queryClient}>
<ClientApiProvider clientApi={clientApi}>
<MyApp />
</ClientApiProvider>
</QueryClientProvider>
)
}
```

### Map Sharing Setup

To use the map sharing hooks, you also need to wrap your application with `MapServerProvider`. Provide a `getBaseUrl` function that returns a Promise resolving to the base URL of your map server:

```tsx
import { MapServerProvider } from '@comapeo/core-react'
import { createServer } from '@comapeo/map-server'

const server = createServer()
const listenPromise = server.listen()

const getBaseUrl = async () => {
const { localPort } = await listenPromise
return new URL(`http://localhost:${localPort}/`)
}

function App() {
return (
<QueryClientProvider client={queryClient}>
<ClientApiProvider clientApi={clientApi}>
<MapServerProvider getBaseUrl={getBaseUrl}>
<MyApp />
</MapServerProvider>
</ClientApiProvider>
</QueryClientProvider>
)
}
```

Hooks that communicate with the map server will wait for `getBaseUrl()` to resolve before making requests, so the provider can be mounted before the server is ready. You can also provide an optional `fetch` prop to use a custom fetch implementation.

## API Documentation

Still a work in progress. Currently lives in [`docs/API.md`](./docs/API.md).
Expand Down
Loading