@instantdb/core 0.22.93-experimental.drewh-ssr.20383114333.1 → 0.22.93-experimental.drewh-ssr.20384561223.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commonjs/Reactor.d.ts.map +1 -1
- package/dist/commonjs/Reactor.js +2 -1
- package/dist/commonjs/Reactor.js.map +1 -1
- package/dist/commonjs/createRouteHandler.js +2 -2
- package/dist/commonjs/createRouteHandler.js.map +1 -1
- package/dist/commonjs/framework.d.ts.map +1 -1
- package/dist/commonjs/framework.js +3 -0
- package/dist/commonjs/framework.js.map +1 -1
- package/dist/esm/Reactor.d.ts.map +1 -1
- package/dist/esm/Reactor.js +2 -1
- package/dist/esm/Reactor.js.map +1 -1
- package/dist/esm/createRouteHandler.js +2 -2
- package/dist/esm/createRouteHandler.js.map +1 -1
- package/dist/esm/framework.d.ts.map +1 -1
- package/dist/esm/framework.js +3 -0
- package/dist/esm/framework.js.map +1 -1
- package/dist/standalone/index.js +90 -90
- package/dist/standalone/index.umd.cjs +3 -3
- package/package.json +2 -2
- package/src/Reactor.js +2 -1
- package/src/createRouteHandler.ts +2 -2
- package/src/framework.ts +3 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instantdb/core",
|
|
3
|
-
"version": "0.22.93-experimental.drewh-ssr.
|
|
3
|
+
"version": "0.22.93-experimental.drewh-ssr.20384561223.1",
|
|
4
4
|
"description": "Instant's core local abstraction",
|
|
5
5
|
"homepage": "https://github.com/instantdb/instant/tree/main/client/packages/core",
|
|
6
6
|
"repository": {
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"dependencies": {
|
|
54
54
|
"mutative": "^1.0.10",
|
|
55
55
|
"uuid": "^11.1.0",
|
|
56
|
-
"@instantdb/version": "0.22.93-experimental.drewh-ssr.
|
|
56
|
+
"@instantdb/version": "0.22.93-experimental.drewh-ssr.20384561223.1"
|
|
57
57
|
},
|
|
58
58
|
"scripts": {
|
|
59
59
|
"test": "vitest",
|
package/src/Reactor.js
CHANGED
|
@@ -50,6 +50,7 @@ const STATUS = {
|
|
|
50
50
|
const QUERY_ONCE_TIMEOUT = 30_000;
|
|
51
51
|
const PENDING_TX_CLEANUP_TIMEOUT = 30_000;
|
|
52
52
|
const PENDING_MUTATION_CLEANUP_THRESHOLD = 200;
|
|
53
|
+
const ONE_MIN_MS = 1_000 * 60;
|
|
53
54
|
|
|
54
55
|
const defaultConfig = {
|
|
55
56
|
apiURI: 'https://api.instantdb.com',
|
|
@@ -355,7 +356,7 @@ export default class Reactor {
|
|
|
355
356
|
setInterval(async () => {
|
|
356
357
|
const currentUser = await this.getCurrentUser();
|
|
357
358
|
this.syncUserToEndpoint(currentUser.user);
|
|
358
|
-
},
|
|
359
|
+
}, ONE_MIN_MS);
|
|
359
360
|
|
|
360
361
|
NetworkListener.getIsOnline().then((isOnline) => {
|
|
361
362
|
this._isOnline = isOnline;
|
|
@@ -5,8 +5,8 @@ type CreateRouteHandlerConfig = {
|
|
|
5
5
|
};
|
|
6
6
|
|
|
7
7
|
function createUserSyncResponse(
|
|
8
|
-
user: User | null,
|
|
9
8
|
config: CreateRouteHandlerConfig,
|
|
9
|
+
user: User | null,
|
|
10
10
|
) {
|
|
11
11
|
if (user && user.refresh_token) {
|
|
12
12
|
return new Response(JSON.stringify({ ok: true }), {
|
|
@@ -54,7 +54,7 @@ export const createInstantRouteHandler = (config: CreateRouteHandlerConfig) => {
|
|
|
54
54
|
|
|
55
55
|
switch (body.type) {
|
|
56
56
|
case 'sync-user':
|
|
57
|
-
return createUserSyncResponse(body.user ?? null
|
|
57
|
+
return createUserSyncResponse(config, body.user ?? null);
|
|
58
58
|
default:
|
|
59
59
|
return errorResponse(400, `Unknown type: ${body.type}`);
|
|
60
60
|
}
|
package/src/framework.ts
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
// The FrameworkClient class is a mini version of a query store that allows making queries on both the frontend and backend
|
|
2
|
+
// you can register queries, await their results and serialize them over a server/client boundary.
|
|
3
|
+
// The class is generic so that it can be a good starting off point to make other ssr adapters.
|
|
1
4
|
import {
|
|
2
5
|
coerceQuery,
|
|
3
6
|
InstantCoreDatabase,
|