evoluhq / evolu Goto Github PK
View Code? Open in Web Editor NEWA local-first platform designed for privacy, ease of use, and no vendor lock-in
Home Page: https://evolu.dev
License: MIT License
A local-first platform designed for privacy, ease of use, and no vendor lock-in
Home Page: https://evolu.dev
License: MIT License
So it's easier to reuse.
A web for Evolu development. Docs, showcases, etc. Use some Tailwind starters like https://github.com/timlrx/tailwind-nextjs-starter-blog or similar.
Because of the license and because OPFS and LocalStorage are good enough.
Vitest with Playwright for all Evolu use-cases. Test network traffic.
The current config silences SQLite because it's verbose.
self.sqlite3ApiConfig = {
debug: constVoid,
log: constVoid,
warn: constVoid,
error: constVoid,
};
e.g.
import { getError, subscribeError } from "evolu"
useEffect(() => {
const notifyOnError = () => {
console.error(getError())
}
return subscribeError(notifyOnError)
}, [])
What is missing in the readme? I think I should write more about CRDT, links are not enough. Should I?
Run prepublishOnly on PRs
Switch to upcoming fp-ts 3 with better ESM support for Node.js.
The API for rows history.
Waiting for the next https://github.com/evanw/esbuild major version with breaking changes for Web Workers.
The app has to be able to import data created from a newer version because forcing users to update is bad UX. Evolu should detect a missing column error, alter the table, and then repeat the import of the affected row.
Really interested in evolu so was trying out the example app on Safari on Mac and iPhone. Works fine on Safari on Mac but crashes on iOS safari (iPhone 8 - iOS 15.1)
Here is a screenshot of the crash - probably mobile Safari does not support one of the browser APIs used by evolu.
The underlying question I was trying to figure out is whether evolu can synchronise data when one of the peers is offline. Does the server store a complete copy of the data or does it delete the data once it has been relayed to the other device?
Nostr has a similar architecture. We should investigate whether we can reuse something.
And generate docs from that. Consider https://github.com/gcanti/docs-ts
It was a workaround for the non-ESM build.
Blocked by SQLite, but hopefully, I will convince them.
For Automerge and the other binary-based libs within Evolu.
The sync worker should be created from the DB worker. It's finally supported in Safari 160 preview. Now we have to wait several months, at least, maybe even more, until it will be generally available.
stackblitz or codesandbox?
The idea is similar to https://remotestorage.io.
Use the same data across different apps. Create a to-do list in one app, and track the time on your tasks in another one. Say goodbye to app-specific data silos.
Evolu app is any app using Evolu lib. To protect Evolu Mnemonic, #118 must be implemented.
Because any Evolu app using a mnemonic has access to all owner's data, Evolu apps must be audited for fetch, etc. usage.
Let's discuss this.
Replace reset/show/recover mnemonic with "Connect with FIDO2".
Via hmac-secret. It should be what Evolu needs.
has
is a very useful helper and should be integrated into the existing Evolu API.
All row columns except for id are nullable by default. A column can be null for two reasons. It's not loaded yet, or it's obsolete. That's why the has
helper is so useful, and that's why it belongs to the application itself.
I'm not sure whether it can be refactored into the createHooks
, but I'm pretty sure it can be refactored into useQuery
. And with memorization, of course.
Some nullable columns are nullable for a reason, while others are just not yet loaded. The best place is createHooks
, I believe.
Rows are actually not deleted. They are only marked as deleted. But the current API is not ideal because practically all queries have to be filtered. A proposal:
isDeleted
column with internal/invisible __isDeleted
useMutation
With such a change, developers wouldn't have to filter rows everywhere.
Optimize for row records. There is an interesting PR chbrown/rfc6902#88. Another idea is to leverage https://github.com/google/diff-match-patch. It's for text, but we can map an array of rows to their hashes written in the line.
Sqlite for React Native and https://github.com/craftzdog/react-native-aes-gcm-crypto or similar for symmetric encryption.
We are using a fork of https://github.com/bitcoinjs/bip39, because the original library is not tree-shakeable.
We have to port validateMnemonic implementation as well.
const evoluError = useSyncExternalStore(subscribeError, getError, constNull);
useEffect(() => {
// eslint-disable-next-line no-console
if (evoluError) console.log(evoluError);
}, [evoluError]);
All row columns except for id are nullable by default. A column can be null for two reasons. It's not loaded yet, or it's obsolete. That's why the has
helper is so useful, and that's why it belongs to the application itself.
TODO: Add an example to README.md.
const nodes = pipe(
useQuery((db) =>
db
.selectFrom("node")
.select(["id", "md"])
.where("isDeleted", "is not", model.cast(true))
.where("id", "in", ids)
),
(a) => ({ ...a, rows: a.rows.filter(has(["md"])) })
);
It solves ESM issue with required .js
. effect-ts is using it.
There is no reason for the Evolu server to be part of the evolu
library.
Another idea is to hold the clock, Merkle tree, and table definitions in tab memory to skip reads, but it's unfortunately impossible because inactive tabs would have to be updated in the background, and such an async operation can't be reliable, AFAIK. We can already do that because we have one DB instance per many tabs.
For m:n relations, consider https://github.com/ccorcos/tuple-database#Motivation as an additional abstraction. SQL has to be always supported because that's what people use and know. The core idea of a tuple database is to build indexes by queries; I think Evolu can do that, too, because it does not expose mutation SQLite API.
IMHO unnecessary
These operations can still be detected quickly. Remember, the perfect diff is impossible to compute quickly.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.