@quilted/quilt 0.5.137 → 0.5.138
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/CHANGELOG.md +10 -0
- package/build/cjs/index.cjs +6 -2
- package/build/cjs/server/ServerContext.cjs +4 -6
- package/build/cjs/server/index.cjs +4 -13
- package/build/cjs/server/request-router.cjs +9 -14
- package/build/cjs/static/StaticContext.cjs +4 -6
- package/build/cjs/static/index.cjs +3 -4
- package/build/cjs/static/render.cjs +8 -11
- package/build/esm/index.mjs +1 -1
- package/build/esm/server/ServerContext.mjs +1 -3
- package/build/esm/server/index.mjs +1 -2
- package/build/esm/server/request-router.mjs +3 -8
- package/build/esm/static/StaticContext.mjs +1 -3
- package/build/esm/static/index.mjs +3 -4
- package/build/esm/static/render.mjs +2 -5
- package/build/esnext/index.esnext +1 -1
- package/build/esnext/server/ServerContext.esnext +1 -3
- package/build/esnext/server/index.esnext +1 -2
- package/build/esnext/server/request-router.esnext +3 -8
- package/build/esnext/static/StaticContext.esnext +1 -3
- package/build/esnext/static/index.esnext +3 -4
- package/build/esnext/static/render.esnext +2 -5
- package/build/tsconfig.tsbuildinfo +1 -1
- package/build/typescript/index.d.ts +1 -1
- package/build/typescript/index.d.ts.map +1 -1
- package/build/typescript/server/ServerContext.d.ts +4 -6
- package/build/typescript/server/ServerContext.d.ts.map +1 -1
- package/build/typescript/server/index.d.ts +1 -2
- package/build/typescript/server/index.d.ts.map +1 -1
- package/build/typescript/server/request-router.d.ts +0 -2
- package/build/typescript/server/request-router.d.ts.map +1 -1
- package/build/typescript/static/StaticContext.d.ts +4 -6
- package/build/typescript/static/StaticContext.d.ts.map +1 -1
- package/build/typescript/static/index.d.ts.map +1 -1
- package/build/typescript/static/render.d.ts +0 -2
- package/build/typescript/static/render.d.ts.map +1 -1
- package/package.json +3 -3
- package/source/index.ts +1 -1
- package/source/server/ServerContext.tsx +8 -19
- package/source/server/index.ts +2 -6
- package/source/server/request-router.tsx +5 -20
- package/source/static/StaticContext.tsx +8 -19
- package/source/static/index.tsx +7 -3
- package/source/static/render.tsx +2 -9
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
import type { PropsWithChildren } from 'react';
|
|
2
|
-
import type
|
|
3
|
-
import type
|
|
4
|
-
import type
|
|
5
|
-
import type { HttpManager } from '@quilted/react-http/server';
|
|
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';
|
|
6
5
|
interface Props {
|
|
7
6
|
url?: string | URL;
|
|
8
7
|
html?: HtmlManager;
|
|
9
8
|
http?: HttpManager;
|
|
10
9
|
assets?: AssetsManager;
|
|
11
|
-
asyncAssets?: AsyncAssetManager;
|
|
12
10
|
}
|
|
13
|
-
export declare function ServerContext({ url, html, http, assets,
|
|
11
|
+
export declare function ServerContext({ url, html, http, assets, children, }: PropsWithChildren<Props>): import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
|
14
12
|
export {};
|
|
15
13
|
//# 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;
|
|
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;AAI/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,0FAgB1B"}
|
|
@@ -2,8 +2,7 @@ export { Html, Serialize, HtmlManager, HtmlContext, renderHtmlToString, SERVER_A
|
|
|
2
2
|
export { ServerAction, useServerAction, ServerRenderManager, ServerRenderManagerContext, extract, } from '@quilted/react-server-render/server';
|
|
3
3
|
export { styleAssetAttributes, styleAssetPreloadAttributes, scriptAssetAttributes, scriptAssetPreloadAttributes, createBrowserAssetsFromManifests, createBrowserAssetsEntryFromManifest, } from '@quilted/assets';
|
|
4
4
|
export type { Asset, AssetsCacheKey, BrowserAssets, BrowserAssetsEntry, BrowserAssetSelector, BrowserAssetModuleSelector, AssetsBuildManifest, AssetsBuildManifestEntry, } from '@quilted/assets';
|
|
5
|
-
export {
|
|
6
|
-
export { AsyncAssetContext, AsyncAssetManager, SERVER_ACTION_ID as ASYNC_ASSETS_SERVER_ACTION_ID, } from '@quilted/react-async/server';
|
|
5
|
+
export { useAssetsCacheKey, useModuleAssets, AssetsContext, AssetsManager, SERVER_ACTION_ID as ASSETS_SERVER_ACTION_ID, } from '@quilted/react-assets/server';
|
|
7
6
|
export type { ServerActionKind, ServerActionOptions, ServerActionPerform, ServerRenderPass, } from '@quilted/react-server-render/server';
|
|
8
7
|
export type { HttpState } from '@quilted/react-http/server';
|
|
9
8
|
export { createRequestRouterLocalization } from '@quilted/react-localize/request-router';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../source/server/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,IAAI,EACJ,SAAS,EACT,WAAW,EACX,WAAW,EACX,kBAAkB,EAClB,gBAAgB,IAAI,qBAAqB,GAC1C,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,YAAY,EACZ,eAAe,EACf,mBAAmB,EACnB,0BAA0B,EAC1B,OAAO,GACR,MAAM,qCAAqC,CAAC;AAE7C,OAAO,EACL,oBAAoB,EACpB,2BAA2B,EAC3B,qBAAqB,EACrB,4BAA4B,EAC5B,gCAAgC,EAChC,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,aAAa,EACb,aAAa,EACb,gBAAgB,IAAI,uBAAuB,GAC5C,MAAM,8BAA8B,CAAC;AACtC,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../source/server/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,IAAI,EACJ,SAAS,EACT,WAAW,EACX,WAAW,EACX,kBAAkB,EAClB,gBAAgB,IAAI,qBAAqB,GAC1C,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,YAAY,EACZ,eAAe,EACf,mBAAmB,EACnB,0BAA0B,EAC1B,OAAO,GACR,MAAM,qCAAqC,CAAC;AAE7C,OAAO,EACL,oBAAoB,EACpB,2BAA2B,EAC3B,qBAAqB,EACrB,4BAA4B,EAC5B,gCAAgC,EAChC,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,EACV,gBAAgB,EAChB,mBAAmB,EACnB,mBAAmB,EACnB,gBAAgB,GACjB,MAAM,qCAAqC,CAAC;AAC7C,YAAY,EAAC,SAAS,EAAC,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAC,+BAA+B,EAAC,MAAM,wCAAwC,CAAC;AACvF,YAAY,EACV,yBAAyB,EACzB,iBAAiB,EACjB,yBAAyB,GAC1B,MAAM,wCAAwC,CAAC;AAChD,OAAO,EACL,OAAO,EACP,QAAQ,EACR,eAAe,EACf,gBAAgB,EAChB,mBAAmB,EACnB,aAAa,GACd,MAAM,yBAAyB,CAAC;AACjC,YAAY,EACV,OAAO,EACP,QAAQ,EACR,YAAY,EACZ,WAAW,EACX,OAAO,EACP,aAAa,EACb,aAAa,EACb,cAAc,EACd,cAAc,EACd,0BAA0B,EAC1B,gBAAgB,EAChB,mBAAmB,EACnB,0BAA0B,GAC3B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAC,yBAAyB,EAAC,MAAM,yBAAyB,CAAC;AAElE,OAAO,EAAC,aAAa,EAAC,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EACL,kBAAkB,EAClB,mBAAmB,EACnB,2BAA2B,GAC5B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAC,oBAAoB,EAAE,KAAK,mBAAmB,EAAC,MAAM,WAAW,CAAC"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { type ReactElement } from 'react';
|
|
2
2
|
import { type AssetsCacheKey, type BrowserAssets, type BrowserAssetsEntry } from '@quilted/assets';
|
|
3
3
|
import { AssetsManager } from '@quilted/react-assets/server';
|
|
4
|
-
import { AsyncAssetManager } from '@quilted/react-async/server';
|
|
5
4
|
import { HttpManager } from '@quilted/react-http/server';
|
|
6
5
|
import { HtmlManager } from '@quilted/react-html/server';
|
|
7
6
|
import type { Options as ExtractOptions, ServerRenderRequestContext } from '@quilted/react-server-render/server';
|
|
@@ -24,7 +23,6 @@ export interface ServerRenderAppDetails<_Context = RequestContext, CacheKey = As
|
|
|
24
23
|
readonly html: HtmlManager;
|
|
25
24
|
readonly assets: AssetsManager<CacheKey>;
|
|
26
25
|
readonly rendered?: string;
|
|
27
|
-
readonly asyncAssets: AsyncAssetManager;
|
|
28
26
|
}
|
|
29
27
|
export declare function createServerRender<Context = RequestContext, CacheKey = AssetsCacheKey>(getApp: ReactElement<any> | ((request: EnhancedRequest, context: Context) => ReactElement<any> | Promise<ReactElement<any>>), { stream, ...options }?: ServerRenderOptions<Context, CacheKey>): RequestHandler<Context>;
|
|
30
28
|
export declare function renderAppToResponse<Context = RequestContext, CacheKey = AssetsCacheKey>(getApp: ReactElement<any> | (() => ReactElement<any> | Promise<ReactElement<any>>), { request, context, assets, extract, renderHtml, }: Pick<ServerRenderOptions<Context, CacheKey>, 'assets' | 'renderHtml' | 'extract'> & {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"request-router.d.ts","sourceRoot":"","sources":["../../../source/server/request-router.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAW,KAAK,YAAY,EAAC,MAAM,OAAO,CAAC;AAElD,OAAO,EAKL,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,kBAAkB,EACxB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAC,aAAa,EAAC,MAAM,8BAA8B,CAAC;AAC3D,OAAO,EAAC,
|
|
1
|
+
{"version":3,"file":"request-router.d.ts","sourceRoot":"","sources":["../../../source/server/request-router.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAW,KAAK,YAAY,EAAC,MAAM,OAAO,CAAC;AAElD,OAAO,EAKL,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,kBAAkB,EACxB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAC,aAAa,EAAC,MAAM,8BAA8B,CAAC;AAC3D,OAAO,EAAC,WAAW,EAAC,MAAM,4BAA4B,CAAC;AACvD,OAAO,EAEL,WAAW,E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,QAAQ,CAAC,EACtC,QAAQ,GAAG,YAAY,GAAG,SAAS,CACpC,GAAG;IAAC,QAAQ,CAAC,OAAO,EAAE,eAAe,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAA;CAAC,+DAqDnE"}
|
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
import type { PropsWithChildren } from 'react';
|
|
2
|
-
import type
|
|
3
|
-
import type
|
|
4
|
-
import type
|
|
5
|
-
import type { HttpManager } from '@quilted/react-http/server';
|
|
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';
|
|
6
5
|
interface Props {
|
|
7
6
|
url?: string | URL;
|
|
8
7
|
html?: HtmlManager;
|
|
9
8
|
http?: HttpManager;
|
|
10
9
|
assets?: AssetsManager;
|
|
11
|
-
asyncAssets?: AsyncAssetManager;
|
|
12
10
|
}
|
|
13
|
-
export declare function StaticContext({ url, html, http, assets,
|
|
11
|
+
export declare function StaticContext({ url, html, http, assets, children, }: PropsWithChildren<Props>): import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
|
14
12
|
export {};
|
|
15
13
|
//# sourceMappingURL=StaticContext.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StaticContext.d.ts","sourceRoot":"","sources":["../../../source/static/StaticContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"StaticContext.d.ts","sourceRoot":"","sources":["../../../source/static/StaticContext.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,O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AAE,aAAa,CAAC,GAAG,CAAC,EACvB,EACE,MAAM,EACN,MAAM,EAAE,cAAc,EACtB,QAAQ,EACR,KAAY,EACZ,OAAkB,EAClB,QAAe,GAChB,EAAE,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../source/static/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAW,KAAK,aAAa,EAAC,MAAM,OAAO,CAAC;AAEnD,OAAO,EAKL,KAAK,aAAa,EACnB,MAAM,iBAAiB,CAAC;AAOzB,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,4BAA4B,CAAC;AAI1D,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC;IAC9B,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;CAC1B;AAOD,MAAM,WAAW,OAAO;IACtB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,MAAM,EAAE,aAAa,CAAC,GAAG,CAAC,CAAC;IAC3B,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,OAAO,EAAE,aAAa,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACxD;AAID,wBAAsB,YAAY,CAChC,GAAG,EAAE,aAAa,CAAC,GAAG,CAAC,EACvB,EACE,MAAM,EACN,MAAM,EAAE,cAAc,EACtB,QAAQ,EACR,KAAY,EACZ,OAAkB,EAClB,QAAe,GAChB,EAAE,OAAO,iBAwPX"}
|
|
@@ -2,7 +2,6 @@ import type { ReactElement } from 'react';
|
|
|
2
2
|
import type { Options as ExtractOptions } from '@quilted/react-server-render/server';
|
|
3
3
|
import { HtmlManager } from '@quilted/react-html/server';
|
|
4
4
|
import { HttpManager } from '@quilted/react-http/server';
|
|
5
|
-
import { AsyncAssetManager } from '@quilted/react-async/server';
|
|
6
5
|
import { AssetsManager } from '@quilted/react-assets/server';
|
|
7
6
|
import type { AssetsCacheKey } from '@quilted/assets';
|
|
8
7
|
interface Options<CacheKey = AssetsCacheKey> extends ExtractOptions {
|
|
@@ -15,7 +14,6 @@ export declare function renderApp<CacheKey = AssetsCacheKey>(app: ReactElement<a
|
|
|
15
14
|
http: HttpManager;
|
|
16
15
|
html: HtmlManager;
|
|
17
16
|
assets: AssetsManager<CacheKey>;
|
|
18
|
-
asyncAssets: AsyncAssetManager;
|
|
19
17
|
}>;
|
|
20
18
|
export {};
|
|
21
19
|
//# sourceMappingURL=render.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"render.d.ts","sourceRoot":"","sources":["../../../source/static/render.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,OAAO,CAAC;AAGxC,OAAO,KAAK,EAAC,OAAO,IAAI,cAAc,EAAC,MAAM,qCAAqC,CAAC;AACnF,OAAO,EAAC,WAAW,EAAC,MAAM,4BAA4B,CAAC;AACvD,OAAO,EAAC,WAAW,EAAC,MAAM,4BAA4B,CAAC;AACvD,OAAO,EAAC,
|
|
1
|
+
{"version":3,"file":"render.d.ts","sourceRoot":"","sources":["../../../source/static/render.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,OAAO,CAAC;AAGxC,OAAO,KAAK,EAAC,OAAO,IAAI,cAAc,EAAC,MAAM,qCAAqC,CAAC;AACnF,OAAO,EAAC,WAAW,EAAC,MAAM,4BAA4B,CAAC;AACvD,OAAO,EAAC,WAAW,EAAC,MAAM,4BAA4B,CAAC;AACvD,OAAO,EAAC,aAAa,EAAC,MAAM,8BAA8B,CAAC;AAC3D,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,iBAAiB,CAAC;AAIpD,UAAU,OAAO,CAAC,QAAQ,GAAG,cAAc,CAAE,SAAQ,cAAc;IACjE,GAAG,CAAC,EAAE,MAAM,GAAG,GAAG,CAAC;IACnB,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,OAAO,CAAC,EAAE,WAAW,CACnB,qBAAqB,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,CAAC,CAC7C,CAAC,SAAS,CAAC,CAAC;CACd;AAED,wBAAsB,SAAS,CAAC,QAAQ,GAAG,cAAc,EACvD,GAAG,EAAE,YAAY,CAAC,GAAG,CAAC,EACtB,EAAC,QAAQ,EAAE,GAAG,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAC,GAAE,OAAO,CAAC,QAAQ,CAAM;;;;;GAkBpE"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quilted/quilt",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.5.
|
|
4
|
+
"version": "0.5.138",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "https://github.com/lemonmade/quilt.git",
|
|
@@ -214,13 +214,13 @@
|
|
|
214
214
|
"./build/esm/polyfills/*.mjs"
|
|
215
215
|
],
|
|
216
216
|
"dependencies": {
|
|
217
|
-
"@quilted/assets": "^0.0.
|
|
217
|
+
"@quilted/assets": "^0.0.2",
|
|
218
218
|
"@quilted/async": "^0.3.34",
|
|
219
219
|
"@quilted/events": "^0.1.0",
|
|
220
220
|
"@quilted/graphql": "^0.4.34",
|
|
221
221
|
"@quilted/polyfills": "^0.2.12",
|
|
222
222
|
"@quilted/react": "^18.2.0",
|
|
223
|
-
"@quilted/react-assets": "^0.0.
|
|
223
|
+
"@quilted/react-assets": "^0.0.2",
|
|
224
224
|
"@quilted/react-async": "^0.3.43",
|
|
225
225
|
"@quilted/react-dom": "^18.2.0",
|
|
226
226
|
"@quilted/react-graphql": "^0.4.30",
|
package/source/index.ts
CHANGED
|
@@ -38,7 +38,7 @@ export type {
|
|
|
38
38
|
EventTargetFunction,
|
|
39
39
|
EventTargetOn,
|
|
40
40
|
} from '@quilted/events';
|
|
41
|
-
export {
|
|
41
|
+
export {useAssetsCacheKey, useModuleAssets} from '@quilted/react-assets';
|
|
42
42
|
export {
|
|
43
43
|
useAsyncModule,
|
|
44
44
|
useAsyncModulePreload,
|
|
@@ -1,14 +1,9 @@
|
|
|
1
1
|
import type {PropsWithChildren} from 'react';
|
|
2
2
|
|
|
3
|
-
import {AssetsContext} from '@quilted/react-assets/server';
|
|
4
|
-
import type {AssetsManager} from '@quilted/react-assets/server';
|
|
3
|
+
import {AssetsContext, type AssetsManager} from '@quilted/react-assets/server';
|
|
5
4
|
import {InitialUrlContext} from '@quilted/react-router';
|
|
6
|
-
import {HtmlContext} from '@quilted/react-html/server';
|
|
7
|
-
import type
|
|
8
|
-
import {AsyncAssetContext} from '@quilted/react-async/server';
|
|
9
|
-
import type {AsyncAssetManager} from '@quilted/react-async/server';
|
|
10
|
-
import {HttpServerContext} from '@quilted/react-http/server';
|
|
11
|
-
import type {HttpManager} from '@quilted/react-http/server';
|
|
5
|
+
import {HtmlContext, type HtmlManager} from '@quilted/react-html/server';
|
|
6
|
+
import {HttpServerContext, type HttpManager} from '@quilted/react-http/server';
|
|
12
7
|
|
|
13
8
|
import {maybeWrapContext} from '../utilities/react';
|
|
14
9
|
|
|
@@ -17,7 +12,6 @@ interface Props {
|
|
|
17
12
|
html?: HtmlManager;
|
|
18
13
|
http?: HttpManager;
|
|
19
14
|
assets?: AssetsManager;
|
|
20
|
-
asyncAssets?: AsyncAssetManager;
|
|
21
15
|
}
|
|
22
16
|
|
|
23
17
|
export function ServerContext({
|
|
@@ -25,7 +19,6 @@ export function ServerContext({
|
|
|
25
19
|
html,
|
|
26
20
|
http,
|
|
27
21
|
assets,
|
|
28
|
-
asyncAssets,
|
|
29
22
|
children,
|
|
30
23
|
}: PropsWithChildren<Props>) {
|
|
31
24
|
const normalizedUrl = typeof url === 'string' ? new URL(url) : url;
|
|
@@ -34,16 +27,12 @@ export function ServerContext({
|
|
|
34
27
|
AssetsContext,
|
|
35
28
|
assets,
|
|
36
29
|
maybeWrapContext(
|
|
37
|
-
|
|
38
|
-
|
|
30
|
+
HttpServerContext,
|
|
31
|
+
http,
|
|
39
32
|
maybeWrapContext(
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
maybeWrapContext(
|
|
43
|
-
HtmlContext,
|
|
44
|
-
html,
|
|
45
|
-
maybeWrapContext(InitialUrlContext, normalizedUrl, children),
|
|
46
|
-
),
|
|
33
|
+
HtmlContext,
|
|
34
|
+
html,
|
|
35
|
+
maybeWrapContext(InitialUrlContext, normalizedUrl, children),
|
|
47
36
|
),
|
|
48
37
|
),
|
|
49
38
|
);
|
package/source/server/index.ts
CHANGED
|
@@ -33,16 +33,12 @@ export type {
|
|
|
33
33
|
AssetsBuildManifestEntry,
|
|
34
34
|
} from '@quilted/assets';
|
|
35
35
|
export {
|
|
36
|
-
|
|
36
|
+
useAssetsCacheKey,
|
|
37
|
+
useModuleAssets,
|
|
37
38
|
AssetsContext,
|
|
38
39
|
AssetsManager,
|
|
39
40
|
SERVER_ACTION_ID as ASSETS_SERVER_ACTION_ID,
|
|
40
41
|
} from '@quilted/react-assets/server';
|
|
41
|
-
export {
|
|
42
|
-
AsyncAssetContext,
|
|
43
|
-
AsyncAssetManager,
|
|
44
|
-
SERVER_ACTION_ID as ASYNC_ASSETS_SERVER_ACTION_ID,
|
|
45
|
-
} from '@quilted/react-async/server';
|
|
46
42
|
export type {
|
|
47
43
|
ServerActionKind,
|
|
48
44
|
ServerActionOptions,
|
|
@@ -10,7 +10,6 @@ import {
|
|
|
10
10
|
type BrowserAssetsEntry,
|
|
11
11
|
} from '@quilted/assets';
|
|
12
12
|
import {AssetsManager} from '@quilted/react-assets/server';
|
|
13
|
-
import {AsyncAssetManager} from '@quilted/react-async/server';
|
|
14
13
|
import {HttpManager} from '@quilted/react-http/server';
|
|
15
14
|
import {
|
|
16
15
|
renderHtmlToString,
|
|
@@ -65,7 +64,6 @@ export interface ServerRenderAppDetails<
|
|
|
65
64
|
readonly html: HtmlManager;
|
|
66
65
|
readonly assets: AssetsManager<CacheKey>;
|
|
67
66
|
readonly rendered?: string;
|
|
68
|
-
readonly asyncAssets: AsyncAssetManager;
|
|
69
67
|
}
|
|
70
68
|
|
|
71
69
|
export function createServerRender<
|
|
@@ -252,7 +250,6 @@ async function serverRenderDetailsForApp<
|
|
|
252
250
|
} = {},
|
|
253
251
|
): Promise<ServerRenderAppDetails<Context, CacheKey>> {
|
|
254
252
|
const html = new HtmlManager();
|
|
255
|
-
const asyncAssets = new AsyncAssetManager();
|
|
256
253
|
const http = new HttpManager({headers});
|
|
257
254
|
const assets = new AssetsManager<CacheKey>({cacheKey});
|
|
258
255
|
|
|
@@ -261,13 +258,7 @@ async function serverRenderDetailsForApp<
|
|
|
261
258
|
const rendered = await extract(app, {
|
|
262
259
|
decorate(app) {
|
|
263
260
|
return (
|
|
264
|
-
<ServerContext
|
|
265
|
-
asyncAssets={asyncAssets}
|
|
266
|
-
http={http}
|
|
267
|
-
html={html}
|
|
268
|
-
url={url}
|
|
269
|
-
assets={assets}
|
|
270
|
-
>
|
|
261
|
+
<ServerContext http={http} html={html} url={url} assets={assets}>
|
|
271
262
|
{decorate?.(app) ?? app}
|
|
272
263
|
</ServerContext>
|
|
273
264
|
);
|
|
@@ -275,7 +266,7 @@ async function serverRenderDetailsForApp<
|
|
|
275
266
|
...rest,
|
|
276
267
|
});
|
|
277
268
|
|
|
278
|
-
return {rendered, http, html,
|
|
269
|
+
return {rendered, http, html, assets};
|
|
279
270
|
}
|
|
280
271
|
|
|
281
272
|
async function renderAppDetailsToHtmlString<
|
|
@@ -294,21 +285,15 @@ async function renderAppDetailsToHtmlString<
|
|
|
294
285
|
readonly cacheKey?: Partial<CacheKey>;
|
|
295
286
|
},
|
|
296
287
|
) {
|
|
297
|
-
const {
|
|
298
|
-
http,
|
|
299
|
-
rendered,
|
|
300
|
-
asyncAssets,
|
|
301
|
-
html: htmlManager,
|
|
302
|
-
assets: assetsManager,
|
|
303
|
-
} = details;
|
|
288
|
+
const {http, rendered, html: htmlManager, assets: assetsManager} = details;
|
|
304
289
|
|
|
305
|
-
const usedModules = asyncAssets.used({timing: 'load'});
|
|
306
290
|
const cacheKey = assetsManager.cacheKey as CacheKey;
|
|
291
|
+
const usedModules = assetsManager.usedModules({timing: 'load'});
|
|
307
292
|
|
|
308
293
|
const [entryAssets, preloadAssets] = assets
|
|
309
294
|
? await Promise.all([
|
|
310
295
|
assets.entry({modules: usedModules, cacheKey}),
|
|
311
|
-
assets.modules(
|
|
296
|
+
assets.modules(assetsManager.usedModules({timing: 'preload'}), {
|
|
312
297
|
cacheKey,
|
|
313
298
|
}),
|
|
314
299
|
])
|
|
@@ -1,14 +1,9 @@
|
|
|
1
1
|
import type {PropsWithChildren} from 'react';
|
|
2
2
|
|
|
3
|
-
import {AssetsContext} from '@quilted/react-assets/server';
|
|
4
|
-
import type {AssetsManager} from '@quilted/react-assets/server';
|
|
3
|
+
import {AssetsContext, type AssetsManager} from '@quilted/react-assets/server';
|
|
5
4
|
import {InitialUrlContext} from '@quilted/react-router';
|
|
6
|
-
import {HtmlContext} from '@quilted/react-html/server';
|
|
7
|
-
import type
|
|
8
|
-
import {AsyncAssetContext} from '@quilted/react-async/server';
|
|
9
|
-
import type {AsyncAssetManager} from '@quilted/react-async/server';
|
|
10
|
-
import {HttpServerContext} from '@quilted/react-http/server';
|
|
11
|
-
import type {HttpManager} from '@quilted/react-http/server';
|
|
5
|
+
import {HtmlContext, type HtmlManager} from '@quilted/react-html/server';
|
|
6
|
+
import {HttpServerContext, type HttpManager} from '@quilted/react-http/server';
|
|
12
7
|
|
|
13
8
|
import {maybeWrapContext} from '../utilities/react';
|
|
14
9
|
|
|
@@ -17,7 +12,6 @@ interface Props {
|
|
|
17
12
|
html?: HtmlManager;
|
|
18
13
|
http?: HttpManager;
|
|
19
14
|
assets?: AssetsManager;
|
|
20
|
-
asyncAssets?: AsyncAssetManager;
|
|
21
15
|
}
|
|
22
16
|
|
|
23
17
|
export function StaticContext({
|
|
@@ -25,7 +19,6 @@ export function StaticContext({
|
|
|
25
19
|
html,
|
|
26
20
|
http,
|
|
27
21
|
assets,
|
|
28
|
-
asyncAssets,
|
|
29
22
|
children,
|
|
30
23
|
}: PropsWithChildren<Props>) {
|
|
31
24
|
const normalizedUrl = typeof url === 'string' ? new URL(url) : url;
|
|
@@ -34,16 +27,12 @@ export function StaticContext({
|
|
|
34
27
|
AssetsContext,
|
|
35
28
|
assets,
|
|
36
29
|
maybeWrapContext(
|
|
37
|
-
|
|
38
|
-
|
|
30
|
+
HttpServerContext,
|
|
31
|
+
http,
|
|
39
32
|
maybeWrapContext(
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
maybeWrapContext(
|
|
43
|
-
HtmlContext,
|
|
44
|
-
html,
|
|
45
|
-
maybeWrapContext(InitialUrlContext, normalizedUrl, children),
|
|
46
|
-
),
|
|
33
|
+
HtmlContext,
|
|
34
|
+
html,
|
|
35
|
+
maybeWrapContext(InitialUrlContext, normalizedUrl, children),
|
|
47
36
|
),
|
|
48
37
|
),
|
|
49
38
|
);
|
package/source/static/index.tsx
CHANGED
|
@@ -219,7 +219,6 @@ export async function renderStatic(
|
|
|
219
219
|
html: htmlManager,
|
|
220
220
|
assets: assetsManager,
|
|
221
221
|
markup,
|
|
222
|
-
asyncAssets,
|
|
223
222
|
} = await renderApp(<App />, {
|
|
224
223
|
url,
|
|
225
224
|
cacheKey: initialCacheKey,
|
|
@@ -235,8 +234,13 @@ export async function renderStatic(
|
|
|
235
234
|
const cacheKey = assetsManager.cacheKey;
|
|
236
235
|
|
|
237
236
|
const [mainAssets, preloadAssets] = await Promise.all([
|
|
238
|
-
assets.entry({
|
|
239
|
-
|
|
237
|
+
assets.entry({
|
|
238
|
+
modules: assetsManager.usedModules({timing: 'load'}),
|
|
239
|
+
cacheKey,
|
|
240
|
+
}),
|
|
241
|
+
assets.modules(assetsManager.usedModules({timing: 'preload'}), {
|
|
242
|
+
cacheKey,
|
|
243
|
+
}),
|
|
240
244
|
]);
|
|
241
245
|
|
|
242
246
|
const minifiedHtml = renderHtmlToString(
|
package/source/static/render.tsx
CHANGED
|
@@ -4,7 +4,6 @@ import {extract} from '@quilted/react-server-render/server';
|
|
|
4
4
|
import type {Options as ExtractOptions} from '@quilted/react-server-render/server';
|
|
5
5
|
import {HtmlManager} from '@quilted/react-html/server';
|
|
6
6
|
import {HttpManager} from '@quilted/react-http/server';
|
|
7
|
-
import {AsyncAssetManager} from '@quilted/react-async/server';
|
|
8
7
|
import {AssetsManager} from '@quilted/react-assets/server';
|
|
9
8
|
import type {AssetsCacheKey} from '@quilted/assets';
|
|
10
9
|
|
|
@@ -23,19 +22,13 @@ export async function renderApp<CacheKey = AssetsCacheKey>(
|
|
|
23
22
|
{decorate, url, headers, cacheKey, ...rest}: Options<CacheKey> = {},
|
|
24
23
|
) {
|
|
25
24
|
const html = new HtmlManager();
|
|
26
|
-
const asyncAssets = new AsyncAssetManager();
|
|
27
25
|
const http = new HttpManager({headers});
|
|
28
26
|
const assets = new AssetsManager<CacheKey>({cacheKey});
|
|
29
27
|
|
|
30
28
|
const markup = await extract(app, {
|
|
31
29
|
decorate(app) {
|
|
32
30
|
return (
|
|
33
|
-
<StaticContext
|
|
34
|
-
asyncAssets={asyncAssets}
|
|
35
|
-
html={html}
|
|
36
|
-
http={http}
|
|
37
|
-
url={url}
|
|
38
|
-
>
|
|
31
|
+
<StaticContext html={html} http={http} url={url} assets={assets}>
|
|
39
32
|
{decorate?.(app) ?? app}
|
|
40
33
|
</StaticContext>
|
|
41
34
|
);
|
|
@@ -43,5 +36,5 @@ export async function renderApp<CacheKey = AssetsCacheKey>(
|
|
|
43
36
|
...rest,
|
|
44
37
|
});
|
|
45
38
|
|
|
46
|
-
return {markup, http, html, assets
|
|
39
|
+
return {markup, http, html, assets};
|
|
47
40
|
}
|