While you were at Thanksgiving, we were busy! Here are the new features in Convex 0.6.0:
- React Native
- Mobile Browser Support
uniquenow can return
npx convex importImprovements
- Connection Status Information
It is easier than ever to use React Native with Convex! We have new documentation that explains how to configure Convex for a React Native environment. Additionally, there is a new React Native demo app that you can use to get started.
Mobile Browser Support
ConvexReactClient now works better in mobile browsers. This release includes logic to detect when the
WebSocket connection to the Convex backend has died and automatically reconnect. This is important for browsers like Safari on iOS that don’t detect this automatically.
unique now can return
const counter = await db.query("counter").unique();
would throw an exception if there are no documents in the
.unique() will return null if no documents are found:
const counterOrNull = await db.query("counter").unique();
We believe this is a better default for the majority of use cases. Often you aren’t sure that a document will exist and should explicitly handle that case. You can still throw an exception if you encounter
npx convex import Improvements
We’ve made a number of improvements to importing data with
npx convex import:
- You can now import JSON files that contain an array of JSON objects in addition to existing support for JSON lines files with an object on each line.
- No need to specify the file format with
--format! The CLI will infer your file’s format based on its extension (
- If your table already has data, you can append new documents into it using
--appendor replace the contents with
- The import size limit has increased to 8192 rows and 8 MiB.
Connection Status Information
ConvexReactClient now exposes a
This has information on whether there are any inflight mutations or actions within the client. It also describes whether the client has a current connection to the Convex backend.
This information can be useful for exposing connection status information to the user. For example, Convex apps may want to render a banner if the client has been unable to connect to the backend for an extended period of time.