![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
replicache
Advanced tools
At the moment we haven't published this to npm. Until then you can git clone
replicache-sdk-js
and add a file:
dependency.
Either by npm install
'ing the git repo, cloning it, or downloading a
release.
Replicache JS SDK is written in TypeScript. Run npm run build
to generate the JS source code (JS source is outputted in out/
). By default we generate browser compatible JS but you can also build CommonJS modules by running npm run build:cjs
. Let us know what your needs are.
The binaries are downloaded when you do npm install
. If for some reason you need to redownload these you can manually run tool/build.sh
. Do this again whenever you update the SDK.
test-server
Currently, the JavaScript SDK relies on a native local server that implements the guts of the sync protocol on the client side. This is temporary and will be removed.
For now, you must have this server running whenever you are working with the SDK:
mkdir ~/.repm
npx test-server --storage-dir=$HOME/.repm
See Replicache Server Setup for server-side instructions.
For the rest of these instructions we will assume your data layer is
running on localhost:3000
.
In production, your app will talk to the production Replicache diff-server at https://serve.replicache.dev/.
During development, that server can't reach your workstation, so we provide a development instance to work against instead. Leave this running in a tab:
# The --client-view flag should point to the Client View endpoint
# on your development data layer.
npx diff-server --client-view="http://localhost:3000/replicache-client-view"
It is recommended to use ES modules (but we also include CommonJS for backwards compat).
import Replicache, {REPMHTTPInvoker} from 'replicache';
To use Replicache
you currently have to tell it how to invoke the Replicache Client API Module (REPM).
const diffServerURL = 'https://serve.replicache.dev/pull';
const diffServerAuth = '<your diff-server account ID>';
const batchURL = 'https://youservice.com/replicache-batch';
const dataLayerAuth = '<your data-layer auth token>';
const repmInvoker = new REPMHTTPInvoker('http://localhost:7002');
const repmInvoke = repmInvoker.invoke;
const replicache = new Replicache({
diffServerURL,
diffServerAuth,
batchURL,
dataLayerAuth,
repmInvoke,
});
const value = await replicache.query(tx => tx.get('/hello'));
console.log(value);
FAQs
Realtime sync for any backend stack
We found that replicache demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 8 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.