@quilted/quilt 0.6.13 → 0.6.15

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 (58) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/build/esm/assets.mjs +0 -1
  3. package/build/esm/async.mjs +2 -2
  4. package/build/esm/browser.mjs +2 -0
  5. package/build/esm/globals.mjs +3 -3
  6. package/build/esm/navigate.mjs +1 -1
  7. package/build/esm/server/ServerContext.mjs +10 -22
  8. package/build/esm/server/request-router.mjs +53 -95
  9. package/build/esm/server.mjs +1 -5
  10. package/build/esm/signals.mjs +1 -2
  11. package/build/esnext/assets.esnext +0 -1
  12. package/build/esnext/async.esnext +2 -2
  13. package/build/esnext/browser.esnext +2 -0
  14. package/build/esnext/globals.esnext +3 -3
  15. package/build/esnext/navigate.esnext +1 -1
  16. package/build/esnext/server/ServerContext.esnext +8 -17
  17. package/build/esnext/server/request-router.esnext +59 -86
  18. package/build/esnext/server.esnext +1 -5
  19. package/build/esnext/signals.esnext +1 -2
  20. package/build/tsconfig.tsbuildinfo +1 -1
  21. package/build/typescript/assets.d.ts +0 -1
  22. package/build/typescript/assets.d.ts.map +1 -1
  23. package/build/typescript/async.d.ts +2 -4
  24. package/build/typescript/async.d.ts.map +1 -1
  25. package/build/typescript/browser.d.ts +3 -0
  26. package/build/typescript/browser.d.ts.map +1 -0
  27. package/build/typescript/globals.d.ts +2 -2
  28. package/build/typescript/globals.d.ts.map +1 -1
  29. package/build/typescript/navigate.d.ts +1 -1
  30. package/build/typescript/server/ServerContext.d.ts +3 -8
  31. package/build/typescript/server/ServerContext.d.ts.map +1 -1
  32. package/build/typescript/server/request-router.d.ts +9 -8
  33. package/build/typescript/server/request-router.d.ts.map +1 -1
  34. package/build/typescript/server.d.ts +1 -7
  35. package/build/typescript/server.d.ts.map +1 -1
  36. package/build/typescript/signals.d.ts +1 -2
  37. package/build/typescript/signals.d.ts.map +1 -1
  38. package/package.json +27 -32
  39. package/source/assets.ts +0 -1
  40. package/source/async.ts +13 -12
  41. package/source/browser.ts +5 -0
  42. package/source/globals.ts +4 -7
  43. package/source/navigate.ts +1 -1
  44. package/source/server/ServerContext.tsx +17 -38
  45. package/source/server/request-router.tsx +81 -110
  46. package/source/server.ts +1 -33
  47. package/source/signals.ts +1 -12
  48. package/tsconfig.json +1 -4
  49. package/build/esm/html/HTML.mjs +0 -19
  50. package/build/esm/html.mjs +0 -3
  51. package/build/esm/http.mjs +0 -1
  52. package/build/esnext/html/HTML.esnext +0 -16
  53. package/build/esnext/html.esnext +0 -3
  54. package/build/esnext/http.esnext +0 -1
  55. package/source/html/HTML.tsx +0 -22
  56. package/source/html.ts +0 -40
  57. package/source/http.ts +0 -37
  58. package/source/routing.ts +0 -24
@@ -2,7 +2,6 @@ import './assets/files.ts';
2
2
  import './assets/styles.ts';
3
3
  export { styleAssetAttributes, styleAssetPreloadAttributes, scriptAssetAttributes, scriptAssetPreloadAttributes, BrowserAssetsFromManifests, createBrowserAssetsEntryFromManifest, } from '@quilted/assets';
4
4
  export type { Asset, AssetsCacheKey, BrowserAssets, BrowserAssetsEntry, BrowserAssetSelector, BrowserAssetModuleSelector, AssetsBuildManifest, AssetsBuildManifestEntry, } from '@quilted/assets';
5
- export { useAssetsCacheKey, useModuleAssets } from '@quilted/react-assets';
6
5
  declare module '@quilted/assets' {
7
6
  interface AssetsCacheKey {
8
7
  browserGroup?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"assets.d.ts","sourceRoot":"","sources":["../../source/assets.ts"],"names":[],"mappings":"AAAA,OAAO,mBAAmB,CAAC;AAC3B,OAAO,oBAAoB,CAAC;AAE5B,OAAO,EACL,oBAAoB,EACpB,2BAA2B,EAC3B,qBAAqB,EACrB,4BAA4B,EAC5B,0BAA0B,EAC1B,oCAAoC,GACrC,MAAM,iBAAiB,CAAC;AACzB,YAAY,EACV,KAAK,EACL,cAAc,EACd,aAAa,EACb,kBAAkB,EAClB,oBAAoB,EACpB,0BAA0B,EAC1B,mBAAmB,EACnB,wBAAwB,GACzB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAC,iBAAiB,EAAE,eAAe,EAAC,MAAM,uBAAuB,CAAC;AAEzE,OAAO,QAAQ,iBAAiB,CAAC;IAC/B,UAAU,cAAc;QACtB,YAAY,CAAC,EAAE,MAAM,CAAC;KACvB;CACF"}
1
+ {"version":3,"file":"assets.d.ts","sourceRoot":"","sources":["../../source/assets.ts"],"names":[],"mappings":"AAAA,OAAO,mBAAmB,CAAC;AAC3B,OAAO,oBAAoB,CAAC;AAE5B,OAAO,EACL,oBAAoB,EACpB,2BAA2B,EAC3B,qBAAqB,EACrB,4BAA4B,EAC5B,0BAA0B,EAC1B,oCAAoC,GACrC,MAAM,iBAAiB,CAAC;AACzB,YAAY,EACV,KAAK,EACL,cAAc,EACd,aAAa,EACb,kBAAkB,EAClB,oBAAoB,EACpB,0BAA0B,EAC1B,mBAAmB,EACnB,wBAAwB,GACzB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,QAAQ,iBAAiB,CAAC;IAC/B,UAAU,cAAc;QACtB,YAAY,CAAC,EAAE,MAAM,CAAC;KACvB;CACF"}
@@ -1,6 +1,4 @@
1
- export { createAsyncModule } from '@quilted/async';
2
- export type { AsyncModule } from '@quilted/async';
3
- export { useAsyncModule, useAsyncModulePreload, usePreload, createAsyncComponent, } from '@quilted/react-async';
4
- export type { NoOptions, AssetLoadTiming, HydrationTiming, RenderTiming, AsyncComponentType, Preloadable, } from '@quilted/react-async';
1
+ export { AsyncAction, AsyncActionPromise, AsyncActionDeferred, AsyncModule, type AsyncModuleLoader, type AsyncModuleLoaderFunction, type AsyncModuleLoaderObject, } from '@quilted/async';
2
+ export { AsyncComponent, AsyncContext, useAsyncModule, useAsyncModuleAssets, useAsyncModulePreload, useHydrated, } from '@quilted/react-async';
5
3
  export { useIdleCallback } from '@quilted/react-idle';
6
4
  //# sourceMappingURL=async.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"async.d.ts","sourceRoot":"","sources":["../../source/async.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,iBAAiB,EAAC,MAAM,gBAAgB,CAAC;AACjD,YAAY,EAAC,WAAW,EAAC,MAAM,gBAAgB,CAAC;AAChD,OAAO,EACL,cAAc,EACd,qBAAqB,EACrB,UAAU,EACV,oBAAoB,GACrB,MAAM,sBAAsB,CAAC;AAC9B,YAAY,EACV,SAAS,EACT,eAAe,EACf,eAAe,EACf,YAAY,EACZ,kBAAkB,EAClB,WAAW,GACZ,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAC,eAAe,EAAC,MAAM,qBAAqB,CAAC"}
1
+ {"version":3,"file":"async.d.ts","sourceRoot":"","sources":["../../source/async.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,kBAAkB,EAClB,mBAAmB,EACnB,WAAW,EACX,KAAK,iBAAiB,EACtB,KAAK,yBAAyB,EAC9B,KAAK,uBAAuB,GAC7B,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,cAAc,EACd,YAAY,EACZ,cAAc,EACd,oBAAoB,EACpB,qBAAqB,EACrB,WAAW,GACZ,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAC,eAAe,EAAC,MAAM,qBAAqB,CAAC"}
@@ -0,0 +1,3 @@
1
+ import './signals.ts';
2
+ export * from '@quilted/react-browser';
3
+ //# sourceMappingURL=browser.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"browser.d.ts","sourceRoot":"","sources":["../../source/browser.ts"],"names":[],"mappings":"AAEA,OAAO,cAAc,CAAC;AAEtB,cAAc,wBAAwB,CAAC"}
@@ -1,9 +1,9 @@
1
1
  import './modules.ts';
2
2
  import './assets/files.ts';
3
3
  import './assets/styles.ts';
4
- import { type AsyncModulesGlobal } from '@quilted/async';
4
+ import { AsyncModulesGlobal } from '@quilted/async';
5
5
  export interface QuiltGlobal {
6
- readonly AsyncModules: AsyncModulesGlobal;
6
+ readonly asyncModules: AsyncModulesGlobal;
7
7
  }
8
8
  declare const quilt: QuiltGlobal;
9
9
  export default quilt;
@@ -1 +1 @@
1
- {"version":3,"file":"globals.d.ts","sourceRoot":"","sources":["../../source/globals.ts"],"names":[],"mappings":"AAAA,OAAO,cAAc,CAAC;AACtB,OAAO,mBAAmB,CAAC;AAC3B,OAAO,oBAAoB,CAAC;AAE5B,OAAO,EAEL,KAAK,kBAAkB,EACxB,MAAM,gBAAgB,CAAC;AAExB,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,YAAY,EAAE,kBAAkB,CAAC;CAC3C;AAGD,QAAA,MAAM,KAAK,aAAuD,CAAC;AAanE,eAAe,KAAK,CAAC;AACrB,OAAO,EAAC,KAAK,EAAE,KAAK,IAAI,MAAM,EAAC,CAAC"}
1
+ {"version":3,"file":"globals.d.ts","sourceRoot":"","sources":["../../source/globals.ts"],"names":[],"mappings":"AAAA,OAAO,cAAc,CAAC;AACtB,OAAO,mBAAmB,CAAC;AAC3B,OAAO,oBAAoB,CAAC;AAE5B,OAAO,EAAC,kBAAkB,EAAC,MAAM,gBAAgB,CAAC;AAElD,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,YAAY,EAAE,kBAAkB,CAAC;CAC3C;AAGD,QAAA,MAAM,KAAK,aAAuD,CAAC;AAanE,eAAe,KAAK,CAAC;AACrB,OAAO,EAAC,KAAK,EAAE,KAAK,IAAI,MAAM,EAAC,CAAC"}
@@ -1,3 +1,3 @@
1
- export { Link, Redirect, Routing, RoutePreloading, NavigationBlock, useCurrentUrl, useInitialUrl, useRouter, useRoutes, useRouteMatch, useRouteMatchDetails, useNavigate, useRedirect, useNavigationBlock, useScrollRestoration, useRouteChangeFocusRef, } from '@quilted/react-router';
1
+ export { Link, Redirect, Routing, RoutePreloading, NavigationBlock, useCurrentUrl, useInitialURL, useRouter, useRoutes, useRouteMatch, useRouteMatchDetails, useNavigate, useRedirect, useNavigationBlock, useScrollRestoration, useRouteChangeFocusRef, } from '@quilted/react-router';
2
2
  export type { Router, NavigateTo, Routes, RouteDefinition, } from '@quilted/react-router';
3
3
  //# sourceMappingURL=navigate.d.ts.map
@@ -1,13 +1,8 @@
1
1
  import type { PropsWithChildren } from 'react';
2
- import { type AssetsManager } from '@quilted/react-assets/server';
3
- import { type HTMLManager } from '@quilted/react-html/server';
4
- import { type HttpManager } from '@quilted/react-http/server';
2
+ import { type BrowserDetails } from '@quilted/react-browser/server';
5
3
  interface Props {
6
- url?: string | URL;
7
- html?: HTMLManager;
8
- http?: HttpManager;
9
- assets?: AssetsManager;
4
+ browser?: BrowserDetails;
10
5
  }
11
- export declare function ServerContext({ url, html, http, assets, children, }: PropsWithChildren<Props>): string | number | boolean | Iterable<import("react").ReactNode> | import("react").JSX.Element | null | undefined;
6
+ export declare function ServerContext({ browser, children }: PropsWithChildren<Props>): string | number | boolean | Iterable<import("react").ReactNode> | import("react").JSX.Element | null | undefined;
12
7
  export {};
13
8
  //# sourceMappingURL=ServerContext.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ServerContext.d.ts","sourceRoot":"","sources":["../../../source/server/ServerContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,OAAO,CAAC;AAE7C,OAAO,EAAgB,KAAK,aAAa,EAAC,MAAM,8BAA8B,CAAC;AAE/E,OAAO,EAAc,KAAK,WAAW,EAAC,MAAM,4BAA4B,CAAC;AACzE,OAAO,EAAoB,KAAK,WAAW,EAAC,MAAM,4BAA4B,CAAC;AAE/E,UAAU,KAAK;IACb,GAAG,CAAC,EAAE,MAAM,GAAG,GAAG,CAAC;IACnB,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB,MAAM,CAAC,EAAE,aAAa,CAAC;CACxB;AAED,wBAAgB,aAAa,CAAC,EAC5B,GAAG,EACH,IAAI,EACJ,IAAI,EACJ,MAAM,EACN,QAAQ,GACT,EAAE,iBAAiB,CAAC,KAAK,CAAC,oHAkC1B"}
1
+ {"version":3,"file":"ServerContext.d.ts","sourceRoot":"","sources":["../../../source/server/ServerContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,OAAO,CAAC;AAG7C,OAAO,EAEL,KAAK,cAAc,EACpB,MAAM,+BAA+B,CAAC;AAEvC,UAAU,KAAK;IACb,OAAO,CAAC,EAAE,cAAc,CAAC;CAC1B;AAED,wBAAgB,aAAa,CAAC,EAAC,OAAO,EAAE,QAAQ,EAAC,EAAE,iBAAiB,CAAC,KAAK,CAAC,oHAqB1E"}
@@ -1,24 +1,25 @@
1
1
  import { type ReactElement } from 'react';
2
2
  import { type AssetsCacheKey, type BrowserAssets, type BrowserAssetsEntry } from '@quilted/assets';
3
- import { HTMLManager } from '@quilted/react-html/server';
3
+ import { BrowserResponse } from '@quilted/react-browser/server';
4
4
  import { HTMLResponse, RedirectResponse } from '@quilted/request-router';
5
5
  export interface RenderHTMLFunction {
6
6
  (content: ReadableStream<string>, context: {
7
- readonly manager: HTMLManager;
8
- readonly headers: Headers;
7
+ readonly response: BrowserResponse;
9
8
  readonly assets?: BrowserAssetsEntry;
10
9
  readonly preloadAssets?: BrowserAssetsEntry;
11
10
  }): ReadableStream<any> | string | Promise<ReadableStream<any> | string>;
12
11
  }
13
- export interface RenderOptions<CacheKey = AssetsCacheKey> {
12
+ export interface RenderOptions {
14
13
  readonly request: Request;
14
+ readonly status?: number;
15
15
  readonly stream?: 'headers' | false;
16
16
  readonly headers?: HeadersInit;
17
- readonly assets?: BrowserAssets<CacheKey>;
18
- readonly cacheKey?: CacheKey;
17
+ readonly assets?: BrowserAssets;
18
+ readonly cacheKey?: Partial<AssetsCacheKey>;
19
+ readonly serializations?: Iterable<[string, unknown]>;
19
20
  readonly renderHTML?: boolean | 'fragment' | 'document' | RenderHTMLFunction;
20
21
  waitUntil?(promise: Promise<any>): void;
21
22
  }
22
- export declare function renderToResponse<CacheKey = AssetsCacheKey>(element: ReactElement<any>, options: RenderOptions<CacheKey>): Promise<HTMLResponse | RedirectResponse>;
23
- export declare function renderToResponse<CacheKey = AssetsCacheKey>(options: RenderOptions<CacheKey>): Promise<HTMLResponse | RedirectResponse>;
23
+ export declare function renderToResponse(element: ReactElement<any>, options: RenderOptions): Promise<HTMLResponse | RedirectResponse>;
24
+ export declare function renderToResponse(options: RenderOptions): Promise<HTMLResponse | RedirectResponse>;
24
25
  //# sourceMappingURL=request-router.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"request-router.d.ts","sourceRoot":"","sources":["../../../source/server/request-router.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAiB,KAAK,YAAY,EAAC,MAAM,OAAO,CAAC;AAGxD,OAAO,EAGL,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,kBAAkB,EACxB,MAAM,iBAAiB,CAAC;AAGzB,OAAO,EAML,WAAW,EACZ,MAAM,4BAA4B,CAAC;AAGpC,OAAO,EAAC,YAAY,EAAE,gBAAgB,EAAC,MAAM,yBAAyB,CAAC;AAIvE,MAAM,WAAW,kBAAkB;IACjC,CACE,OAAO,EAAE,cAAc,CAAC,MAAM,CAAC,EAC/B,OAAO,EAAE;QACP,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAC;QAC9B,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;QAC1B,QAAQ,CAAC,MAAM,CAAC,EAAE,kBAAkB,CAAC;QACrC,QAAQ,CAAC,aAAa,CAAC,EAAE,kBAAkB,CAAC;KAC7C,GACA,cAAc,CAAC,GAAG,CAAC,GAAG,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,CAAC;CACzE;AAED,MAAM,WAAW,aAAa,CAAC,QAAQ,GAAG,cAAc;IACtD,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,MAAM,CAAC,EAAE,SAAS,GAAG,KAAK,CAAC;IACpC,QAAQ,CAAC,OAAO,CAAC,EAAE,WAAW,CAAC;IAC/B,QAAQ,CAAC,MAAM,CAAC,EAAE,aAAa,CAAC,QAAQ,CAAC,CAAC;IAC1C,QAAQ,CAAC,QAAQ,CAAC,EAAE,QAAQ,CAAC;IAC7B,QAAQ,CAAC,UAAU,CAAC,EAAE,OAAO,GAAG,UAAU,GAAG,UAAU,GAAG,kBAAkB,CAAC;IAC7E,SAAS,CAAC,CAAC,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC;CACzC;AAED,wBAAsB,gBAAgB,CAAC,QAAQ,GAAG,cAAc,EAC9D,OAAO,EAAE,YAAY,CAAC,GAAG,CAAC,EAC1B,OAAO,EAAE,aAAa,CAAC,QAAQ,CAAC,GAC/B,OAAO,CAAC,YAAY,GAAG,gBAAgB,CAAC,CAAC;AAC5C,wBAAsB,gBAAgB,CAAC,QAAQ,GAAG,cAAc,EAC9D,OAAO,EAAE,aAAa,CAAC,QAAQ,CAAC,GAC/B,OAAO,CAAC,YAAY,GAAG,gBAAgB,CAAC,CAAC"}
1
+ {"version":3,"file":"request-router.d.ts","sourceRoot":"","sources":["../../../source/server/request-router.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAiB,KAAK,YAAY,EAAC,MAAM,OAAO,CAAC;AAMxD,OAAO,EAGL,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,kBAAkB,EACxB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,eAAe,EAKhB,MAAM,+BAA+B,CAAC;AAEvC,OAAO,EAAC,YAAY,EAAE,gBAAgB,EAAC,MAAM,yBAAyB,CAAC;AAIvE,MAAM,WAAW,kBAAkB;IACjC,CACE,OAAO,EAAE,cAAc,CAAC,MAAM,CAAC,EAC/B,OAAO,EAAE;QACP,QAAQ,CAAC,QAAQ,EAAE,eAAe,CAAC;QACnC,QAAQ,CAAC,MAAM,CAAC,EAAE,kBAAkB,CAAC;QACrC,QAAQ,CAAC,aAAa,CAAC,EAAE,kBAAkB,CAAC;KAC7C,GACA,cAAc,CAAC,GAAG,CAAC,GAAG,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,CAAC;CACzE;AAED,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,MAAM,CAAC,EAAE,SAAS,GAAG,KAAK,CAAC;IACpC,QAAQ,CAAC,OAAO,CAAC,EAAE,WAAW,CAAC;IAC/B,QAAQ,CAAC,MAAM,CAAC,EAAE,aAAa,CAAC;IAChC,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC,cAAc,CAAC,CAAC;IAC5C,QAAQ,CAAC,cAAc,CAAC,EAAE,QAAQ,CAAC,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IACtD,QAAQ,CAAC,UAAU,CAAC,EAAE,OAAO,GAAG,UAAU,GAAG,UAAU,GAAG,kBAAkB,CAAC;IAC7E,SAAS,CAAC,CAAC,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC;CACzC;AAED,wBAAsB,gBAAgB,CACpC,OAAO,EAAE,YAAY,CAAC,GAAG,CAAC,EAC1B,OAAO,EAAE,aAAa,GACrB,OAAO,CAAC,YAAY,GAAG,gBAAgB,CAAC,CAAC;AAC5C,wBAAsB,gBAAgB,CACpC,OAAO,EAAE,aAAa,GACrB,OAAO,CAAC,YAAY,GAAG,gBAAgB,CAAC,CAAC"}
@@ -1,13 +1,7 @@
1
- export { Head, Serialize, HTMLManager, HTMLContext, SERVER_ACTION_ID as HTML_SERVER_ACTION_ID, } from '@quilted/react-html/server';
2
- export { extract, ServerRenderManager, ServerRenderManagerContext, } from '@quilted/react-server-render/server';
1
+ export * from '@quilted/react-browser/server';
3
2
  export { styleAssetAttributes, styleAssetPreloadAttributes, scriptAssetAttributes, scriptAssetPreloadAttributes, BrowserAssetsFromManifests, createBrowserAssetsEntryFromManifest, } from '@quilted/assets';
4
3
  export type { Asset, AssetsCacheKey, BrowserAssets, BrowserAssetsEntry, BrowserAssetSelector, BrowserAssetModuleSelector, AssetsBuildManifest, AssetsBuildManifestEntry, } from '@quilted/assets';
5
- export { useAssetsCacheKey, useModuleAssets, AssetsContext, AssetsManager, SERVER_ACTION_ID as ASSETS_SERVER_ACTION_ID, } from '@quilted/react-assets/server';
6
- export type { HttpState } from '@quilted/react-http/server';
7
4
  export { parseAcceptLanguageHeader } from '@quilted/react-localize';
8
5
  export { createRequestRouterLocalization } from '@quilted/react-localize/request-router';
9
- export { ServerAction, useServerAction, useServerContext, } from '@quilted/react-server-render';
10
- export type { ServerActionKind, ServerActionOptions, ServerActionPerform, ServerRenderPass, ServerRenderRequestContext, } from '@quilted/react-server-render';
11
- export { ServerContext } from './server/ServerContext.tsx';
12
6
  export { renderToResponse } from './server/request-router.tsx';
13
7
  //# sourceMappingURL=server.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../source/server.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,IAAI,EACJ,SAAS,EACT,WAAW,EACX,WAAW,EACX,gBAAgB,IAAI,qBAAqB,GAC1C,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,OAAO,EACP,mBAAmB,EACnB,0BAA0B,GAC3B,MAAM,qCAAqC,CAAC;AAE7C,OAAO,EACL,oBAAoB,EACpB,2BAA2B,EAC3B,qBAAqB,EACrB,4BAA4B,EAC5B,0BAA0B,EAC1B,oCAAoC,GACrC,MAAM,iBAAiB,CAAC;AACzB,YAAY,EACV,KAAK,EACL,cAAc,EACd,aAAa,EACb,kBAAkB,EAClB,oBAAoB,EACpB,0BAA0B,EAC1B,mBAAmB,EACnB,wBAAwB,GACzB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,iBAAiB,EACjB,eAAe,EACf,aAAa,EACb,aAAa,EACb,gBAAgB,IAAI,uBAAuB,GAC5C,MAAM,8BAA8B,CAAC;AACtC,YAAY,EAAC,SAAS,EAAC,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAC,yBAAyB,EAAC,MAAM,yBAAyB,CAAC;AAClE,OAAO,EAAC,+BAA+B,EAAC,MAAM,wCAAwC,CAAC;AACvF,OAAO,EACL,YAAY,EACZ,eAAe,EACf,gBAAgB,GACjB,MAAM,8BAA8B,CAAC;AACtC,YAAY,EACV,gBAAgB,EAChB,mBAAmB,EACnB,mBAAmB,EACnB,gBAAgB,EAChB,0BAA0B,GAC3B,MAAM,8BAA8B,CAAC;AAEtC,OAAO,EAAC,aAAa,EAAC,MAAM,4BAA4B,CAAC;AACzD,OAAO,EAAC,gBAAgB,EAAC,MAAM,6BAA6B,CAAC"}
1
+ {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../source/server.ts"],"names":[],"mappings":"AAAA,cAAc,+BAA+B,CAAC;AAE9C,OAAO,EACL,oBAAoB,EACpB,2BAA2B,EAC3B,qBAAqB,EACrB,4BAA4B,EAC5B,0BAA0B,EAC1B,oCAAoC,GACrC,MAAM,iBAAiB,CAAC;AACzB,YAAY,EACV,KAAK,EACL,cAAc,EACd,aAAa,EACb,kBAAkB,EAClB,oBAAoB,EACpB,0BAA0B,EAC1B,mBAAmB,EACnB,wBAAwB,GACzB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAC,yBAAyB,EAAC,MAAM,yBAAyB,CAAC;AAClE,OAAO,EAAC,+BAA+B,EAAC,MAAM,wCAAwC,CAAC;AAEvF,OAAO,EAAC,gBAAgB,EAAC,MAAM,6BAA6B,CAAC"}
@@ -1,3 +1,2 @@
1
- export { signal, Signal, batch, computed, effect, isSignal, resolveSignalOrValue, signalToIterator, type SignalOrValue, } from '@quilted/signals';
2
- export { useSignal, useComputed, useSignalEffect } from '@quilted/react-signals';
1
+ export * from '@quilted/react-signals';
3
2
  //# sourceMappingURL=signals.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"signals.d.ts","sourceRoot":"","sources":["../../source/signals.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,MAAM,EACN,MAAM,EACN,KAAK,EACL,QAAQ,EACR,MAAM,EACN,QAAQ,EACR,oBAAoB,EACpB,gBAAgB,EAChB,KAAK,aAAa,GACnB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAC,SAAS,EAAE,WAAW,EAAE,eAAe,EAAC,MAAM,wBAAwB,CAAC"}
1
+ {"version":3,"file":"signals.d.ts","sourceRoot":"","sources":["../../source/signals.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@quilted/quilt",
3
3
  "type": "module",
4
- "version": "0.6.13",
4
+ "version": "0.6.15",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/lemonmade/quilt.git",
@@ -31,24 +31,18 @@
31
31
  "quilt:esnext": "./build/esnext/async.esnext",
32
32
  "import": "./build/esm/async.mjs"
33
33
  },
34
+ "./browser": {
35
+ "types": "./build/typescript/browser.d.ts",
36
+ "quilt:source": "./source/browser.ts",
37
+ "quilt:esnext": "./build/esnext/browser.esnext",
38
+ "import": "./build/esm/browser.mjs"
39
+ },
34
40
  "./globals": {
35
41
  "types": "./build/typescript/globals.d.ts",
36
42
  "quilt:source": "./source/globals.ts",
37
43
  "quilt:esnext": "./build/esnext/globals.esnext",
38
44
  "import": "./build/esm/globals.mjs"
39
45
  },
40
- "./html": {
41
- "types": "./build/typescript/html.d.ts",
42
- "quilt:source": "./source/html.ts",
43
- "quilt:esnext": "./build/esnext/html.esnext",
44
- "import": "./build/esm/html.mjs"
45
- },
46
- "./http": {
47
- "types": "./build/typescript/http.d.ts",
48
- "quilt:source": "./source/http.ts",
49
- "quilt:esnext": "./build/esnext/http.esnext",
50
- "import": "./build/esm/http.mjs"
51
- },
52
46
  "./events": {
53
47
  "types": "./build/typescript/events.d.ts",
54
48
  "quilt:source": "./source/events.ts",
@@ -161,8 +155,8 @@
161
155
  "async": [
162
156
  "./build/typescript/async.d.ts"
163
157
  ],
164
- "html": [
165
- "./build/typescript/html.d.ts"
158
+ "browser": [
159
+ "./build/typescript/browser.d.ts"
166
160
  ],
167
161
  "globals": [
168
162
  "./build/typescript/globals.d.ts"
@@ -170,9 +164,6 @@
170
164
  "env": [
171
165
  "./build/typescript/env.d.ts"
172
166
  ],
173
- "http": [
174
- "./build/typescript/http.d.ts"
175
- ],
176
167
  "events": [
177
168
  "./build/typescript/localize.d.ts"
178
169
  ],
@@ -221,38 +212,42 @@
221
212
  }
222
213
  },
223
214
  "sideEffects": [
215
+ "./source/browser.ts",
216
+ "./build/esnext/browser.esnext",
217
+ "./build/esm/browser.mjs",
224
218
  "./source/globals.ts",
225
219
  "./build/esnext/globals.esnext",
226
- "./build/esm/globals.mjs"
220
+ "./build/esm/globals.mjs",
221
+ "./source/signals.ts",
222
+ "./build/esnext/signals.esnext",
223
+ "./build/esm/signals.mjs"
227
224
  ],
228
225
  "dependencies": {
229
- "@quilted/assets": "^0.1.0",
230
- "@quilted/async": "^0.4.0",
226
+ "@quilted/assets": "^0.1.2",
227
+ "@quilted/async": "^0.4.1",
231
228
  "@quilted/events": "^2.0.0",
232
- "@quilted/graphql": "^3.0.0",
229
+ "@quilted/graphql": "^3.0.3",
233
230
  "@quilted/react": "^18.2.0",
234
- "@quilted/react-assets": "^0.1.0",
235
- "@quilted/react-async": "^0.4.0",
236
- "@quilted/react-dom": "^18.2.0",
231
+ "@quilted/react-async": "^0.4.2",
232
+ "@quilted/react-browser": "^0.0.1",
233
+ "@quilted/react-dom": "^18.2.11",
237
234
  "@quilted/react-graphql": "^0.5.0",
238
- "@quilted/react-html": "^0.4.0",
239
- "@quilted/react-http": "^0.4.0",
240
235
  "@quilted/react-idle": "^0.4.0",
241
- "@quilted/react-localize": "^0.2.0",
236
+ "@quilted/react-localize": "^0.2.2",
242
237
  "@quilted/react-performance": "^0.2.0",
243
- "@quilted/react-router": "^0.4.0",
244
- "@quilted/react-server-render": "^0.4.0",
245
- "@quilted/react-signals": "^0.2.0",
238
+ "@quilted/react-router": "^0.4.1",
239
+ "@quilted/react-signals": "^0.2.4",
246
240
  "@quilted/react-testing": "^0.6.0",
247
241
  "@quilted/react-utilities": "^0.2.0",
248
242
  "@quilted/react-workers": "^0.4.0",
249
243
  "@quilted/request-router": "^0.2.0",
250
244
  "@quilted/signals": "^0.2.0",
251
245
  "@quilted/threads": "^2.0.0",
246
+ "preact-render-to-string": "^6.4.0",
252
247
  "jest-matcher-utils": "^29.0.0"
253
248
  },
254
249
  "peerDependencies": {
255
- "graphql": "^16.7.0",
250
+ "graphql": "^16.8.0",
256
251
  "preact": "^10.20.0",
257
252
  "prettier": "^2.0.0 || ^3.0.0",
258
253
  "react": "^18.0.0",
package/source/assets.ts CHANGED
@@ -19,7 +19,6 @@ export type {
19
19
  AssetsBuildManifest,
20
20
  AssetsBuildManifestEntry,
21
21
  } from '@quilted/assets';
22
- export {useAssetsCacheKey, useModuleAssets} from '@quilted/react-assets';
23
22
 
24
23
  declare module '@quilted/assets' {
25
24
  interface AssetsCacheKey {
package/source/async.ts CHANGED
@@ -1,17 +1,18 @@
1
- export {createAsyncModule} from '@quilted/async';
2
- export type {AsyncModule} from '@quilted/async';
3
1
  export {
2
+ AsyncAction,
3
+ AsyncActionPromise,
4
+ AsyncActionDeferred,
5
+ AsyncModule,
6
+ type AsyncModuleLoader,
7
+ type AsyncModuleLoaderFunction,
8
+ type AsyncModuleLoaderObject,
9
+ } from '@quilted/async';
10
+ export {
11
+ AsyncComponent,
12
+ AsyncContext,
4
13
  useAsyncModule,
14
+ useAsyncModuleAssets,
5
15
  useAsyncModulePreload,
6
- usePreload,
7
- createAsyncComponent,
8
- } from '@quilted/react-async';
9
- export type {
10
- NoOptions,
11
- AssetLoadTiming,
12
- HydrationTiming,
13
- RenderTiming,
14
- AsyncComponentType,
15
- Preloadable,
16
+ useHydrated,
16
17
  } from '@quilted/react-async';
17
18
  export {useIdleCallback} from '@quilted/react-idle';
@@ -0,0 +1,5 @@
1
+ // Browser utilities depend on Signals, import to make sure we get the Preact
2
+ // hook for signals installed.
3
+ import './signals.ts';
4
+
5
+ export * from '@quilted/react-browser';
package/source/globals.ts CHANGED
@@ -2,20 +2,17 @@ import './modules.ts';
2
2
  import './assets/files.ts';
3
3
  import './assets/styles.ts';
4
4
 
5
- import {
6
- createAsyncModulesGlobal,
7
- type AsyncModulesGlobal,
8
- } from '@quilted/async';
5
+ import {AsyncModulesGlobal} from '@quilted/async';
9
6
 
10
7
  export interface QuiltGlobal {
11
- readonly AsyncModules: AsyncModulesGlobal;
8
+ readonly asyncModules: AsyncModulesGlobal;
12
9
  }
13
10
 
14
11
  const property = Symbol.for('quilt');
15
12
  const quilt = ((globalThis as any)[property] ?? {}) as QuiltGlobal;
16
13
 
17
- (quilt as any).AsyncModules = createAsyncModulesGlobal({
18
- cache: quilt.AsyncModules,
14
+ (quilt as any).asyncModules = new AsyncModulesGlobal({
15
+ cache: quilt.asyncModules,
19
16
  });
20
17
 
21
18
  Object.defineProperty(globalThis, property, {
@@ -5,7 +5,7 @@ export {
5
5
  RoutePreloading,
6
6
  NavigationBlock,
7
7
  useCurrentUrl,
8
- useInitialUrl,
8
+ useInitialURL,
9
9
  useRouter,
10
10
  useRoutes,
11
11
  useRouteMatch,
@@ -1,55 +1,34 @@
1
1
  import type {PropsWithChildren} from 'react';
2
2
 
3
- import {AssetsContext, type AssetsManager} from '@quilted/react-assets/server';
4
- import {InitialUrlContext} from '@quilted/react-router';
5
- import {HTMLContext, type HTMLManager} from '@quilted/react-html/server';
6
- import {HttpServerContext, type HttpManager} from '@quilted/react-http/server';
3
+ import {InitialURLContext} from '@quilted/react-router';
4
+ import {
5
+ BrowserDetailsContext,
6
+ type BrowserDetails,
7
+ } from '@quilted/react-browser/server';
7
8
 
8
9
  interface Props {
9
- url?: string | URL;
10
- html?: HTMLManager;
11
- http?: HttpManager;
12
- assets?: AssetsManager;
10
+ browser?: BrowserDetails;
13
11
  }
14
12
 
15
- export function ServerContext({
16
- url,
17
- html,
18
- http,
19
- assets,
20
- children,
21
- }: PropsWithChildren<Props>) {
22
- const normalizedUrl = typeof url === 'string' ? new URL(url) : url;
13
+ export function ServerContext({browser, children}: PropsWithChildren<Props>) {
14
+ const requestURL = browser?.request.url;
15
+ const initialURL = requestURL && new URL(requestURL);
23
16
 
24
- const withInitialURL = normalizedUrl ? (
25
- <InitialUrlContext.Provider value={normalizedUrl}>
17
+ const withInitialURL = initialURL ? (
18
+ <InitialURLContext.Provider value={initialURL}>
26
19
  {children}
27
- </InitialUrlContext.Provider>
20
+ </InitialURLContext.Provider>
28
21
  ) : (
29
22
  children
30
23
  );
31
24
 
32
- const withHTML = html ? (
33
- <HTMLContext.Provider value={html}>{withInitialURL}</HTMLContext.Provider>
25
+ const withBrowser = browser ? (
26
+ <BrowserDetailsContext.Provider value={browser}>
27
+ {withInitialURL}
28
+ </BrowserDetailsContext.Provider>
34
29
  ) : (
35
30
  withInitialURL
36
31
  );
37
32
 
38
- const withHTTPServer = http ? (
39
- <HttpServerContext.Provider value={http}>
40
- {withHTML}
41
- </HttpServerContext.Provider>
42
- ) : (
43
- withHTML
44
- );
45
-
46
- const withAssets = assets ? (
47
- <AssetsContext.Provider value={assets}>
48
- {withHTTPServer}
49
- </AssetsContext.Provider>
50
- ) : (
51
- withHTTPServer
52
- );
53
-
54
- return withAssets;
33
+ return withBrowser;
55
34
  }