toiljs 0.0.64 → 0.0.66
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/CHANGELOG.md +10 -0
- package/build/client/.tsbuildinfo +1 -1
- package/build/client/routing/mount.js +3 -0
- package/build/compiler/.tsbuildinfo +1 -1
- package/build/compiler/index.js +61 -1
- package/build/devserver/.tsbuildinfo +1 -1
- package/build/devserver/db/catalog.js +1 -1
- package/build/devserver/server.js +3 -1
- package/examples/basic/client/public/index.html +11 -1
- package/examples/basic/client/routes/features/index.tsx +3 -0
- package/examples/basic/client/routes/get-started.tsx +3 -0
- package/examples/basic/client/routes/index.tsx +3 -0
- package/examples/basic/client/routes/search.tsx +4 -0
- package/package.json +1 -1
- package/src/client/routing/mount.tsx +6 -0
- package/src/compiler/index.ts +72 -1
- package/src/devserver/db/catalog.ts +1 -1
- package/src/devserver/server.ts +8 -1
- package/test/devserver-database.test.ts +12 -2
|
@@ -92,7 +92,7 @@ function routeKindsSection(routes: readonly (readonly [number, number, string])[
|
|
|
92
92
|
return Buffer.concat(chunks);
|
|
93
93
|
}
|
|
94
94
|
|
|
95
|
-
function catalogSectionV2(fillMaxWaitMs: number, fillAllowStale: number): Buffer {
|
|
95
|
+
function catalogSectionV2(fillMaxWaitMs: number, fillAllowStale: number, replication = 5): Buffer {
|
|
96
96
|
const chunks: Buffer[] = [];
|
|
97
97
|
const u8 = (v: number) => chunks.push(Buffer.from([v & 0xff]));
|
|
98
98
|
const u16 = (v: number) => {
|
|
@@ -122,7 +122,7 @@ function catalogSectionV2(fillMaxWaitMs: number, fillAllowStale: number): Buffer
|
|
|
122
122
|
u32(0xaaaa);
|
|
123
123
|
u32(0x1234);
|
|
124
124
|
u32(0); // generation
|
|
125
|
-
u8(
|
|
125
|
+
u8(replication); // replication
|
|
126
126
|
u8(0); // placement = hashKey
|
|
127
127
|
u32(fillMaxWaitMs);
|
|
128
128
|
u8(fillAllowStale);
|
|
@@ -231,6 +231,16 @@ describe('toildb dev emulator (record family)', () => {
|
|
|
231
231
|
});
|
|
232
232
|
});
|
|
233
233
|
|
|
234
|
+
it('rejects replication policies that require catalog v3 metadata', () => {
|
|
235
|
+
for (const replication of [3, 4]) {
|
|
236
|
+
setDbCatalog(wasmWithSection('toildb.catalog', catalogSectionV2(7, 0, replication)));
|
|
237
|
+
const { imports, buf } = setupRaw();
|
|
238
|
+
const [p, l] = put(buf, 0, 'App/users');
|
|
239
|
+
|
|
240
|
+
expect(imports['data.resolve_collection'](p, l, 16)).toBe(-1070);
|
|
241
|
+
}
|
|
242
|
+
});
|
|
243
|
+
|
|
234
244
|
it('rejects malformed catalog v2 fill policy', () => {
|
|
235
245
|
setDbCatalog(wasmWithSection('toildb.catalog', catalogSectionV2(7, 2)));
|
|
236
246
|
const { imports, buf } = setupRaw();
|