@quilted/quilt 0.5.119 → 0.5.121
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 +14 -0
- package/build/cjs/App.cjs +77 -0
- package/build/cjs/TestApp.cjs +20 -0
- package/build/cjs/index.cjs +18 -10
- package/build/cjs/server/request-router.cjs +23 -7
- package/build/cjs/testing.cjs +4 -2
- package/build/esm/App.mjs +75 -0
- package/build/esm/TestApp.mjs +18 -0
- package/build/esm/index.mjs +4 -4
- package/build/esm/server/request-router.mjs +23 -7
- package/build/esm/testing.mjs +2 -1
- package/build/esnext/App.esnext +75 -0
- package/build/esnext/TestApp.esnext +18 -0
- package/build/esnext/index.esnext +4 -4
- package/build/esnext/server/request-router.esnext +23 -7
- package/build/esnext/testing.esnext +2 -1
- package/build/tsconfig.tsbuildinfo +1 -1
- package/build/typescript/App.d.ts +48 -0
- package/build/typescript/App.d.ts.map +1 -0
- package/build/typescript/TestApp.d.ts +17 -0
- package/build/typescript/TestApp.d.ts.map +1 -0
- package/build/typescript/index.d.ts +5 -5
- package/build/typescript/index.d.ts.map +1 -1
- package/build/typescript/server/render.d.ts +8 -8
- package/build/typescript/server/render.d.ts.map +1 -1
- package/build/typescript/server/request-router.d.ts +8 -2
- package/build/typescript/server/request-router.d.ts.map +1 -1
- package/build/typescript/testing.d.ts +2 -1
- package/build/typescript/testing.d.ts.map +1 -1
- package/package.json +1 -1
- package/source/App.tsx +171 -0
- package/source/TestApp.tsx +33 -0
- package/source/index.ts +12 -5
- package/source/server/render.tsx +9 -2
- package/source/server/request-router.tsx +56 -21
- package/source/testing.ts +3 -1
- package/build/cjs/AppContext.cjs +0 -20
- package/build/esm/AppContext.mjs +0 -18
- package/build/esnext/AppContext.esnext +0 -18
- package/source/AppContext.tsx +0 -21
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type PropsWithChildren } from 'react';
|
|
2
|
+
import { type Router } from '@quilted/react-router';
|
|
3
|
+
interface Props {
|
|
4
|
+
/**
|
|
5
|
+
* Customizes how routing is handled during testing. You can provide a test router, or
|
|
6
|
+
* you can pass `false` to disable Quilt’s routing features.
|
|
7
|
+
*/
|
|
8
|
+
routing?: boolean | Router;
|
|
9
|
+
/**
|
|
10
|
+
* Customizes how localization is handled during testing. You can provide a string locale,
|
|
11
|
+
* or you can pass `false` to disable Quilt’s localization features.
|
|
12
|
+
*/
|
|
13
|
+
localization?: boolean | string;
|
|
14
|
+
}
|
|
15
|
+
export declare function QuiltAppTesting({ routing, localization, children, }: PropsWithChildren<Props>): JSX.Element;
|
|
16
|
+
export {};
|
|
17
|
+
//# sourceMappingURL=TestApp.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TestApp.d.ts","sourceRoot":"","sources":["../../source/TestApp.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,iBAAiB,EAAC,MAAM,OAAO,CAAC;AAE7C,OAAO,EAAC,KAAK,MAAM,EAAC,MAAM,uBAAuB,CAAC;AAIlD,UAAU,KAAK;IACb;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IAE3B;;;OAGG;IACH,YAAY,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;CACjC;AAID,wBAAgB,eAAe,CAAC,EAC9B,OAAc,EACd,YAAmB,EACnB,QAAQ,GACT,EAAE,iBAAiB,CAAC,KAAK,CAAC,eAM1B"}
|
|
@@ -9,15 +9,15 @@ export { GraphQLContext, createGraphQLHttpFetch, useGraphQLFetch, } from '@quilt
|
|
|
9
9
|
export { useIdleCallback } from '@quilted/react-idle';
|
|
10
10
|
export { ServerAction, useServerAction, useServerContext, } from '@quilted/react-server-render';
|
|
11
11
|
export type { ServerActionKind, ServerActionOptions, ServerActionPerform, ServerRenderPass, ServerRenderRequestContext, } from '@quilted/react-server-render';
|
|
12
|
-
export { Localization, useLocale, useLocaleFromEnvironment, useLocalizedFormatting, LocalizedLink,
|
|
12
|
+
export { Localization, useLocale, useLocaleFromEnvironment, useLocalizedFormatting, LocalizedLink, LocalizedRouting, useRouteLocalization, createRouteLocalization, createRoutePathLocalization, createRouteSubdomainLocalization, } from '@quilted/react-localize';
|
|
13
13
|
export type { LocalizedFormatting, LocalizedFormattingCache, LocalizedNumberFormatOptions, LocalizedDateTimeFormatOptions, RouteLocalization, ResolvedRouteLocalization, DefaultLocaleDefinition, } from '@quilted/react-localize';
|
|
14
|
-
export { PerformanceContext, usePerformance, usePerformanceNavigation, } from '@quilted/react-performance';
|
|
14
|
+
export { createPerformance, PerformanceContext, usePerformance, usePerformanceNavigation, usePerformanceNavigationEvent, } from '@quilted/react-performance';
|
|
15
15
|
export type { Performance, PerformanceNavigation, PerformanceInflightNavigation, } from '@quilted/react-performance';
|
|
16
|
-
export { Link, Redirect,
|
|
17
|
-
export type { NavigateTo, RouteDefinition } from '@quilted/react-router';
|
|
16
|
+
export { Link, Redirect, Routing, RoutePreloading, NavigationBlock, useCurrentUrl, useInitialUrl, useRouter, useRoutes, useMatch, useNavigate, useRedirect, useNavigationBlock, useScrollRestoration, useRouteChangeFocusRef, } from '@quilted/react-router';
|
|
17
|
+
export type { Router, NavigateTo, Routes, RouteDefinition, } from '@quilted/react-router';
|
|
18
18
|
export { useCookie, useCookies, CookieContext } from '@quilted/react-http';
|
|
19
19
|
export type { PropsWithChildren } from '@quilted/useful-react-types';
|
|
20
20
|
export { createOptionalContext, createUseContextHook, createUseOptionalValueHook, type UseContextHook, type UseOptionalValueHook, type UseOptionalValueHookOptions, } from '@quilted/react-utilities';
|
|
21
21
|
export { useSignal, useComputed, useSignalEffect, signal, batch as signalBatch, computed as computedSignal, effect as signalEffect, isSignal, resolveSignalOrValue, Signal, type SignalOrValue, } from '@quilted/react-signals';
|
|
22
|
-
export {
|
|
22
|
+
export { QuiltApp } from './App';
|
|
23
23
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../source/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,iBAAiB,EAAC,MAAM,gBAAgB,CAAC;AACjD,YAAY,EAAC,WAAW,EAAC,MAAM,gBAAgB,CAAC;AAChD,OAAO,EACL,EAAE,EACF,IAAI,EACJ,aAAa,EACb,UAAU,EACV,qBAAqB,EACrB,cAAc,EACd,sBAAsB,GACvB,MAAM,iBAAiB,CAAC;AACzB,YAAY,EACV,aAAa,EACb,OAAO,EACP,cAAc,EACd,WAAW,EACX,2BAA2B,EAC3B,mBAAmB,EACnB,aAAa,GACd,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,QAAQ,EACR,aAAa,EACb,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,YAAY,EACV,aAAa,EACb,YAAY,EACZ,mBAAmB,EACnB,WAAW,EACX,gBAAgB,EAChB,YAAY,EACZ,gBAAgB,EAChB,oBAAoB,EACpB,sBAAsB,EACtB,uBAAuB,EACvB,uBAAuB,EACvB,eAAe,EACf,sBAAsB,GACvB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,cAAc,EACd,sBAAsB,EACtB,eAAe,GAChB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAC,eAAe,EAAC,MAAM,qBAAqB,CAAC;AACpD,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;AACtC,OAAO,EACL,YAAY,EACZ,SAAS,EACT,wBAAwB,EACxB,sBAAsB,EACtB,aAAa,EACb,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","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'@quilted/react-server-render/ser
|
|
|
3
3
|
import { HtmlManager } from '@quilted/react-html/server';
|
|
4
4
|
import { HttpManager } from '@quilted/react-http/server';
|
|
5
5
|
import { AsyncAssetManager } from '@quilted/react-async/server';
|
|
6
|
-
interface Options extends ExtractOptions {
|
|
6
|
+
export interface Options extends ExtractOptions {
|
|
7
7
|
url?: string | URL;
|
|
8
8
|
headers?: NonNullable<ConstructorParameters<typeof HttpManager>[0]>['headers'];
|
|
9
9
|
}
|
|
10
|
-
export
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
asyncAssets: AsyncAssetManager;
|
|
15
|
-
}
|
|
16
|
-
export {}
|
|
10
|
+
export interface RenderResult {
|
|
11
|
+
readonly http: HttpManager;
|
|
12
|
+
readonly html: HtmlManager;
|
|
13
|
+
readonly markup: string;
|
|
14
|
+
readonly asyncAssets: AsyncAssetManager;
|
|
15
|
+
}
|
|
16
|
+
export declare function renderApp(app: ReactElement<any>, { decorate, url, headers, ...rest }?: Options): Promise<RenderResult>;
|
|
17
17
|
//# sourceMappingURL=render.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"render.d.ts","sourceRoot":"","sources":["../../../source/server/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,iBAAiB,EAAC,MAAM,6BAA6B,CAAC;AAI9D,
|
|
1
|
+
{"version":3,"file":"render.d.ts","sourceRoot":"","sources":["../../../source/server/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,iBAAiB,EAAC,MAAM,6BAA6B,CAAC;AAI9D,MAAM,WAAW,OAAQ,SAAQ,cAAc;IAC7C,GAAG,CAAC,EAAE,MAAM,GAAG,GAAG,CAAC;IACnB,OAAO,CAAC,EAAE,WAAW,CACnB,qBAAqB,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,CAAC,CAC7C,CAAC,SAAS,CAAC,CAAC;CACd;AAED,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;IAC3B,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;IAC3B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,WAAW,EAAE,iBAAiB,CAAC;CACzC;AAED,wBAAsB,SAAS,CAC7B,GAAG,EAAE,YAAY,CAAC,GAAG,CAAC,EACtB,EAAC,QAAQ,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,IAAI,EAAC,GAAE,OAAY,GAC9C,OAAO,CAAC,YAAY,CAAC,CAsBvB"}
|
|
@@ -1,13 +1,19 @@
|
|
|
1
1
|
import type { ReactElement } from 'react';
|
|
2
|
-
import type { AssetManifest } from '@quilted/async/server';
|
|
2
|
+
import type { Asset, AssetManifest } from '@quilted/async/server';
|
|
3
3
|
import type { Options as ExtractOptions, ServerRenderRequestContext } from '@quilted/react-server-render/server';
|
|
4
4
|
import type { RequestRouter, EnhancedRequest, RequestHandler, RequestContext } from '@quilted/request-router';
|
|
5
|
+
import { type RenderResult as RenderAppResult } from './render';
|
|
5
6
|
export interface Options<Context = RequestContext> extends Omit<ExtractOptions, 'context'> {
|
|
6
7
|
assets?: AssetManifest<unknown>;
|
|
7
8
|
router?: RequestRouter<Context>;
|
|
8
9
|
context?(request: EnhancedRequest, context: Context): ServerRenderRequestContext;
|
|
10
|
+
renderHtml?(content: string, request: Request, details: Omit<RenderAppResult, 'asyncAssets' | 'markup'> & {
|
|
11
|
+
readonly styles: readonly Asset[];
|
|
12
|
+
readonly scripts: readonly Asset[];
|
|
13
|
+
readonly preload: readonly Asset[];
|
|
14
|
+
}): ReactElement<any> | Promise<ReactElement<any>>;
|
|
9
15
|
}
|
|
10
16
|
export declare function createServerRenderingRequestRouter<Context = RequestContext>(render: (request: EnhancedRequest, context: Context) => ReactElement<any> | Promise<ReactElement<any>>, { router, ...options }: Options<Context>): RequestRouter<Context>;
|
|
11
17
|
export declare function createServerRenderingRequestHandler<Context = RequestContext>(render: (request: EnhancedRequest, context: Context) => ReactElement<any> | Promise<ReactElement<any>>, { context, ...options }?: Omit<Options<Context>, 'router'>): RequestHandler<Context>;
|
|
12
|
-
export declare function renderToResponse(app: ReactElement<any>, request: Request, { assets, ...options }?: Omit<Options, 'handler' | 'renderProps'>): Promise<import("@quilted/request-router").EnhancedResponse | undefined>;
|
|
18
|
+
export declare function renderToResponse(app: ReactElement<any>, request: Request, { assets, renderHtml, ...options }?: Omit<Options, 'handler' | 'renderProps'>): Promise<import("@quilted/request-router").EnhancedResponse | undefined>;
|
|
13
19
|
//# 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,KAAK,EAAC,YAAY,EAAC,MAAM,OAAO,CAAC;AAExC,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"request-router.d.ts","sourceRoot":"","sources":["../../../source/server/request-router.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,OAAO,CAAC;AAExC,OAAO,KAAK,EAAC,KAAK,EAAE,aAAa,EAAC,MAAM,uBAAuB,CAAC;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O,GAAG,cAAc,EAC1E,MAAM,EAAE,CACN,OAAO,EAAE,eAAe,EACxB,OAAO,EAAE,OAAO,KACb,YAAY,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,EACnD,EAAC,OAAO,EAAE,GAAG,OAAO,EAAC,GAAE,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,QAAQ,CAAM,GAC3D,cAAc,CAAC,OAAO,CAAC,CASzB;AAED,wBAAsB,gBAAgB,CACpC,GAAG,EAAE,YAAY,CAAC,GAAG,CAAC,EACtB,OAAO,EAAE,OAAO,EAChB,EACE,MAAM,EACN,UAA8B,EAC9B,GAAG,OAAO,EACX,GAAE,IAAI,CAAC,OAAO,EAAE,SAAS,GAAG,aAAa,CAAM,2EAmDjD"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
export * from '@quilted/testing';
|
|
2
2
|
export { mount, mounted, unmountAll, createMount } from '@quilted/react-testing';
|
|
3
3
|
export type { CustomMount, HookRunner, Node, NodeApi, Root, RootApi, EnvironmentOptions, ContextOption, RenderOption, ActionsOption, DebugOptions, EmptyObject, PlainObject, Predicate, } from '@quilted/react-testing';
|
|
4
|
-
export {
|
|
4
|
+
export { TestRouting, createTestRouter } from '@quilted/react-router/testing';
|
|
5
5
|
export { TestGraphQL, createFiller, createSchema, GraphQLController, createGraphQLController, } from '@quilted/react-graphql/testing';
|
|
6
6
|
export type { GraphQLMock, GraphQLMockFunction, GraphQLMockObject, } from '@quilted/react-graphql/testing';
|
|
7
|
+
export { QuiltAppTesting } from './TestApp';
|
|
7
8
|
//# sourceMappingURL=testing.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"testing.d.ts","sourceRoot":"","sources":["../../source/testing.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,OAAO,EAAC,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,WAAW,EAAC,MAAM,wBAAwB,CAAC;AAC/E,YAAY,EACV,WAAW,EACX,UAAU,EACV,IAAI,EACJ,OAAO,EACP,IAAI,EACJ,OAAO,EACP,kBAAkB,EAClB,aAAa,EACb,YAAY,EACZ,aAAa,EACb,YAAY,EACZ,WAAW,EACX,WAAW,EACX,SAAS,GACV,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAC,
|
|
1
|
+
{"version":3,"file":"testing.d.ts","sourceRoot":"","sources":["../../source/testing.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,OAAO,EAAC,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,WAAW,EAAC,MAAM,wBAAwB,CAAC;AAC/E,YAAY,EACV,WAAW,EACX,UAAU,EACV,IAAI,EACJ,OAAO,EACP,IAAI,EACJ,OAAO,EACP,kBAAkB,EAClB,aAAa,EACb,YAAY,EACZ,aAAa,EACb,YAAY,EACZ,WAAW,EACX,WAAW,EACX,SAAS,GACV,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAC,WAAW,EAAE,gBAAgB,EAAC,MAAM,+BAA+B,CAAC;AAC5E,OAAO,EACL,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,iBAAiB,EACjB,uBAAuB,GACxB,MAAM,gCAAgC,CAAC;AACxC,YAAY,EACV,WAAW,EACX,mBAAmB,EACnB,iBAAiB,GAClB,MAAM,gCAAgC,CAAC;AAExC,OAAO,EAAC,eAAe,EAAC,MAAM,WAAW,CAAC"}
|
package/package.json
CHANGED
package/source/App.tsx
ADDED
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
import type {ComponentProps, PropsWithChildren, ReactNode} from 'react';
|
|
2
|
+
|
|
3
|
+
import {HttpContext, CookieContext} from '@quilted/react-http';
|
|
4
|
+
import {useHtmlUpdater} from '@quilted/react-html';
|
|
5
|
+
import {
|
|
6
|
+
Routing,
|
|
7
|
+
useRoutes,
|
|
8
|
+
type Routes,
|
|
9
|
+
type Router,
|
|
10
|
+
} from '@quilted/react-router';
|
|
11
|
+
import {PerformanceContext, type Performance} from '@quilted/react-performance';
|
|
12
|
+
import {Localization} from '@quilted/react-localize';
|
|
13
|
+
|
|
14
|
+
interface Props {
|
|
15
|
+
/**
|
|
16
|
+
* A React element that adds global HTTP headers to the page. Alternatively, you
|
|
17
|
+
* can pass `false` to disable Quilt’s HTTP-related features.
|
|
18
|
+
*
|
|
19
|
+
* @see https://github.com/lemonmade/quilt/blob/main/documentation/features/http.md
|
|
20
|
+
*/
|
|
21
|
+
http?: boolean | ReactNode;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* A React element that add adjusts the HTML document, like adding global `head`
|
|
25
|
+
* elements to the page or customizing the `html` and `body` elements. Alternatively,
|
|
26
|
+
* you can pass `false` to disable Quilt’s HTML-related features.
|
|
27
|
+
*
|
|
28
|
+
* @see https://github.com/lemonmade/quilt/blob/main/documentation/features/html.md
|
|
29
|
+
*/
|
|
30
|
+
html?: boolean | ReactNode;
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Routes for your application. You can use this prop when you have a static set of routes
|
|
34
|
+
* that do not depend on any React context. If you do need dynamic routes, you will need to
|
|
35
|
+
* remove this prop, and instead use the `useRoutes()` hook from this library in a child
|
|
36
|
+
* component.
|
|
37
|
+
*/
|
|
38
|
+
routes?: Routes;
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Customizes how routing is performed in this application. You can pass a `Router`
|
|
42
|
+
* object, or the props of the `<Routing />` component from Quilt, which will be passed through
|
|
43
|
+
* to that component. Alternatively, you can pass `false` to disable Quilt’s routing features.
|
|
44
|
+
*/
|
|
45
|
+
routing?:
|
|
46
|
+
| boolean
|
|
47
|
+
| Router
|
|
48
|
+
| Pick<
|
|
49
|
+
ComponentProps<typeof Routing>,
|
|
50
|
+
'isExternal' | 'prefix' | 'state' | 'url'
|
|
51
|
+
>;
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Customizes how localization is performed in this application. You can pass a string
|
|
55
|
+
* to set the locale of the app directly, or an object with the props of the `<Localization />`
|
|
56
|
+
* component. Alternatively, you can pass `false` to disable Quilt’s localization features.
|
|
57
|
+
*/
|
|
58
|
+
localization?:
|
|
59
|
+
| boolean
|
|
60
|
+
| string
|
|
61
|
+
| Pick<ComponentProps<typeof Localization>, 'locale'>;
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Customizes how performance tracking works in this application. You can pass a `Performance`
|
|
65
|
+
* object, or `false` to disable Quilt’s performance features.
|
|
66
|
+
*/
|
|
67
|
+
performance?: boolean | Performance;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
// TODO: have craft options to remove the bundle impact of parts of this that are
|
|
71
|
+
// unused.
|
|
72
|
+
export function QuiltApp({
|
|
73
|
+
http = true,
|
|
74
|
+
html = true,
|
|
75
|
+
routes,
|
|
76
|
+
routing = true,
|
|
77
|
+
localization = true,
|
|
78
|
+
children,
|
|
79
|
+
performance = true,
|
|
80
|
+
}: PropsWithChildren<Props>) {
|
|
81
|
+
const routesContent =
|
|
82
|
+
routing !== false && routes ? <StaticRoutes routes={routes} /> : null;
|
|
83
|
+
|
|
84
|
+
const htmlContent =
|
|
85
|
+
typeof html === 'boolean' ? (
|
|
86
|
+
html ? (
|
|
87
|
+
<HtmlUpdater />
|
|
88
|
+
) : null
|
|
89
|
+
) : (
|
|
90
|
+
<>
|
|
91
|
+
<HtmlUpdater />
|
|
92
|
+
{html}
|
|
93
|
+
</>
|
|
94
|
+
);
|
|
95
|
+
|
|
96
|
+
const httpContent = typeof http === 'boolean' ? null : http;
|
|
97
|
+
|
|
98
|
+
const content = (
|
|
99
|
+
<>
|
|
100
|
+
{httpContent}
|
|
101
|
+
{htmlContent}
|
|
102
|
+
{routesContent}
|
|
103
|
+
{children}
|
|
104
|
+
</>
|
|
105
|
+
);
|
|
106
|
+
|
|
107
|
+
const withMaybeRouting =
|
|
108
|
+
typeof routing === 'boolean' ? (
|
|
109
|
+
routing ? (
|
|
110
|
+
<Routing>{content}</Routing>
|
|
111
|
+
) : (
|
|
112
|
+
content
|
|
113
|
+
)
|
|
114
|
+
) : 'navigate' in routing ? (
|
|
115
|
+
<Routing router={routing}>{content}</Routing>
|
|
116
|
+
) : (
|
|
117
|
+
<Routing {...routing}>{content}</Routing>
|
|
118
|
+
);
|
|
119
|
+
|
|
120
|
+
const withMaybePerformance =
|
|
121
|
+
typeof performance === 'boolean' ? (
|
|
122
|
+
performance ? (
|
|
123
|
+
<PerformanceContext>{withMaybeRouting}</PerformanceContext>
|
|
124
|
+
) : (
|
|
125
|
+
withMaybeRouting
|
|
126
|
+
)
|
|
127
|
+
) : (
|
|
128
|
+
<PerformanceContext performance={performance}>
|
|
129
|
+
{withMaybeRouting}
|
|
130
|
+
</PerformanceContext>
|
|
131
|
+
);
|
|
132
|
+
|
|
133
|
+
const withMaybeHttp =
|
|
134
|
+
typeof http === 'boolean' ? (
|
|
135
|
+
http ? (
|
|
136
|
+
<HttpContext>
|
|
137
|
+
<CookieContext>{withMaybePerformance}</CookieContext>
|
|
138
|
+
</HttpContext>
|
|
139
|
+
) : (
|
|
140
|
+
withMaybePerformance
|
|
141
|
+
)
|
|
142
|
+
) : (
|
|
143
|
+
<HttpContext>
|
|
144
|
+
<CookieContext>{withMaybePerformance}</CookieContext>
|
|
145
|
+
</HttpContext>
|
|
146
|
+
);
|
|
147
|
+
|
|
148
|
+
const withMaybeLocalization =
|
|
149
|
+
typeof localization === 'boolean' ? (
|
|
150
|
+
localization ? (
|
|
151
|
+
<Localization locale="en">{withMaybeHttp}</Localization>
|
|
152
|
+
) : (
|
|
153
|
+
withMaybeHttp
|
|
154
|
+
)
|
|
155
|
+
) : typeof localization === 'string' ? (
|
|
156
|
+
<Localization locale={localization}>{withMaybeHttp}</Localization>
|
|
157
|
+
) : (
|
|
158
|
+
<Localization {...localization}>{withMaybeHttp}</Localization>
|
|
159
|
+
);
|
|
160
|
+
|
|
161
|
+
return withMaybeLocalization;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
function HtmlUpdater() {
|
|
165
|
+
useHtmlUpdater();
|
|
166
|
+
return null;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
function StaticRoutes({routes}: {routes: Routes}) {
|
|
170
|
+
return useRoutes(routes);
|
|
171
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import {type PropsWithChildren} from 'react';
|
|
2
|
+
|
|
3
|
+
import {type Router} from '@quilted/react-router';
|
|
4
|
+
|
|
5
|
+
import {QuiltApp} from './App';
|
|
6
|
+
|
|
7
|
+
interface Props {
|
|
8
|
+
/**
|
|
9
|
+
* Customizes how routing is handled during testing. You can provide a test router, or
|
|
10
|
+
* you can pass `false` to disable Quilt’s routing features.
|
|
11
|
+
*/
|
|
12
|
+
routing?: boolean | Router;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Customizes how localization is handled during testing. You can provide a string locale,
|
|
16
|
+
* or you can pass `false` to disable Quilt’s localization features.
|
|
17
|
+
*/
|
|
18
|
+
localization?: boolean | string;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
// TODO: have craft options to remove the bundle impact of parts of this that are
|
|
22
|
+
// unused.
|
|
23
|
+
export function QuiltAppTesting({
|
|
24
|
+
routing = true,
|
|
25
|
+
localization = true,
|
|
26
|
+
children,
|
|
27
|
+
}: PropsWithChildren<Props>) {
|
|
28
|
+
return (
|
|
29
|
+
<QuiltApp routing={routing} localization={localization}>
|
|
30
|
+
{children}
|
|
31
|
+
</QuiltApp>
|
|
32
|
+
);
|
|
33
|
+
}
|
package/source/index.ts
CHANGED
|
@@ -71,7 +71,7 @@ export {
|
|
|
71
71
|
useLocaleFromEnvironment,
|
|
72
72
|
useLocalizedFormatting,
|
|
73
73
|
LocalizedLink,
|
|
74
|
-
|
|
74
|
+
LocalizedRouting,
|
|
75
75
|
useRouteLocalization,
|
|
76
76
|
createRouteLocalization,
|
|
77
77
|
createRoutePathLocalization,
|
|
@@ -87,9 +87,11 @@ export type {
|
|
|
87
87
|
DefaultLocaleDefinition,
|
|
88
88
|
} from '@quilted/react-localize';
|
|
89
89
|
export {
|
|
90
|
+
createPerformance,
|
|
90
91
|
PerformanceContext,
|
|
91
92
|
usePerformance,
|
|
92
93
|
usePerformanceNavigation,
|
|
94
|
+
usePerformanceNavigationEvent,
|
|
93
95
|
} from '@quilted/react-performance';
|
|
94
96
|
export type {
|
|
95
97
|
Performance,
|
|
@@ -99,8 +101,8 @@ export type {
|
|
|
99
101
|
export {
|
|
100
102
|
Link,
|
|
101
103
|
Redirect,
|
|
102
|
-
|
|
103
|
-
|
|
104
|
+
Routing,
|
|
105
|
+
RoutePreloading,
|
|
104
106
|
NavigationBlock,
|
|
105
107
|
useCurrentUrl,
|
|
106
108
|
useInitialUrl,
|
|
@@ -113,7 +115,12 @@ export {
|
|
|
113
115
|
useScrollRestoration,
|
|
114
116
|
useRouteChangeFocusRef,
|
|
115
117
|
} from '@quilted/react-router';
|
|
116
|
-
export type {
|
|
118
|
+
export type {
|
|
119
|
+
Router,
|
|
120
|
+
NavigateTo,
|
|
121
|
+
Routes,
|
|
122
|
+
RouteDefinition,
|
|
123
|
+
} from '@quilted/react-router';
|
|
117
124
|
export {useCookie, useCookies, CookieContext} from '@quilted/react-http';
|
|
118
125
|
export type {PropsWithChildren} from '@quilted/useful-react-types';
|
|
119
126
|
export {
|
|
@@ -138,4 +145,4 @@ export {
|
|
|
138
145
|
type SignalOrValue,
|
|
139
146
|
} from '@quilted/react-signals';
|
|
140
147
|
|
|
141
|
-
export {
|
|
148
|
+
export {QuiltApp} from './App';
|
package/source/server/render.tsx
CHANGED
|
@@ -8,17 +8,24 @@ import {AsyncAssetManager} from '@quilted/react-async/server';
|
|
|
8
8
|
|
|
9
9
|
import {ServerContext} from './ServerContext';
|
|
10
10
|
|
|
11
|
-
interface Options extends ExtractOptions {
|
|
11
|
+
export interface Options extends ExtractOptions {
|
|
12
12
|
url?: string | URL;
|
|
13
13
|
headers?: NonNullable<
|
|
14
14
|
ConstructorParameters<typeof HttpManager>[0]
|
|
15
15
|
>['headers'];
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
+
export interface RenderResult {
|
|
19
|
+
readonly http: HttpManager;
|
|
20
|
+
readonly html: HtmlManager;
|
|
21
|
+
readonly markup: string;
|
|
22
|
+
readonly asyncAssets: AsyncAssetManager;
|
|
23
|
+
}
|
|
24
|
+
|
|
18
25
|
export async function renderApp(
|
|
19
26
|
app: ReactElement<any>,
|
|
20
27
|
{decorate, url, headers, ...rest}: Options = {},
|
|
21
|
-
) {
|
|
28
|
+
): Promise<RenderResult> {
|
|
22
29
|
const html = new HtmlManager();
|
|
23
30
|
const asyncAssets = new AsyncAssetManager();
|
|
24
31
|
const http = new HttpManager({headers});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type {ReactElement} from 'react';
|
|
2
2
|
|
|
3
|
-
import type {AssetManifest} from '@quilted/async/server';
|
|
3
|
+
import type {Asset, AssetManifest} from '@quilted/async/server';
|
|
4
4
|
import {render as renderToString, Html} from '@quilted/react-html/server';
|
|
5
5
|
import type {
|
|
6
6
|
Options as ExtractOptions,
|
|
@@ -15,7 +15,7 @@ import type {
|
|
|
15
15
|
RequestContext,
|
|
16
16
|
} from '@quilted/request-router';
|
|
17
17
|
|
|
18
|
-
import {renderApp} from './render';
|
|
18
|
+
import {renderApp, type RenderResult as RenderAppResult} from './render';
|
|
19
19
|
|
|
20
20
|
export interface Options<Context = RequestContext>
|
|
21
21
|
extends Omit<ExtractOptions, 'context'> {
|
|
@@ -25,6 +25,15 @@ export interface Options<Context = RequestContext>
|
|
|
25
25
|
request: EnhancedRequest,
|
|
26
26
|
context: Context,
|
|
27
27
|
): ServerRenderRequestContext;
|
|
28
|
+
renderHtml?(
|
|
29
|
+
content: string,
|
|
30
|
+
request: Request,
|
|
31
|
+
details: Omit<RenderAppResult, 'asyncAssets' | 'markup'> & {
|
|
32
|
+
readonly styles: readonly Asset[];
|
|
33
|
+
readonly scripts: readonly Asset[];
|
|
34
|
+
readonly preload: readonly Asset[];
|
|
35
|
+
},
|
|
36
|
+
): ReactElement<any> | Promise<ReactElement<any>>;
|
|
28
37
|
}
|
|
29
38
|
|
|
30
39
|
export function createServerRenderingRequestRouter<Context = RequestContext>(
|
|
@@ -58,7 +67,11 @@ export function createServerRenderingRequestHandler<Context = RequestContext>(
|
|
|
58
67
|
export async function renderToResponse(
|
|
59
68
|
app: ReactElement<any>,
|
|
60
69
|
request: Request,
|
|
61
|
-
{
|
|
70
|
+
{
|
|
71
|
+
assets,
|
|
72
|
+
renderHtml = defaultRenderHtml,
|
|
73
|
+
...options
|
|
74
|
+
}: Omit<Options, 'handler' | 'renderProps'> = {},
|
|
62
75
|
) {
|
|
63
76
|
const accepts = request.headers.get('Accept');
|
|
64
77
|
|
|
@@ -95,23 +108,45 @@ export async function renderToResponse(
|
|
|
95
108
|
options: assetOptions,
|
|
96
109
|
}),
|
|
97
110
|
])
|
|
98
|
-
: [];
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
111
|
+
: [[], [], []];
|
|
112
|
+
|
|
113
|
+
const htmlElement = await renderHtml(markup, request, {
|
|
114
|
+
html: htmlManager,
|
|
115
|
+
http,
|
|
116
|
+
styles,
|
|
117
|
+
scripts,
|
|
118
|
+
preload,
|
|
119
|
+
});
|
|
120
|
+
|
|
121
|
+
return html(renderToString(htmlElement), {
|
|
122
|
+
headers,
|
|
123
|
+
status: statusCode,
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
function defaultRenderHtml(
|
|
128
|
+
content: string,
|
|
129
|
+
request: Request,
|
|
130
|
+
{
|
|
131
|
+
html,
|
|
132
|
+
styles,
|
|
133
|
+
scripts,
|
|
134
|
+
preload,
|
|
135
|
+
}: Omit<RenderAppResult, 'asyncAssets' | 'markup'> & {
|
|
136
|
+
readonly styles: readonly Asset[];
|
|
137
|
+
readonly scripts: readonly Asset[];
|
|
138
|
+
readonly preload: readonly Asset[];
|
|
139
|
+
},
|
|
140
|
+
) {
|
|
141
|
+
return (
|
|
142
|
+
<Html
|
|
143
|
+
url={new URL(request.url)}
|
|
144
|
+
manager={html}
|
|
145
|
+
styles={styles}
|
|
146
|
+
scripts={scripts}
|
|
147
|
+
preloadAssets={preload}
|
|
148
|
+
>
|
|
149
|
+
{content}
|
|
150
|
+
</Html>
|
|
116
151
|
);
|
|
117
152
|
}
|
package/source/testing.ts
CHANGED
|
@@ -16,7 +16,7 @@ export type {
|
|
|
16
16
|
PlainObject,
|
|
17
17
|
Predicate,
|
|
18
18
|
} from '@quilted/react-testing';
|
|
19
|
-
export {
|
|
19
|
+
export {TestRouting, createTestRouter} from '@quilted/react-router/testing';
|
|
20
20
|
export {
|
|
21
21
|
TestGraphQL,
|
|
22
22
|
createFiller,
|
|
@@ -29,3 +29,5 @@ export type {
|
|
|
29
29
|
GraphQLMockFunction,
|
|
30
30
|
GraphQLMockObject,
|
|
31
31
|
} from '@quilted/react-graphql/testing';
|
|
32
|
+
|
|
33
|
+
export {QuiltAppTesting} from './TestApp';
|
package/build/cjs/AppContext.cjs
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var reactHttp = require('@quilted/react-http');
|
|
4
|
-
var reactHtml = require('@quilted/react-html');
|
|
5
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
6
|
-
|
|
7
|
-
// TODO: have craft options to remove the bundle impact of parts of this that are
|
|
8
|
-
// unused.
|
|
9
|
-
function AppContext({
|
|
10
|
-
children
|
|
11
|
-
}) {
|
|
12
|
-
reactHtml.useHtmlUpdater();
|
|
13
|
-
return /*#__PURE__*/jsxRuntime.jsx(reactHttp.HttpContext, {
|
|
14
|
-
children: /*#__PURE__*/jsxRuntime.jsx(reactHttp.CookieContext, {
|
|
15
|
-
children: children
|
|
16
|
-
})
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
exports.AppContext = AppContext;
|
package/build/esm/AppContext.mjs
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { HttpContext, CookieContext } from '@quilted/react-http';
|
|
2
|
-
import { useHtmlUpdater } from '@quilted/react-html';
|
|
3
|
-
import { jsx } from 'react/jsx-runtime';
|
|
4
|
-
|
|
5
|
-
// TODO: have craft options to remove the bundle impact of parts of this that are
|
|
6
|
-
// unused.
|
|
7
|
-
function AppContext({
|
|
8
|
-
children
|
|
9
|
-
}) {
|
|
10
|
-
useHtmlUpdater();
|
|
11
|
-
return /*#__PURE__*/jsx(HttpContext, {
|
|
12
|
-
children: /*#__PURE__*/jsx(CookieContext, {
|
|
13
|
-
children: children
|
|
14
|
-
})
|
|
15
|
-
});
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export { AppContext };
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { HttpContext, CookieContext } from '@quilted/react-http';
|
|
2
|
-
import { useHtmlUpdater } from '@quilted/react-html';
|
|
3
|
-
import { jsx } from 'react/jsx-runtime';
|
|
4
|
-
|
|
5
|
-
// TODO: have craft options to remove the bundle impact of parts of this that are
|
|
6
|
-
// unused.
|
|
7
|
-
function AppContext({
|
|
8
|
-
children
|
|
9
|
-
}) {
|
|
10
|
-
useHtmlUpdater();
|
|
11
|
-
return /*#__PURE__*/jsx(HttpContext, {
|
|
12
|
-
children: /*#__PURE__*/jsx(CookieContext, {
|
|
13
|
-
children: children
|
|
14
|
-
})
|
|
15
|
-
});
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export { AppContext };
|
package/source/AppContext.tsx
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import type {PropsWithChildren} from 'react';
|
|
2
|
-
|
|
3
|
-
import {HttpContext, CookieContext} from '@quilted/react-http';
|
|
4
|
-
import {useHtmlUpdater} from '@quilted/react-html';
|
|
5
|
-
import type {Performance} from '@quilted/react-performance';
|
|
6
|
-
|
|
7
|
-
interface Props {
|
|
8
|
-
performance?: Performance;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
// TODO: have craft options to remove the bundle impact of parts of this that are
|
|
12
|
-
// unused.
|
|
13
|
-
export function AppContext({children}: PropsWithChildren<Props>) {
|
|
14
|
-
useHtmlUpdater();
|
|
15
|
-
|
|
16
|
-
return (
|
|
17
|
-
<HttpContext>
|
|
18
|
-
<CookieContext>{children}</CookieContext>
|
|
19
|
-
</HttpContext>
|
|
20
|
-
);
|
|
21
|
-
}
|