@solidjs/web 2.0.0-rc.0 → 2.0.0-rc.10

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 (108) hide show
  1. package/README.md +1 -1
  2. package/dist/server.dev.js +4472 -0
  3. package/dist/server.js +1363 -224
  4. package/dist/{server.cjs → server.observe.js} +1563 -424
  5. package/dist/{dev.cjs → web.dev.js} +708 -365
  6. package/dist/web.js +460 -144
  7. package/dist/{dev.js → web.observe.js} +511 -213
  8. package/frames/dist/client.dev.js +464 -72
  9. package/frames/dist/client.js +364 -71
  10. package/frames/dist/{client.dev.cjs → client.observe.js} +487 -134
  11. package/frames/dist/server.dev.js +1713 -0
  12. package/frames/dist/server.js +553 -2495
  13. package/frames/dist/server.observe.js +1713 -0
  14. package/frames/package.json +2 -25
  15. package/package.json +214 -254
  16. package/performance-tracks/dist/performance-tracks.dev.js +678 -0
  17. package/performance-tracks/dist/performance-tracks.js +6 -0
  18. package/performance-tracks/dist/performance-tracks.observe.js +666 -0
  19. package/performance-tracks/package.json +7 -0
  20. package/performance-tracks/types/index.d.ts +67 -0
  21. package/serialization/decode/package.json +2 -15
  22. package/serialization/dist/decode.js +101 -12
  23. package/serialization/dist/serialization.js +112 -20
  24. package/serialization/package.json +2 -15
  25. package/serialization/types/index.d.ts +76 -157
  26. package/serialization/types/serializer-decode.d.ts +149 -112
  27. package/serialization/types/serializer.d.ts +101 -0
  28. package/server-functions/dist/client.dev.js +1364 -0
  29. package/server-functions/dist/client.js +745 -85
  30. package/server-functions/dist/client.observe.js +1343 -0
  31. package/server-functions/dist/server.dev.js +2203 -175
  32. package/server-functions/dist/server.js +2111 -176
  33. package/server-functions/dist/server.observe.js +3043 -0
  34. package/server-functions/package.json +2 -35
  35. package/server-functions/rich-args/package.json +2 -15
  36. package/storage/package.json +2 -15
  37. package/types/client.d.ts +193 -288
  38. package/types/constants.d.ts +20 -0
  39. package/types/cookies.d.ts +32 -84
  40. package/types/diagnostics.d.ts +56 -0
  41. package/types/frames/client.d.ts +1 -1
  42. package/types/frames/frame-client.d.ts +323 -259
  43. package/types/frames/frame-container-plugin.d.ts +72 -0
  44. package/types/frames/frame-sink.d.ts +101 -158
  45. package/types/frames/frame-transport.d.ts +192 -190
  46. package/types/frames/serializer-decode.d.ts +219 -0
  47. package/types/frames/serializer.d.ts +76 -157
  48. package/types/frames/server.d.ts +1 -1
  49. package/types/head.d.ts +19 -0
  50. package/types/index.d.ts +62 -76
  51. package/types/index.server.d.ts +174 -0
  52. package/types/jsx.d.ts +33 -26
  53. package/types/observe.d.ts +358 -0
  54. package/types/reconcile.d.ts +1 -0
  55. package/types/render.d.ts +9 -0
  56. package/types/response.d.ts +75 -150
  57. package/types/serializer-decode.d.ts +149 -112
  58. package/types/serializer.d.ts +76 -157
  59. package/types/server-functions/client.d.ts +202 -174
  60. package/types/server-functions/flash.d.ts +28 -30
  61. package/types/server-functions/registry.d.ts +102 -0
  62. package/types/server-functions/rich-args.d.ts +1 -10
  63. package/types/server-functions/server.d.ts +518 -454
  64. package/types/server-functions/shared.d.ts +366 -425
  65. package/types/server-mock.d.ts +110 -13
  66. package/types/server-observe.d.ts +77 -0
  67. package/types/server.d.ts +425 -425
  68. package/types/trace.d.ts +127 -0
  69. package/LICENSE +0 -21
  70. package/dist/web.cjs +0 -2007
  71. package/frames/dist/client.cjs +0 -1916
  72. package/frames/dist/server.cjs +0 -3667
  73. package/serialization/dist/decode.cjs +0 -110
  74. package/serialization/dist/serialization.cjs +0 -232
  75. package/serialization/types-cjs/index.d.cts +0 -182
  76. package/serialization/types-cjs/package.json +0 -3
  77. package/serialization/types-cjs/serializer-decode.d.cts +0 -182
  78. package/server-functions/dist/client.cjs +0 -646
  79. package/server-functions/dist/rich-args.cjs +0 -11
  80. package/server-functions/dist/server.cjs +0 -1077
  81. package/server-functions/dist/server.dev.cjs +0 -1077
  82. package/storage/dist/storage.cjs +0 -12
  83. package/storage/types-cjs/index.d.cts +0 -28
  84. package/storage/types-cjs/package.json +0 -3
  85. package/types/core.d.ts +0 -6
  86. package/types-cjs/client.d.cts +0 -337
  87. package/types-cjs/cookies.d.cts +0 -93
  88. package/types-cjs/core.d.cts +0 -6
  89. package/types-cjs/frames/client.d.cts +0 -36
  90. package/types-cjs/frames/frame-client.d.cts +0 -338
  91. package/types-cjs/frames/frame-sink.d.cts +0 -194
  92. package/types-cjs/frames/frame-transport.d.cts +0 -222
  93. package/types-cjs/frames/serializer.d.cts +0 -182
  94. package/types-cjs/frames/server.d.cts +0 -52
  95. package/types-cjs/index.d.cts +0 -230
  96. package/types-cjs/jsx-properties.d.cts +0 -93
  97. package/types-cjs/jsx.d.cts +0 -4150
  98. package/types-cjs/package.json +0 -3
  99. package/types-cjs/response.d.cts +0 -174
  100. package/types-cjs/serializer-decode.d.cts +0 -182
  101. package/types-cjs/serializer.d.cts +0 -182
  102. package/types-cjs/server-functions/client.d.cts +0 -201
  103. package/types-cjs/server-functions/flash.d.cts +0 -38
  104. package/types-cjs/server-functions/rich-args.d.cts +0 -10
  105. package/types-cjs/server-functions/server.d.cts +0 -588
  106. package/types-cjs/server-functions/shared.d.cts +0 -523
  107. package/types-cjs/server-mock.d.cts +0 -277
  108. package/types-cjs/server.d.cts +0 -523
@@ -1,93 +1,41 @@
1
- // Cookie wire format: the platform-gap primitives, and ALL of core's
2
- // cookie surface — core owns the exchange (the request's headers in, the
3
- // response stub's headers out) and the codec, nothing ambient. Blessed
4
- // patterns:
5
- //
6
- // parseCookieHeader(event.request.headers.get("cookie"))
7
- // event.response.headers.append("set-cookie", serializeCookie(name, value, options))
8
- //
9
- // Dependency-free and isomorphic (exported from both entries — real
10
- // implementation, never a stub); integrity/confidentiality layers
11
- // (sessions) belong to the caller, on top of these primitives.
12
-
13
- /**
14
- * Attributes for a `Set-Cookie` header, mirroring RFC 6265. `path`
15
- * defaults to `/`; nothing else is defaulted.
16
- */
17
1
  export interface CookieOptions {
18
- /** Cookie `Path` attribute. Defaults to `/`. */
19
- path?: string;
20
- /** Cookie `Domain` attribute. Emitted only when provided. */
21
- domain?: string;
22
- /** Cookie `Max-Age` attribute, in seconds (truncated to an integer). */
23
- maxAge?: number;
24
- /** Cookie `Expires` attribute. */
25
- expires?: Date;
26
- /** Emit the `HttpOnly` attribute. */
27
- httpOnly?: boolean;
28
- /** Emit the `Secure` attribute. */
29
- secure?: boolean;
30
- /** Cookie `SameSite` attribute, any case. */
31
- sameSite?: "lax" | "strict" | "none" | "Lax" | "Strict" | "None";
2
+ /** Cookie `Path` attribute. Defaults to `/`. */
3
+ path?: string;
4
+ /** Cookie `Domain` attribute. Emitted only when provided. */
5
+ domain?: string;
6
+ /** Cookie `Max-Age` attribute, in seconds (truncated to an integer). */
7
+ maxAge?: number;
8
+ /** Cookie `Expires` attribute. */
9
+ expires?: Date;
10
+ /** Emit the `HttpOnly` attribute. */
11
+ httpOnly?: boolean;
12
+ /** Emit the `Secure` attribute. */
13
+ secure?: boolean;
14
+ /** Cookie `SameSite` attribute, any case. */
15
+ sameSite?: "lax" | "strict" | "none" | "Lax" | "Strict" | "None";
16
+ /**
17
+ * Emit the `Partitioned` attribute (CHIPS): a third-party cookie keyed to
18
+ * the top-level site it was set under — the only third-party cookie that
19
+ * keeps working as browsers finish removing the rest. Requires `secure`.
20
+ */
21
+ partitioned?: boolean;
32
22
  }
33
-
34
23
  /**
35
24
  * Parses a `Cookie` request header into a name → value map. Names and
36
25
  * values are `decodeURIComponent`-decoded (falling back to the raw text
37
- * when decoding throws); a quoted value keeps its content. `null`/empty
38
- * input parses to an empty map.
26
+ * when decoding throws — cookies set by other producers are not
27
+ * necessarily percent-encoded); a quoted value keeps its content, per the
28
+ * RFC 6265 grammar. `null`/empty input parses to an empty map.
39
29
  *
40
30
  * The read half of the platform gap — the blessed request-cookie read is
41
31
  * `parseCookieHeader(event.request.headers.get("cookie"))`.
42
32
  */
43
- export function parseCookieHeader(header: string | null | undefined): Record<string, string>;
44
-
45
- /**
46
- * Serializes a cookie to a `Set-Cookie` header value. The name and value
47
- * are `encodeURIComponent`-encoded (the parser decodes symmetrically);
48
- * `path` defaults to `/` and every other attribute is emitted exactly
49
- * when the caller asked for it.
50
- *
51
- * The write half of the platform gap — the blessed response-cookie write
52
- * is `event.response.headers.append("set-cookie", serializeCookie(name,
53
- * value, options))`, which every head materialization path carries to the
54
- * wire entry-by-entry.
55
- */
56
- export function serializeCookie(name: string, value: string, options?: CookieOptions): string;
57
-
58
- /**
59
- * Name of the cookie carrying the outcome of a server function call made
60
- * without the client runtime (`"flash"`). A no-JS form post has no way to
61
- * receive a value — the browser follows the redirect and renders the next
62
- * page — so the handler stashes the outcome here for the render after it
63
- * to pick up, which is how a form submitted without JavaScript still shows
64
- * its result.
65
- *
66
- * The name, detection and clearing are cookie utilities and isomorphic
67
- * (integrations read the cookie from code that also ships to the browser);
68
- * the codec that fills and decodes it is server-only and lives behind the
69
- * server-functions server entry.
70
- */
71
- export const FLASH_COOKIE: string;
72
-
73
- /**
74
- * Whether a Cookie header carries a flash cookie, readable or not. Cheap
75
- * enough to call on every render so the clear can be queued before the
76
- * response headers flush.
77
- */
78
- export function hasFlashCookie(cookieHeader: string | null): boolean;
79
-
80
- /**
81
- * The `Set-Cookie` value clearing the flash cookie. The outcome is
82
- * one-shot: append this as soon as the cookie is detected, whether or not
83
- * it decodes, so a stale outcome cannot resurface on a later request.
84
- */
85
- export function clearFlashCookie(): string;
86
-
87
- /**
88
- * The raw encoded flash payload out of a Cookie header, if present — the
89
- * codec's own accessor.
90
- *
91
- * @internal
92
- */
93
- export function matchFlashCookie(cookieHeader: string | null): string | undefined;
33
+ export declare function parseCookieHeader(header: string | null | undefined): Record<string, string>;
34
+ export declare function serializeCookie(name: string, value: string, options?: CookieOptions): string;
35
+ export declare const FLASH_COOKIE = "flash";
36
+ /** Whether a Cookie header carries a flash cookie (readable or not). */
37
+ export declare function hasFlashCookie(cookieHeader: string | null): boolean;
38
+ /** The raw encoded flash payload out of a Cookie header, if present. */
39
+ export declare function matchFlashCookie(cookieHeader: string | null): string | undefined;
40
+ /** The Set-Cookie value clearing the flash cookie after it has been read. */
41
+ export declare function clearFlashCookie(): string;
@@ -0,0 +1,56 @@
1
+ import { type DiagnosticEvent } from "solid-js";
2
+ export type Finding = Omit<DiagnosticEvent, "sequence">;
3
+ /**
4
+ * Records a finding — observe and dev tiers — and, in dev, reports it on the
5
+ * console. `subject` locates it (the current server owner by default; its
6
+ * component labels give the `ownerPath`); pass `null` for a finding with no
7
+ * location by nature (a stream event). No-op in prod.
8
+ */
9
+ export declare function emitFinding(finding: Finding, subject?: unknown): void;
10
+ /**
11
+ * The structured record alone, for a site that THROWS its message: the
12
+ * thrown error is the console face and the core lands the once-per-code
13
+ * footer beneath it. Reporting as well would print the finding twice.
14
+ */
15
+ export declare function recordFinding(finding: Finding, subject?: unknown): void;
16
+ /**
17
+ * A dev CHECK: `emitFinding` behind the dev gate, so the site reads as one
18
+ * call and the observe and prod artifacts carry none of it. Extra console
19
+ * arguments (the offending descriptor, the caught error) go on `data` — the
20
+ * structured record keeps them, the console face prints the message.
21
+ */
22
+ export declare function devCheck(finding: Finding, subject?: unknown): void;
23
+ /**
24
+ * Dev CHECK, one code on both platforms: a hole the compiler left unscoped
25
+ * (a bare identifier — `{renderHead}` — is the one shape that can be a
26
+ * function at runtime without the compiler seeing an expression to scope)
27
+ * evaluated to a function that built hydratable content, and that content
28
+ * took its ids from the ENCLOSING owner's counter. A scoped hole reserves
29
+ * its slot at registration and nests its content under it, so it moves the
30
+ * counter by exactly one, at the same point on both sides; an unscoped one
31
+ * moves it by however much it built, when it ran — statement order on the
32
+ * client, walk order on the server — and every id after it permutes. The
33
+ * shape is unreachable from type-checked code (`JSX.Element` excludes
34
+ * functions) and is not scoped in production; this check is its cost.
35
+ *
36
+ * Unscoped allocation alone is not the finding — a function hole that runs
37
+ * at the same counter position on both sides (nothing scoped after it in
38
+ * its template; a boundary's zero-arity fallback thunk at the end of an
39
+ * element) hydrates fine. Each side reports the permutation it can see:
40
+ * the server knows the position the hole was REGISTERED at (`registered`,
41
+ * where the client builds it in statement order) and the one it EVALUATED
42
+ * it at (`before`, walk order, after the scoped holes that follow it
43
+ * reserved theirs) and reports when they differ; the client, which always
44
+ * builds in place, reports when the content it built inside the hole
45
+ * missed its server-rendered keys. `before`/`after` are the counter's next
46
+ * id around the evaluation; `site` names the hole (`data.name` the
47
+ * function, `data.hole` the position). Callers dedupe per site so a row
48
+ * template reports once.
49
+ */
50
+ export declare function unscopedHoleAllocatedIds(before: string, after: string, site: {
51
+ name?: string;
52
+ hole?: number;
53
+ registered?: string;
54
+ }, subject?: unknown): void;
55
+ /** `Name: message` for an Error, `String(value)` otherwise. */
56
+ export declare function errorText(error: unknown): string;
@@ -1,5 +1,5 @@
1
1
  export { createFrame, createFrameHost, createFrameElement, FRAME_APPLIED_EVENT } from "./frame-client.js";
2
- export { FRAME_STREAM_HEADER, applyFrameResponse, isFrameStreamResponse, createServerComponentHandler } from "./frame-transport.js";
2
+ export { FRAME_STREAM_HEADER, FRAME_HAVE_HEADER, FRAME_HAVE_BUDGET, applyFrameResponse, isFrameStreamResponse, createServerComponentHandler } from "./frame-transport.js";
3
3
  export type { Slot } from "./server.js";
4
4
  /**
5
5
  * Client-condition twin of the server face's `asyncArg` (DR-2 value tier):