@solidjs/web 2.0.0-rc.6 → 2.0.0-rc.8

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.
Files changed (82) hide show
  1. package/dist/{server.cjs → server.dev.js} +274 -272
  2. package/dist/server.js +119 -36
  3. package/dist/{dev.js → web.dev.js} +131 -399
  4. package/dist/web.js +78 -388
  5. package/dist/{web.cjs → web.observe.js} +174 -622
  6. package/frames/dist/client.dev.js +11 -3
  7. package/frames/dist/client.js +11 -3
  8. package/frames/dist/{server.cjs → server.dev.js} +375 -125
  9. package/frames/dist/server.js +253 -32
  10. package/frames/package.json +7 -15
  11. package/package.json +88 -251
  12. package/serialization/decode/package.json +3 -9
  13. package/serialization/dist/decode.js +18 -4
  14. package/serialization/dist/serialization.js +18 -4
  15. package/serialization/package.json +3 -9
  16. package/serialization/types/serializer-decode.d.ts +49 -2
  17. package/server-functions/dist/client.js +13 -14
  18. package/server-functions/dist/server.dev.js +359 -85
  19. package/server-functions/dist/server.js +352 -86
  20. package/server-functions/package.json +6 -24
  21. package/server-functions/rich-args/package.json +3 -9
  22. package/storage/package.json +3 -9
  23. package/types/client.d.ts +17 -3
  24. package/types/frames/frame-client.d.ts +1 -1
  25. package/types/frames/serializer-decode.d.ts +49 -2
  26. package/types/head.d.ts +3 -0
  27. package/types/index.d.ts +18 -7
  28. package/types/index.server.d.ts +31 -9
  29. package/types/render.d.ts +3 -1
  30. package/types/serializer-decode.d.ts +49 -2
  31. package/types/server-functions/flash.d.ts +12 -3
  32. package/types/server-functions/server.d.ts +50 -3
  33. package/types/server-mock.d.ts +43 -7
  34. package/types/server.d.ts +48 -6
  35. package/dist/dev.cjs +0 -2590
  36. package/frames/dist/client.cjs +0 -2035
  37. package/frames/dist/client.dev.cjs +0 -2055
  38. package/serialization/dist/decode.cjs +0 -141
  39. package/serialization/dist/serialization.cjs +0 -261
  40. package/serialization/types-cjs/index.d.cts +0 -101
  41. package/serialization/types-cjs/package.json +0 -3
  42. package/serialization/types-cjs/serializer-decode.d.cts +0 -172
  43. package/serialization/types-cjs/serializer.d.cts +0 -101
  44. package/server-functions/dist/client.cjs +0 -1070
  45. package/server-functions/dist/rich-args.cjs +0 -11
  46. package/server-functions/dist/server.cjs +0 -2133
  47. package/server-functions/dist/server.dev.cjs +0 -2153
  48. package/storage/dist/storage.cjs +0 -12
  49. package/storage/types-cjs/index.d.cts +0 -28
  50. package/storage/types-cjs/package.json +0 -3
  51. package/types/patch-driver.d.ts +0 -3
  52. package/types-cjs/client.d.cts +0 -200
  53. package/types-cjs/constants.d.cts +0 -20
  54. package/types-cjs/cookies.d.cts +0 -41
  55. package/types-cjs/frames/client.d.cts +0 -36
  56. package/types-cjs/frames/frame-client.d.cts +0 -370
  57. package/types-cjs/frames/frame-container-plugin.d.cts +0 -71
  58. package/types-cjs/frames/frame-sink.d.cts +0 -92
  59. package/types-cjs/frames/frame-transport.d.cts +0 -189
  60. package/types-cjs/frames/serializer-decode.d.cts +0 -172
  61. package/types-cjs/frames/serializer.d.cts +0 -101
  62. package/types-cjs/frames/server.d.cts +0 -52
  63. package/types-cjs/head.d.cts +0 -16
  64. package/types-cjs/index.d.cts +0 -180
  65. package/types-cjs/index.server.d.cts +0 -125
  66. package/types-cjs/jsx-properties.d.cts +0 -93
  67. package/types-cjs/jsx.d.cts +0 -4146
  68. package/types-cjs/package.json +0 -3
  69. package/types-cjs/patch-driver.d.cts +0 -3
  70. package/types-cjs/reconcile.d.cts +0 -1
  71. package/types-cjs/render.d.cts +0 -4
  72. package/types-cjs/response.d.cts +0 -81
  73. package/types-cjs/serializer-decode.d.cts +0 -172
  74. package/types-cjs/serializer.d.cts +0 -101
  75. package/types-cjs/server-functions/client.d.cts +0 -184
  76. package/types-cjs/server-functions/flash.d.cts +0 -27
  77. package/types-cjs/server-functions/registry.d.cts +0 -100
  78. package/types-cjs/server-functions/rich-args.d.cts +0 -1
  79. package/types-cjs/server-functions/server.d.cts +0 -522
  80. package/types-cjs/server-functions/shared.d.cts +0 -283
  81. package/types-cjs/server-mock.d.cts +0 -301
  82. package/types-cjs/server.d.cts +0 -366
package/types/server.d.ts CHANGED
@@ -5,10 +5,7 @@ export { clearFlashCookie, hasFlashCookie } from "./cookies.js";
5
5
  export { getServerFunctionMetadata, getServerFunctionRPC, isServerFunction } from "./server-functions/registry.js";
6
6
  import { JSX } from "./jsx.js";
7
7
  import { SerializerPlugin } from "./serializer-decode.js";
8
- /** An explicit `<link rel="preload">` emitted by the SSR asset pipeline. */
9
- export type PreloadLink = {
10
- href: string;
11
- as: JSX.HTMLPreloadAs;
8
+ type PreloadLinkAttributes = {
12
9
  type?: string;
13
10
  crossorigin?: JSX.HTMLCrossorigin;
14
11
  integrity?: string;
@@ -16,7 +13,44 @@ export type PreloadLink = {
16
13
  fetchpriority?: JSX.HTMLFetchPriority;
17
14
  media?: string;
18
15
  };
19
- /** Static asset manifest produced by a build (e.g. parsed Vite manifest.json). */
16
+ /**
17
+ * An explicit `<link rel="preload">` emitted by the SSR asset pipeline.
18
+ *
19
+ * `as` is the HTML Standard's set of preload destinations exactly — anything
20
+ * else translates to null and the browser does nothing with the link.
21
+ *
22
+ * `imagesrcset` candidates must already be resolved by the integration: they
23
+ * are carried verbatim (a relative candidate resolves against the DOCUMENT
24
+ * URL, not the manifest base). Pair it with `imagesizes` whenever a candidate
25
+ * uses a width descriptor, which the spec requires — without it the source
26
+ * size falls back to `100vw` and the preload can miss the image the `<img>`
27
+ * selects. Omitting `href` is the spec's own recommendation for the source-set
28
+ * form: it would only serve browsers without `imagesrcset` support, and there
29
+ * it would likely preload the wrong candidate.
30
+ */
31
+ export type PreloadLink = PreloadLinkAttributes & ({
32
+ href: string;
33
+ as: Exclude<JSX.HTMLPreloadAs, "image">;
34
+ imagesrcset?: never;
35
+ imagesizes?: never;
36
+ } | {
37
+ href: string;
38
+ as: "image";
39
+ imagesrcset?: string;
40
+ imagesizes?: string;
41
+ } | {
42
+ href?: never;
43
+ as: "image";
44
+ imagesrcset: string;
45
+ imagesizes?: string;
46
+ });
47
+ /**
48
+ * Static asset graph consumed by the SSR pipeline. This is Solid's own
49
+ * contract — a parsed Vite client manifest satisfies it structurally
50
+ * (unknown fields pass through untyped), but any bundler integration can
51
+ * produce it. Only these fields are ever read: `preloads` is Solid's
52
+ * extension slot for explicit typed links the integration selects.
53
+ */
20
54
  export type AssetManifest = Record<string, {
21
55
  file: string;
22
56
  css?: string[];
@@ -233,6 +267,14 @@ export declare function renderToStream<T>(fn: () => T, options?: {
233
267
  * await renderToStream(...)`). Render errors route through `onError` and
234
268
  * the promise resolves with whatever HTML the render produced; it never
235
269
  * rejects.
270
+ *
271
+ * Completion is this path's head-freeze point: the request event's
272
+ * `response` head (the request scope the render was started in) is
273
+ * committed right before the render's final dispose, so
274
+ * `httpStatus`/`httpHeader` declarations still live at completion survive
275
+ * into `createSSRResponse(html, event)` — which sees the already-committed
276
+ * stub and passes it through. The piped forms freeze at shell flush
277
+ * instead.
236
278
  */
237
279
  then<TResult1 = string, TResult2 = never>(onfulfilled?: ((html: string) => TResult1 | PromiseLike<TResult1>) | null, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null): Promise<TResult1 | TResult2>;
238
280
  pipe: (writable: {
@@ -362,5 +404,5 @@ export declare function composeMiddleware(middlewares: FetchMiddleware[]): (requ
362
404
  export declare function registerElementClaim(handler: (element: Element) => void): () => void;
363
405
  export declare function claimElement<T extends Element>(node: T): T;
364
406
  export declare function claimElementTree<T extends Node>(root: T): T;
365
- export { notSup as style, notSup as insert, notSup as spread, notSup as delegateEvents, notSup as registerDelegatedRoot, notSup as unregisterDelegatedRoot, notSup as registerDelegatedContainer, notSup as unregisterDelegatedContainer, notSup as getDelegatedRoot, notSup as dynamicProperty, notSup as setAttribute, notSup as setAttributeNS, notSup as addEvent, notSup as render, notSup as template, notSup as setProperty, notSup as className, notSup as assign, notSup as hydrate, notSup as getNextElement, notSup as getNextMatch, notSup as getNextMarker, notSup as runHydrationEvents, notSup as ref, notSup as setStyleProperty, notSup as acquireAsset };
407
+ export { notSup as style, notSup as insert, notSup as spread, notSup as delegateEvents, notSup as registerDelegatedRoot, notSup as unregisterDelegatedRoot, notSup as registerDelegatedContainer, notSup as unregisterDelegatedContainer, notSup as getDelegatedRoot, notSup as dynamicProperty, notSup as setAttribute, notSup as setAttributeNS, notSup as addEvent, notSup as render, notSup as template, notSup as setProperty, notSup as className, notSup as assign, notSup as hydrate, notSup as getNextElement, notSup as getNextMatch, notSup as getNextMarker, notSup as runHydrationEvents, notSup as ref, notSup as setStyleProperty, notSup as readShallow, notSup as acquireAsset };
366
408
  declare function notSup(): void;