@solidjs/web 2.0.0-rc.13 → 2.0.0-rc.14

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 (57) hide show
  1. package/dist/server.dev.js +200 -73
  2. package/dist/server.js +182 -59
  3. package/dist/server.observe.js +183 -60
  4. package/dist/web.dev.js +70 -35
  5. package/dist/web.js +43 -31
  6. package/dist/web.observe.js +43 -33
  7. package/frames/dist/assets.js +92 -0
  8. package/frames/dist/bind.dev.js +326 -0
  9. package/frames/dist/bind.js +295 -0
  10. package/frames/dist/client.dev.js +605 -1086
  11. package/frames/dist/client.js +572 -1066
  12. package/frames/dist/client.observe.js +571 -1066
  13. package/frames/dist/regions.js +130 -0
  14. package/frames/dist/server.dev.js +339 -177
  15. package/frames/dist/server.js +335 -173
  16. package/frames/dist/server.observe.js +335 -173
  17. package/frames/dist/trace.js +42 -0
  18. package/frames/dist/wire.js +133 -0
  19. package/package.json +28 -2
  20. package/performance-tracks/dist/performance-tracks.dev.js +2 -1
  21. package/performance-tracks/dist/performance-tracks.observe.js +2 -1
  22. package/performance-tracks/types/index.d.ts +8 -6
  23. package/serialization/dist/decode.js +37 -8
  24. package/serialization/dist/serialization.js +39 -10
  25. package/serialization/types/serializer-decode.d.ts +24 -2
  26. package/server-functions/dist/client.dev.js +99 -61
  27. package/server-functions/dist/client.js +99 -61
  28. package/server-functions/dist/client.observe.js +99 -61
  29. package/server-functions/dist/server.dev.js +87 -50
  30. package/server-functions/dist/server.js +87 -50
  31. package/server-functions/dist/server.observe.js +87 -50
  32. package/skills/server-components/SKILL.md +65 -43
  33. package/types/client.d.ts +20 -0
  34. package/types/constants.d.ts +2 -1
  35. package/types/diagnostics.d.ts +8 -0
  36. package/types/frames/assets-tier.d.ts +78 -0
  37. package/types/frames/bind-tier.d.ts +60 -0
  38. package/types/frames/client.d.ts +37 -3
  39. package/types/frames/frame-client.d.ts +249 -78
  40. package/types/frames/frame-container-plugin.d.ts +2 -2
  41. package/types/frames/frame-sink.d.ts +33 -0
  42. package/types/frames/frame-transport.d.ts +66 -18
  43. package/types/frames/regions-tier.d.ts +45 -0
  44. package/types/frames/serializer-decode.d.ts +24 -2
  45. package/types/frames/server.d.ts +32 -8
  46. package/types/frames/trace-tier.d.ts +2 -0
  47. package/types/frames/wire-tier.d.ts +116 -0
  48. package/types/index.d.ts +38 -0
  49. package/types/index.server.d.ts +9 -0
  50. package/types/jsx.d.ts +1 -1
  51. package/types/observe.d.ts +4 -2
  52. package/types/serializer-decode.d.ts +24 -2
  53. package/types/server-functions/client.d.ts +26 -0
  54. package/types/server-functions/registry.d.ts +4 -1
  55. package/types/server-functions/shared.d.ts +12 -8
  56. package/types/server-mock.d.ts +13 -1
  57. package/types/server.d.ts +34 -8
@@ -5,7 +5,7 @@ import type { ServerErrorSite } from "solid-js";
5
5
  * Where a server-side failure was met, as the server error hook hears it —
6
6
  * the client's view of the server entry's type (see `configureServerErrors`
7
7
  * there). `kind: "render"`: `fallback`/`client`/`failed`; `kind:
8
- * "server-function"`: `thrown`/`channel`.
8
+ * "server-function"`: `thrown`/`channel`; `kind: "request"`: `failed`.
9
9
  */
10
10
  export interface ServerErrorContext extends Omit<ServerErrorSite, "event"> {
11
11
  event?: RequestEvent;
@@ -20,6 +20,12 @@ export interface ServerErrorsConfig {
20
20
  * is a no-op so isomorphic setup code can call it unguarded.
21
21
  */
22
22
  export declare function configureServerErrors(_config: ServerErrorsConfig): void;
23
+ /**
24
+ * Reports a failure that fails a request outside any render (see the
25
+ * server entry's `reportRequestFailure`). Server-only; on the client this is
26
+ * a no-op.
27
+ */
28
+ export declare function reportRequestFailure(_error: unknown, _event: RequestEvent): void;
23
29
  type PreloadLinkAttributes = {
24
30
  type?: string;
25
31
  crossorigin?: JSX.HTMLCrossorigin;
@@ -341,6 +347,12 @@ export declare function ssrStyle(value: string | {
341
347
  * @internal
342
348
  */
343
349
  export declare function ssrStyleProperty(name: string, value: any): string;
350
+ /**
351
+ * Compiler primitive — serializes a style object's `name, value` pairs for
352
+ * SSR output. Not meant for hand-written code.
353
+ * @internal
354
+ */
355
+ export declare function ssrStyleProperties(...entries: any[]): string;
344
356
  /**
345
357
  * Compiler primitive — serializes an attribute for SSR output. Not meant
346
358
  * for hand-written code.
package/types/server.d.ts CHANGED
@@ -230,8 +230,10 @@ export declare function renderToString<T>(fn: () => T, options?: {
230
230
  * This render's server error hook, ahead of `configureServerErrors`'
231
231
  * (see `ServerErrorHook`): every failure the render handles — an
232
232
  * `<Errored>` fallback (`handling: "fallback"`), a hydration value that
233
- * would not serialize (`"serialize"`) — once per error, with where it
234
- * was met. A one-argument listener still works; it hears them all.
233
+ * would not serialize (`"serialize"`) — and the throw that fails it
234
+ * (`"failed"`, heard before it is rethrown to the caller), once per
235
+ * error, with where it was met. A one-argument listener still works; it
236
+ * hears them all.
235
237
  */
236
238
  onError?: ServerErrorHook;
237
239
  /**
@@ -394,6 +396,7 @@ export declare function ssrStyle(value: string | {
394
396
  [k: string]: string;
395
397
  }): string;
396
398
  export declare function ssrStyleProperty(name: string, value: any): string;
399
+ export declare function ssrStyleProperties(...entries: any[]): string;
397
400
  export declare function ssrElement(name: string, props: any | any[] | (() => any | any[]), children: any, needsId: boolean, skip?: (key: string) => boolean, attrs?: string | (() => string), claims?: () => Record<number, Record<string, unknown>>): {
398
401
  t: string;
399
402
  };
@@ -402,7 +405,7 @@ export declare function ssrAttribute(key: string, value: any): string;
402
405
  export declare function ssrHydrationKey(): string;
403
406
  export declare const CLAIMS_STREAM = 1;
404
407
  export declare const CLAIMS_DOCUMENT = 2;
405
- /** The brand on an attribute slot's stand-in for one property read. */
408
+ /** The brand on a binding slot's stand-in for one property read. */
406
409
  export declare const SLOT_VALUE: unique symbol;
407
410
  /** Marker attribute prefix on a consuming element (`_s:class`, `_s:on:click`, `_s:ref`). */
408
411
  export declare const SLOT_MARKER = "_s:";
@@ -412,7 +415,7 @@ export declare const SLOT_FACE_DATA = 1;
412
415
  export declare const SLOT_FACE_MARKUP = 2;
413
416
  export declare function isSlotValue(value: unknown): boolean;
414
417
  /**
415
- * An attribute slot's stand-in for one property read. `face` says what the
418
+ * A binding slot's stand-in for one property read. `face` says what the
416
419
  * occurrence's fill produced where this read happens: nothing (the stream
417
420
  * face never runs fills), a data object (the document face — `value` is
418
421
  * the t=0 value of `key`), or markup (the document face ran the fill and
@@ -430,13 +433,15 @@ export declare function isSlotValue(value: unknown): boolean;
430
433
  */
431
434
  export declare function slotValue(occurrence: string, key: string, value: unknown, face: number): object;
432
435
  /**
433
- * The compiled per-element hole for ref/on* positions on a server
436
+ * The compiled per-element hole for ref/onXxx positions on a server
434
437
  * intrinsic (behind the `serverComponents` compiler option):
435
438
  * `ctx.claims ? ssrClaim({ click: expr, ref: expr2 }) : ""`. The compiler
436
439
  * drops handler and ref expressions from plain SSR output, so this is
437
440
  * where a stand-in at one of those positions is seen. A server-local
438
441
  * function there can never run (the server has no client to run it on);
439
- * dev says so, inside the component barrier only.
442
+ * dev says so, inside the component barrier only. An element with a
443
+ * handler position bound is an EVENT-SLOT consumer and carries the
444
+ * replay-window stamp beside its markers (`eventSlotStamp`).
440
445
  */
441
446
  export declare function ssrClaim(map: Record<string, unknown>): string;
442
447
  export declare function ssrSelectValues(): void;
@@ -454,12 +459,17 @@ export declare const RequestContext: unique symbol; /**
454
459
  *
455
460
  * `kind: "render"` — `fallback`: an `<Errored>` rendered its fallback;
456
461
  * `client`: a `<Loading>` fragment rejected and the client re-renders the
457
- * subtree; `failed`: nothing contained it and the request fails;
462
+ * subtree; `failed`: nothing contained it and the request fails — including
463
+ * a synchronous throw out of `renderToString` or `renderToStream`'s first
464
+ * pass, reported before it reaches the caller;
458
465
  * `serialize`: a hydration value would not serialize and the render went on
459
466
  * without it (a render that passed `onError`). `kind: "server-function"` — `thrown`:
460
467
  * the body threw; `channel`: a rejection or throw escaping through the
461
468
  * result graph (a promise, an iterable, a stream) with the head already
462
- * committed. `boundary` is the hydration id the boundary records and
469
+ * committed. `kind: "request"` (always `failed`): a failure that fails the
470
+ * request outside any render or server function the runtime reports — a
471
+ * middleware throw the framework's request handler catches (see
472
+ * `reportRequestFailure`). `boundary` is the hydration id the boundary records and
463
473
  * findings use; `ownerPath` is where the error was THROWN — the component
464
474
  * labels root-first up the owner chain it escaped, when the compiler emitted
465
475
  * them — and `boundaryPath` where it was MET, the same labels up the
@@ -514,6 +524,20 @@ export interface ServerErrorsConfig {
514
524
  * ```
515
525
  */
516
526
  export declare function configureServerErrors(config: ServerErrorsConfig): void;
527
+ /**
528
+ * Reports a failure that fails a request outside any render or server
529
+ * function the runtime reports, such as a throw a framework's request
530
+ * handler catches from its middleware. The ambient server error hook hears
531
+ * it as `{ kind: "request", handling: "failed", event }`, once per error
532
+ * object, and its return is ignored, as for every `handling: "failed"`. A
533
+ * render failure is the render's: a synchronous throw out of
534
+ * `renderToString` or `renderToStream` was already heard as `kind:
535
+ * "render"` before the caller caught it, so reporting it here adds nothing.
536
+ * With no hook registered the failure goes to `console.error`, as a render
537
+ * that fails before its shell does. There is no per-request hook at this
538
+ * layer.
539
+ */
540
+ export declare function reportRequestFailure(error: unknown, event: RequestEvent): void;
517
541
  /**
518
542
  * The current request event, when called on the server inside a request
519
543
  * scope (established by `provideRequestEvent` from `@solidjs/web/storage`
@@ -606,5 +630,7 @@ export declare function composeMiddleware(middlewares: FetchMiddleware[]): (requ
606
630
  export declare function registerElementClaim(handler: (element: Element) => void): () => void;
607
631
  export declare function claimElement<T extends Element>(node: T): T;
608
632
  export declare function claimElementTree<T extends Node>(root: T): T;
633
+ /** Server: `fn()`. No event is dispatched during SSR, so there is no interaction to join. */
634
+ export declare function dispatchAsInteraction<T>(_e: Event, fn: () => T): T;
609
635
  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 };
610
636
  declare function notSup(): void;