You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
*The graph database for delightful React state management*
10
12
11
-
## Installation
13
+
14
+
Homebase React makes state management painless by enabling you to plug a relational graph database into your React application with just 3 lines of code. This is the same database that powers Roam Research and many other ClojureScript applications, but with an API that's familiar to React and JS developers.
- The simplest and most declarative state management solution
27
+
- The power of a backend relational graph database, but without having to wait on the network
28
+
- Convenient JSON query syntax
29
+
- Powerful Clojure style [Datalog](https://docs.datomic.com/on-prem/query.html) query syntax if you need it
30
+
- Traverse your data graph like it's a big JSON object
31
+
- Backup your data to the cloud
20
32
21
-
## Purpose
22
-
23
-
Data should be a first class citizen on the client. We deserve the ergonomics and power of relational databases not just on the server, but in our React applications.
24
-
25
-
Homebase React lets you plug a relational database into your React application with just 3 lines of code. In fact, it's the same database that powers Roam Research and many other ClojureScript applications, but with an API that's familiar to React and JS developers.
26
-
27
-
- Replace Redux with something simpler and more declarative
28
-
- Stop spending time wiring up custom datatypes, reducers, caches and other bespoke state mumbo jumbo
29
-
- Gain all the benefits of relational data like a single source of truth
30
-
- Traverse your data graph like it's one big JSON object
31
-
- Query your database with a convenient JSON query syntax
32
-
- Query your database with Clojure style [Datalog](https://docs.datomic.com/on-prem/query.html) if you need more power
33
-
- It's just data
33
+
## Roadmap
34
34
35
-
The goal of Homebase React is to be immediately more intuitive than any denormalized JSON store and over time we will eliminate all the tedious aspects of manipulating data on clients. Homebase React makes it easier to work with complex data on client by making our applications [local-first](https://news.ycombinator.com/item?id=21581444).
35
+
1. Document integration with more backends
36
+
1. Swap [Datascript](https://github.com/tonsky/datascript) out for [Datahike](https://github.com/replikativ/datahike)
37
+
1. Immutability
38
+
1. History / Change Tracking
39
+
2. Persist to IndexedDB
40
+
3.[Local-first](https://www.inkandswitch.com/local-first.html) conflict resolution for offline caching and sync between multiple devices
36
41
37
42
## Examples
38
43
### Live Demos
@@ -41,7 +46,6 @@ You can see our hosted live demos [here](https://homebaseio.github.io/homebase-r
41
46
### Code Examples
42
47
You can clone and run our React code examples [here](https://github.com/homebaseio/homebase-react-examples).
43
48
44
-
45
49
## API Overview
46
50
47
51
### `HomebaseProvider`
@@ -52,13 +56,12 @@ The HomebaseProvider wraps your React app and makes a relational database access
Use queries to return an array of entities that meet a given criteria. Our query API is powered by datalog, but exposed as JSON similar to a JS SQL driver or Mongo DB. Datalog is similar to SQL and is incredibly powerful. However only a subset of features are currently available in JSON.
138
+
Use queries to return an array of entities that meet a given criteria. Our query API is powered by Datalog, but exposed as JSON similar to a JS SQL driver or MongoDB. Datalog is similar to SQL and is incredibly powerful. However, only a subset of features are currently available in JSON.
136
139
137
-
We are very interested in what features the community wants, and will prioritize based on feedback. In the meantime you can further filter results with JS `filter()` and `sort()`.
140
+
We will prioritize features based on community feedback so please open an issue if there's something you need. In the meantime you can further filter results with JS `filter()` and `sort()`.
138
141
139
142
```js
140
143
// Finds all todos with a name
@@ -167,6 +170,8 @@ This hook returns the current database client with some helpful functions for sy
167
170
168
171
Check out the [Firebase example](https://homebaseio.github.io/homebase-react/#!/example.todo_firebase) for a demonstration of how you might integrate a backend.
169
172
173
+
174
+
170
175
## Performance
171
176
172
177
Homebase React tracks the attributes consumed in each component via the `entity.get` function and scopes those attributes to their respective `useEntity` or `useQuery` hook. Re-renders are only triggered when an attribute changes.
@@ -201,17 +206,6 @@ const Todo = React.memo(({ todo }) => {
0 commit comments