Releases: earthstar-project/react-earthstar
v3.0.0
This new version brings:
- Compatibility with the latest version of Earthstar 'Stone Soup'
- A new, vastly simplified AP
- Much improved performance
- And the removal of 'Earthbar'. Farewell old friend!
Please see the README for details on all the new APIs.
There's one I'm particularly pleased with, which is the new useReplica
hook. This hook returns a synchronous version of Earthstar's Replica
class, backed by a cache. It tracks the queries you make, and calls on React to re-render only when the results for queries you've made have changed. Each call of useReplica
has its own cache of tracked queries, so components only ever re-render for stuff they've queried for.
v2.0.1
This release contains a few performance improvements and bug fixes:
- Updates earthstar to v6.3.5, which fixes several issues related to syncing and attempting to save to storages after syncing
- Makes apps built with react-earthstar sync less often when switching between tabs
- Only closes storages when they are removed, rather than every time they are changed
v2.0.0
Earthstar core update 🎉
This release updates the peer dependency earthstar
to v6.3.1, which introduces breaking changes to how documents are queried, as well as support for asynchronous storages. The latter opens the way for IndexedDB storage support, which we're excited for as it will mean Earthstar apps being able to store far more data in future (the current limit being 5mb). More news on that soon.
This change from synchronous to asynchronous storages also changes how some hooks behave, as they cannot obtain their results right away. For now, new elements representing the state of the operation have been added, but in future we'll use React's Suspense API to improve this experience.
EarthstarPeer
now internally usesIStorageAsync
, consequently theinitWorkspaces
prop has changed toIStorageAsync[]
useDocument
now returns a fourth element which represents the status of the operation (idle
,pending
,success
)
Other improvements ✨
- Makes it so that when MultiWorkspaceTab is in use that the currentWorkspace is always null.
- When you remove a workspace, its pubs are now forgotten too
- Added a display name form to multiworkspace settings
Under the hood 🔧
- Now using
StorageLocalStorage
for document storage rather than a solution built into react-earthstar - Tests refactored for asynchronous API
v1.1.0
v1.1.0
Features
- Added a new ‘Delete my data’ button to Earthbar’s workspace setting.
- Also available as a separate
DeleteMyDataForm
component
- Also available as a separate
- Apps using react-earthstar now re-sync their workspaces when you come back to a tab after being away for a while.
- Added some extra guidances around Earthbar, particularly in the Join Workspace tab.
Fixes
- Adjusted how
useLocalStorageEarthstarSettings
works - it no longer updates when values in local storage update, as usually this hook would be used at the top of the component tree, and every document change would cause the app to re-render. - Adjusted the default vertical alignment of Earthbar elements
- Fixed an issue in which the wrong workspace would appear in the settings of a workspace’s settings in
MultiWorkspaceTab
v1.0.1
react-earthstar
A lot has changed since I started publishing preview versions of this a few months ago, but I think it's finally at the point where this birdie can leave the nest.
react-earthstar includes:
- Hooks to easily access and write data using the Earthstar protocol
- Earthbar — a thoughtfully designed, a11y focused Earthstar control centre you can drop into your app
- Pre-made components for common tasks such as switching workspaces, rendering display names, and signing in, and much much more
- Plenty of docs!
If you'd like to start digging in, head over to the README.
Want to see some apps with it running? Use the invitation code earthstar:///?workspace=+earthstardev.p7fa9&pub=https://earthstar-demo-pub-v5-a.glitch.me&v=1
in any of the apps below.
- earthstar-status - A status message (source)
- Twodays-crossing - An ephemeral RP chatroom (source)
I have had a lot of fun building this, and I hope you have just as much fun making things with it.
Special thanks go to @cinnamon-bun and @rbmntjs whose help made this release extra special, and whose friendship is invaluable to me.
If you're interested in learning more, come join our friendly community on the Earthstar Discord.