rwsdk 1.0.0-beta.41 → 1.0.0-beta.43
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/lib/e2e/dev.mjs +14 -10
- package/dist/lib/e2e/index.d.mts +1 -0
- package/dist/lib/e2e/index.mjs +1 -0
- package/dist/lib/e2e/release.mjs +9 -4
- package/dist/lib/e2e/testHarness.d.mts +9 -4
- package/dist/lib/e2e/testHarness.mjs +20 -2
- package/dist/runtime/client/client.d.ts +32 -4
- package/dist/runtime/client/client.js +98 -14
- package/dist/runtime/client/navigation.d.ts +6 -2
- package/dist/runtime/client/navigation.js +29 -17
- package/dist/runtime/client/navigationCache.d.ts +68 -0
- package/dist/runtime/client/navigationCache.js +294 -0
- package/dist/runtime/client/navigationCache.test.d.ts +1 -0
- package/dist/runtime/client/navigationCache.test.js +456 -0
- package/dist/runtime/client/types.d.ts +25 -3
- package/dist/runtime/client/types.js +7 -1
- package/dist/runtime/lib/realtime/client.js +17 -1
- package/dist/runtime/render/normalizeActionResult.js +8 -1
- package/dist/use-synced-state/SyncedStateServer.d.mts +19 -4
- package/dist/use-synced-state/SyncedStateServer.mjs +76 -8
- package/dist/use-synced-state/__tests__/SyncStateServer.test.mjs +18 -11
- package/dist/use-synced-state/__tests__/worker.test.mjs +13 -12
- package/dist/use-synced-state/client-core.d.ts +3 -0
- package/dist/use-synced-state/client-core.js +77 -13
- package/dist/use-synced-state/useSyncedState.d.ts +3 -2
- package/dist/use-synced-state/useSyncedState.js +9 -3
- package/dist/use-synced-state/worker.d.mts +2 -1
- package/dist/use-synced-state/worker.mjs +82 -16
- package/dist/vite/transformClientComponents.test.mjs +32 -0
- package/package.json +7 -3
|
@@ -288,6 +288,7 @@ function SidebarGroup() { return jsx("div", {}); }
|
|
|
288
288
|
function SidebarGroupLabel() { return jsx("div", {}); }
|
|
289
289
|
function SidebarGroupAction() { return jsx("div", {}); }
|
|
290
290
|
function SidebarGroupContent() { return jsx("div", {}); }
|
|
291
|
+
function SidebarGroupContent() { return jsx("div", {}); }
|
|
291
292
|
function SidebarMenu() { return jsx("div", {}); }
|
|
292
293
|
function SidebarMenuItem() { return jsx("div", {}); }
|
|
293
294
|
function SidebarMenuButton() { return jsx("div", {}); }
|
|
@@ -326,6 +327,37 @@ const SidebarSeparator = registerClientReference(SSRModule, "/test/file.tsx", "S
|
|
|
326
327
|
const SidebarTrigger = registerClientReference(SSRModule, "/test/file.tsx", "SidebarTrigger");
|
|
327
328
|
const useSidebar = registerClientReference(SSRModule, "/test/file.tsx", "useSidebar");
|
|
328
329
|
export { Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, useSidebar };
|
|
330
|
+
`);
|
|
331
|
+
});
|
|
332
|
+
it("does not transform inlined functions (Issue #471)", async () => {
|
|
333
|
+
const code = `"use client"
|
|
334
|
+
|
|
335
|
+
export function Stars({ level }) {
|
|
336
|
+
const renderStars = (level) => {
|
|
337
|
+
return level;
|
|
338
|
+
}
|
|
339
|
+
return renderStars(level);
|
|
340
|
+
}`;
|
|
341
|
+
expect((await transform(code)) ?? "").toEqual(`import { ssrLoadModule } from "rwsdk/__ssr_bridge";
|
|
342
|
+
import { registerClientReference } from "rwsdk/worker";
|
|
343
|
+
const SSRModule = await ssrLoadModule("/test/file.tsx");
|
|
344
|
+
const Stars = registerClientReference(SSRModule, "/test/file.tsx", "Stars");
|
|
345
|
+
export { Stars };
|
|
346
|
+
`);
|
|
347
|
+
});
|
|
348
|
+
it("does not transform inlined functions in default export (Issue #471)", async () => {
|
|
349
|
+
const code = `"use client"
|
|
350
|
+
|
|
351
|
+
export default function Stars({ level }) {
|
|
352
|
+
const renderStars = (level) => {
|
|
353
|
+
return level;
|
|
354
|
+
}
|
|
355
|
+
return renderStars(level);
|
|
356
|
+
}`;
|
|
357
|
+
expect((await transform(code)) ?? "").toEqual(`import { ssrLoadModule } from "rwsdk/__ssr_bridge";
|
|
358
|
+
import { registerClientReference } from "rwsdk/worker";
|
|
359
|
+
const SSRModule = await ssrLoadModule("/test/file.tsx");
|
|
360
|
+
export default registerClientReference(SSRModule, "/test/file.tsx", "default");
|
|
329
361
|
`);
|
|
330
362
|
});
|
|
331
363
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rwsdk",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.43",
|
|
4
4
|
"description": "Build fast, server-driven webapps on Cloudflare with SSR, RSC, and realtime",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -15,15 +15,19 @@
|
|
|
15
15
|
],
|
|
16
16
|
"scripts": {
|
|
17
17
|
"build": "tsc --build --clean && tsc",
|
|
18
|
+
"build:watch": "npm run build -- --watch",
|
|
18
19
|
"release": "./scripts/release.sh",
|
|
19
20
|
"test": "vitest --run",
|
|
21
|
+
"bench": "vitest bench --run",
|
|
22
|
+
"bench:baseline": "vitest bench --run --outputJson=benchmarks/router-bench-baseline.json",
|
|
23
|
+
"bench:compare": "vitest bench --run --compare=benchmarks/router-bench-baseline.json",
|
|
20
24
|
"debug:sync": "tsx ./src/scripts/debug-sync.mts",
|
|
21
25
|
"smoke-test": "tsx ./src/scripts/smoke-test.mts"
|
|
22
26
|
},
|
|
23
27
|
"exports": {
|
|
24
28
|
"./vite": {
|
|
25
|
-
"
|
|
26
|
-
"
|
|
29
|
+
"types": "./dist/vite/index.d.mts",
|
|
30
|
+
"default": "./dist/vite/index.mjs"
|
|
27
31
|
},
|
|
28
32
|
"./worker": {
|
|
29
33
|
"react-server": "./dist/runtime/entries/worker.js",
|