@quilted/quilt 0.5.152 → 0.5.154

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 (191) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/build/cjs/assets.cjs +39 -0
  3. package/build/cjs/async.cjs +32 -0
  4. package/build/cjs/events.cjs +46 -0
  5. package/build/cjs/graphql/testing.cjs +6 -9
  6. package/build/cjs/graphql.cjs +8 -0
  7. package/build/cjs/html/HTML.cjs +21 -0
  8. package/build/cjs/html.cjs +23 -12
  9. package/build/cjs/http.cjs +16 -0
  10. package/build/cjs/index.cjs +0 -319
  11. package/build/cjs/localize.cjs +46 -0
  12. package/build/cjs/navigate/testing.cjs +12 -0
  13. package/build/cjs/navigate.cjs +70 -0
  14. package/build/cjs/performance.cjs +26 -0
  15. package/build/cjs/polyfills/fetch-get-set-cookie.cjs +4 -0
  16. package/build/cjs/react/testing.cjs +30 -0
  17. package/build/cjs/react/tools.cjs +19 -0
  18. package/build/cjs/react.cjs +15 -0
  19. package/build/cjs/server/ServerContext.cjs +1 -1
  20. package/build/cjs/server/preload.cjs +1 -1
  21. package/build/cjs/server/request-router.cjs +215 -231
  22. package/build/cjs/{server/index.cjs → server.cjs} +26 -52
  23. package/build/cjs/signals.cjs +51 -0
  24. package/build/cjs/static/StaticContext.cjs +1 -1
  25. package/build/cjs/static/index.cjs +43 -51
  26. package/build/cjs/static/render.cjs +1 -1
  27. package/build/cjs/testing.cjs +6 -34
  28. package/build/esm/assets.mjs +2 -0
  29. package/build/esm/async.mjs +3 -0
  30. package/build/esm/events.mjs +1 -0
  31. package/build/esm/graphql/testing.mjs +2 -1
  32. package/build/esm/graphql.mjs +1 -1
  33. package/build/esm/html/HTML.mjs +19 -0
  34. package/build/esm/html.mjs +3 -1
  35. package/build/esm/http.mjs +1 -1
  36. package/build/esm/index.mjs +1 -15
  37. package/build/esm/localize.mjs +1 -0
  38. package/build/esm/navigate/testing.mjs +1 -0
  39. package/build/esm/navigate.mjs +1 -0
  40. package/build/esm/performance.mjs +1 -0
  41. package/build/esm/polyfills/fetch-get-set-cookie.mjs +1 -0
  42. package/build/esm/react/testing.mjs +3 -0
  43. package/build/esm/react/tools.mjs +2 -0
  44. package/build/esm/react.mjs +2 -0
  45. package/build/esm/server/ServerContext.mjs +2 -2
  46. package/build/esm/server/preload.mjs +2 -2
  47. package/build/esm/server/request-router.mjs +218 -232
  48. package/build/esm/server.mjs +10 -0
  49. package/build/esm/signals.mjs +2 -0
  50. package/build/esm/static/StaticContext.mjs +2 -2
  51. package/build/esm/static/index.mjs +40 -48
  52. package/build/esm/static/render.mjs +2 -2
  53. package/build/esm/testing.mjs +0 -3
  54. package/build/esnext/assets.esnext +2 -0
  55. package/build/esnext/async.esnext +3 -0
  56. package/build/esnext/events.esnext +1 -0
  57. package/build/esnext/graphql/testing.esnext +2 -1
  58. package/build/esnext/graphql.esnext +1 -1
  59. package/build/esnext/html/HTML.esnext +19 -0
  60. package/build/esnext/html.esnext +3 -1
  61. package/build/esnext/http.esnext +1 -1
  62. package/build/esnext/index.esnext +1 -15
  63. package/build/esnext/localize.esnext +1 -0
  64. package/build/esnext/navigate/testing.esnext +1 -0
  65. package/build/esnext/navigate.esnext +1 -0
  66. package/build/esnext/performance.esnext +1 -0
  67. package/build/esnext/polyfills/fetch-get-set-cookie.esnext +1 -0
  68. package/build/esnext/react/testing.esnext +3 -0
  69. package/build/esnext/react/tools.esnext +2 -0
  70. package/build/esnext/react.esnext +2 -0
  71. package/build/esnext/server/ServerContext.esnext +2 -2
  72. package/build/esnext/server/preload.esnext +2 -2
  73. package/build/esnext/server/request-router.esnext +218 -232
  74. package/build/esnext/server.esnext +10 -0
  75. package/build/esnext/signals.esnext +2 -0
  76. package/build/esnext/static/StaticContext.esnext +2 -2
  77. package/build/esnext/static/index.esnext +40 -48
  78. package/build/esnext/static/render.esnext +2 -2
  79. package/build/esnext/testing.esnext +0 -3
  80. package/build/tsconfig.tsbuildinfo +1 -1
  81. package/build/typescript/assets.d.ts +3 -1
  82. package/build/typescript/assets.d.ts.map +1 -1
  83. package/build/typescript/async.d.ts +6 -0
  84. package/build/typescript/async.d.ts.map +1 -0
  85. package/build/typescript/events.d.ts +3 -0
  86. package/build/typescript/events.d.ts.map +1 -0
  87. package/build/typescript/globals.d.ts +8 -0
  88. package/build/typescript/globals.d.ts.map +1 -0
  89. package/build/typescript/graphql/testing/matchers/operations.d.ts +7 -0
  90. package/build/typescript/graphql/testing/matchers/operations.d.ts.map +1 -0
  91. package/build/typescript/graphql/testing/matchers/utilities.d.ts +8 -0
  92. package/build/typescript/graphql/testing/matchers/utilities.d.ts.map +1 -0
  93. package/build/typescript/graphql/testing/matchers.d.ts +11 -0
  94. package/build/typescript/graphql/testing/matchers.d.ts.map +1 -0
  95. package/build/typescript/graphql/testing.d.ts +4 -2
  96. package/build/typescript/graphql/testing.d.ts.map +1 -1
  97. package/build/typescript/graphql.d.ts +1 -1
  98. package/build/typescript/graphql.d.ts.map +1 -1
  99. package/build/typescript/html/HTML.d.ts +5 -0
  100. package/build/typescript/html/HTML.d.ts.map +1 -0
  101. package/build/typescript/html.d.ts +3 -1
  102. package/build/typescript/html.d.ts.map +1 -1
  103. package/build/typescript/http.d.ts +1 -1
  104. package/build/typescript/http.d.ts.map +1 -1
  105. package/build/typescript/index.d.ts +1 -24
  106. package/build/typescript/index.d.ts.map +1 -1
  107. package/build/typescript/localize.d.ts +3 -0
  108. package/build/typescript/localize.d.ts.map +1 -0
  109. package/build/typescript/magic/assets.d.ts +4 -2
  110. package/build/typescript/magic/assets.d.ts.map +1 -1
  111. package/build/typescript/navigate/testing.d.ts +2 -0
  112. package/build/typescript/navigate/testing.d.ts.map +1 -0
  113. package/build/typescript/navigate.d.ts +3 -0
  114. package/build/typescript/navigate.d.ts.map +1 -0
  115. package/build/typescript/performance.d.ts +3 -0
  116. package/build/typescript/performance.d.ts.map +1 -0
  117. package/build/typescript/polyfills/fetch-get-set-cookie.d.ts +2 -0
  118. package/build/typescript/polyfills/fetch-get-set-cookie.d.ts.map +1 -0
  119. package/build/typescript/react/testing.d.ts +5 -0
  120. package/build/typescript/react/testing.d.ts.map +1 -0
  121. package/build/typescript/react/tools.d.ts +3 -0
  122. package/build/typescript/react/tools.d.ts.map +1 -0
  123. package/build/typescript/react-dom.d.ts +3 -0
  124. package/build/typescript/react-dom.d.ts.map +1 -0
  125. package/build/typescript/react.d.ts +3 -0
  126. package/build/typescript/react.d.ts.map +1 -0
  127. package/build/typescript/routing.d.ts +3 -0
  128. package/build/typescript/routing.d.ts.map +1 -0
  129. package/build/typescript/server/ServerContext.d.ts +2 -2
  130. package/build/typescript/server/request-router.d.ts +13 -37
  131. package/build/typescript/server/request-router.d.ts.map +1 -1
  132. package/build/typescript/server.d.ts +14 -0
  133. package/build/typescript/server.d.ts.map +1 -0
  134. package/build/typescript/signals.d.ts +3 -0
  135. package/build/typescript/signals.d.ts.map +1 -0
  136. package/build/typescript/static/StaticContext.d.ts +2 -2
  137. package/build/typescript/static/index.d.ts.map +1 -1
  138. package/build/typescript/static/render.d.ts +2 -2
  139. package/build/typescript/testing.d.ts +0 -4
  140. package/build/typescript/testing.d.ts.map +1 -1
  141. package/package.json +159 -55
  142. package/source/assets.ts +20 -2
  143. package/source/async.ts +17 -0
  144. package/source/events.ts +20 -0
  145. package/source/graphql/testing.ts +6 -4
  146. package/source/graphql.ts +2 -0
  147. package/source/html/HTML.tsx +22 -0
  148. package/source/html.ts +11 -3
  149. package/source/http.ts +4 -0
  150. package/source/index.ts +1 -149
  151. package/source/localize.ts +21 -0
  152. package/source/magic/assets.ts +7 -4
  153. package/source/navigate/testing.ts +1 -0
  154. package/source/navigate.ts +24 -0
  155. package/source/performance.ts +12 -0
  156. package/source/polyfills/fetch-get-set-cookie.ts +1 -0
  157. package/source/react/testing.ts +30 -0
  158. package/source/react/tools.ts +2 -0
  159. package/source/routing.ts +24 -0
  160. package/source/server/ServerContext.tsx +3 -3
  161. package/source/server/preload.ts +2 -2
  162. package/source/server/request-router.tsx +281 -403
  163. package/source/{server/index.ts → server.ts} +20 -46
  164. package/source/signals.ts +12 -0
  165. package/source/static/StaticContext.tsx +3 -3
  166. package/source/static/index.tsx +40 -56
  167. package/source/static/render.tsx +2 -2
  168. package/source/testing.ts +0 -29
  169. package/build/cjs/App.cjs +0 -72
  170. package/build/cjs/TestApp.cjs +0 -20
  171. package/build/cjs/matchers.cjs +0 -4
  172. package/build/esm/App.mjs +0 -70
  173. package/build/esm/TestApp.mjs +0 -18
  174. package/build/esm/matchers.mjs +0 -1
  175. package/build/esm/server/index.mjs +0 -10
  176. package/build/esnext/App.esnext +0 -70
  177. package/build/esnext/TestApp.esnext +0 -18
  178. package/build/esnext/matchers.esnext +0 -1
  179. package/build/esnext/server/index.esnext +0 -10
  180. package/source/App.tsx +0 -162
  181. package/source/TestApp.tsx +0 -33
  182. package/source/matchers/graphql/operations.ts +0 -117
  183. package/source/matchers/graphql/utilities.ts +0 -68
  184. package/source/matchers/graphql.ts +0 -24
  185. package/source/matchers.ts +0 -3
  186. /package/build/cjs/{global.cjs → globals.cjs} +0 -0
  187. /package/build/esm/{global.mjs → globals.mjs} +0 -0
  188. /package/build/esnext/{global.esnext → globals.esnext} +0 -0
  189. /package/source/{global.ts → globals.ts} +0 -0
  190. /package/source/{react-dom/index.ts → react-dom.ts} +0 -0
  191. /package/source/{react/index.ts → react.ts} +0 -0
@@ -1,17 +1,14 @@
1
1
  export {
2
- Html,
2
+ Head,
3
3
  Serialize,
4
- HtmlManager,
5
- HtmlContext,
6
- renderHtmlToString,
4
+ HTMLManager,
5
+ HTMLContext,
7
6
  SERVER_ACTION_ID as HTML_SERVER_ACTION_ID,
8
7
  } from '@quilted/react-html/server';
9
8
  export {
10
- ServerAction,
11
- useServerAction,
9
+ extract,
12
10
  ServerRenderManager,
13
11
  ServerRenderManagerContext,
14
- extract,
15
12
  } from '@quilted/react-server-render/server';
16
13
 
17
14
  export {
@@ -19,7 +16,7 @@ export {
19
16
  styleAssetPreloadAttributes,
20
17
  scriptAssetAttributes,
21
18
  scriptAssetPreloadAttributes,
22
- createBrowserAssetsFromManifests,
19
+ BrowserAssetsFromManifests,
23
20
  createBrowserAssetsEntryFromManifest,
24
21
  } from '@quilted/assets';
25
22
  export type {
@@ -39,48 +36,25 @@ export {
39
36
  AssetsManager,
40
37
  SERVER_ACTION_ID as ASSETS_SERVER_ACTION_ID,
41
38
  } from '@quilted/react-assets/server';
39
+ export type {HttpState} from '@quilted/react-http/server';
40
+ export {parseAcceptLanguageHeader} from '@quilted/react-localize';
41
+ export {createRequestRouterLocalization} from '@quilted/react-localize/request-router';
42
+ export {
43
+ ServerAction,
44
+ useServerAction,
45
+ useServerContext,
46
+ } from '@quilted/react-server-render';
42
47
  export type {
43
48
  ServerActionKind,
44
49
  ServerActionOptions,
45
50
  ServerActionPerform,
46
51
  ServerRenderPass,
47
- } from '@quilted/react-server-render/server';
48
- export type {HttpState} from '@quilted/react-http/server';
49
- export {createRequestRouterLocalization} from '@quilted/react-localize/request-router';
50
- export type {
51
- RequestRouterLocalization,
52
- RouteLocalization,
53
- ResolvedRouteLocalization,
54
- } from '@quilted/react-localize/request-router';
55
- export {
56
- Request,
57
- Response,
58
- EnhancedRequest,
59
- EnhancedResponse,
60
- createRequestRouter,
61
- createHeaders,
62
- } from '@quilted/request-router';
63
- export type {
64
- Headers,
65
- BodyInit,
66
- ResponseInit,
67
- RequestInit,
68
- Cookies,
69
- CookieOptions,
70
- RequestRouter,
71
- RequestContext,
72
- RequestHandler,
73
- ResponseOrEnhancedResponse,
74
- CookieDefinition,
75
- RequestRegistration,
76
- RequestRegistrationOptions,
77
- } from '@quilted/request-router';
78
- export {parseAcceptLanguageHeader} from '@quilted/react-localize';
52
+ ServerRenderRequestContext,
53
+ } from '@quilted/react-server-render';
79
54
 
80
- export {ServerContext} from './ServerContext.tsx';
55
+ export {ServerContext} from './server/ServerContext.tsx';
56
+ export {renderToResponse} from './server/request-router.tsx';
81
57
  export {
82
- createServerRender,
83
- renderAppToResponse,
84
- renderAppToStreamedResponse,
85
- } from './request-router.tsx';
86
- export {createAssetPreloader, type AssetPreloadOptions} from './preload.ts';
58
+ createAssetPreloader,
59
+ type AssetPreloadOptions,
60
+ } from './server/preload.ts';
@@ -0,0 +1,12 @@
1
+ export {
2
+ signal,
3
+ Signal,
4
+ batch,
5
+ computed,
6
+ effect,
7
+ isSignal,
8
+ resolveSignalOrValue,
9
+ signalToIterator,
10
+ type SignalOrValue,
11
+ } from '@quilted/signals';
12
+ export {useSignal, useComputed, useSignalEffect} from '@quilted/react-signals';
@@ -2,14 +2,14 @@ import type {PropsWithChildren} from 'react';
2
2
 
3
3
  import {AssetsContext, type AssetsManager} from '@quilted/react-assets/server';
4
4
  import {InitialUrlContext} from '@quilted/react-router';
5
- import {HtmlContext, type HtmlManager} from '@quilted/react-html/server';
5
+ import {HTMLContext, type HTMLManager} from '@quilted/react-html/server';
6
6
  import {HttpServerContext, type HttpManager} from '@quilted/react-http/server';
7
7
 
8
8
  import {maybeWrapContext} from '../utilities/react.tsx';
9
9
 
10
10
  interface Props {
11
11
  url?: string | URL;
12
- html?: HtmlManager;
12
+ html?: HTMLManager;
13
13
  http?: HttpManager;
14
14
  assets?: AssetsManager;
15
15
  }
@@ -30,7 +30,7 @@ export function StaticContext({
30
30
  HttpServerContext,
31
31
  http,
32
32
  maybeWrapContext(
33
- HtmlContext,
33
+ HTMLContext,
34
34
  html,
35
35
  maybeWrapContext(InitialUrlContext, normalizedUrl, children),
36
36
  ),
@@ -1,13 +1,14 @@
1
- import {Fragment, type ComponentType} from 'react';
1
+ import {type ComponentType} from 'react';
2
+ import {renderToStaticMarkup} from 'react-dom/server';
2
3
 
4
+ import {type BrowserAssets} from '@quilted/assets';
3
5
  import {
4
- styleAssetAttributes,
5
- styleAssetPreloadAttributes,
6
- scriptAssetAttributes,
7
- scriptAssetPreloadAttributes,
8
- type BrowserAssets,
9
- } from '@quilted/assets';
10
- import {renderHtmlToString, Html} from '@quilted/react-html/server';
6
+ Head,
7
+ Script,
8
+ ScriptPreload,
9
+ Style,
10
+ StylePreload,
11
+ } from '@quilted/react-html/server';
11
12
  import type {RouteDefinition} from '@quilted/react-router';
12
13
  import {
13
14
  StaticRenderer,
@@ -243,54 +244,37 @@ export async function renderStatic(
243
244
  }),
244
245
  ]);
245
246
 
246
- const minifiedHtml = renderHtmlToString(
247
- <Html
248
- manager={htmlManager}
249
- headEndContent={
250
- <>
251
- {[...mainAssets.styles].map((style) => {
252
- const attributes = styleAssetAttributes(style, {baseUrl: url});
253
- return <link key={style.source} {...(attributes as any)} />;
254
- })}
255
-
256
- {[...mainAssets.scripts].map((script) => {
257
- const attributes = scriptAssetAttributes(script, {
258
- baseUrl: url,
259
- });
260
-
261
- return attributes.type === 'module' ? (
262
- <Fragment key={script.source}>
263
- <link {...(scriptAssetPreloadAttributes(script) as any)} />
264
- <script {...(attributes as any)} async />
265
- </Fragment>
266
- ) : (
267
- <script key={script.source} {...(attributes as any)} defer />
268
- );
269
- })}
270
-
271
- {[...preloadAssets.styles].map((style) => {
272
- const attributes = styleAssetPreloadAttributes(style, {
273
- baseUrl: url,
274
- });
275
-
276
- return <link key={style.source} {...(attributes as any)} />;
277
- })}
278
-
279
- {[...preloadAssets.scripts].map((script) => {
280
- const attributes = scriptAssetPreloadAttributes(script, {
281
- baseUrl: url,
282
- });
283
-
284
- return <link key={script.source} {...(attributes as any)} />;
285
- })}
286
- </>
287
- }
288
- >
289
- {markup}
290
- </Html>,
291
- );
247
+ const {htmlAttributes, bodyAttributes, ...headProps} = htmlManager.state;
248
+ const minifiedHTML =
249
+ '<!DOCTYPE html>' +
250
+ renderToStaticMarkup(
251
+ // eslint-disable-next-line jsx-a11y/html-has-lang
252
+ <html {...htmlAttributes}>
253
+ <head>
254
+ <Head {...headProps} />
255
+ {mainAssets?.scripts.map((script) => (
256
+ <Script key={script.source} asset={script} baseUrl={url} />
257
+ ))}
258
+ {mainAssets?.styles.map((style) => (
259
+ <Style key={style.source} asset={style} baseUrl={url} />
260
+ ))}
261
+ {preloadAssets?.styles.map((style) => (
262
+ <StylePreload key={style.source} asset={style} baseUrl={url} />
263
+ ))}
264
+ {preloadAssets?.scripts.map((script) => (
265
+ <ScriptPreload key={script.source} asset={script} baseUrl={url} />
266
+ ))}
267
+ </head>
268
+ <body {...bodyAttributes}>
269
+ <div
270
+ id="app"
271
+ dangerouslySetInnerHTML={{__html: markup ?? ''}}
272
+ ></div>
273
+ </body>
274
+ </html>,
275
+ );
292
276
 
293
- const html = prettify ? await prettifyHtml(minifiedHtml) : minifiedHtml;
277
+ const html = prettify ? await prettifyHTML(minifiedHTML) : minifiedHTML;
294
278
 
295
279
  return {
296
280
  html,
@@ -300,7 +284,7 @@ export async function renderStatic(
300
284
  }
301
285
  }
302
286
 
303
- async function prettifyHtml(html: string) {
287
+ async function prettifyHTML(html: string) {
304
288
  try {
305
289
  const {default: prettier} = await import('prettier');
306
290
  return prettier.format(html, {parser: 'html'});
@@ -2,7 +2,7 @@ import type {ReactElement} from 'react';
2
2
 
3
3
  import {extract} from '@quilted/react-server-render/server';
4
4
  import type {Options as ExtractOptions} from '@quilted/react-server-render/server';
5
- import {HtmlManager} from '@quilted/react-html/server';
5
+ import {HTMLManager} from '@quilted/react-html/server';
6
6
  import {HttpManager} from '@quilted/react-http/server';
7
7
  import {AssetsManager} from '@quilted/react-assets/server';
8
8
  import type {AssetsCacheKey} from '@quilted/assets';
@@ -21,7 +21,7 @@ export async function renderApp<CacheKey = AssetsCacheKey>(
21
21
  app: ReactElement<any>,
22
22
  {decorate, url, headers, cacheKey, ...rest}: Options<CacheKey> = {},
23
23
  ) {
24
- const html = new HtmlManager();
24
+ const html = new HTMLManager();
25
25
  const http = new HttpManager({headers});
26
26
  const assets = new AssetsManager<CacheKey>({cacheKey});
27
27
 
package/source/testing.ts CHANGED
@@ -1,30 +1 @@
1
1
  export * from '@quilted/testing';
2
- export {
3
- render,
4
- createRender,
5
- rendered,
6
- destroyAll,
7
- } from '@quilted/react-testing';
8
- export type {
9
- CustomRender,
10
- CustomRenderResult,
11
- CustomRenderOptions,
12
- CustomRenderExtendOptions,
13
- HookRunner,
14
- Environment,
15
- EnvironmentOptions,
16
- ContextOption,
17
- RenderOption,
18
- ActionsOption,
19
- Node,
20
- NodeApi,
21
- Root,
22
- RootApi,
23
- DebugOptions,
24
- EmptyObject,
25
- PlainObject,
26
- Predicate,
27
- } from '@quilted/react-testing';
28
- export {TestRouting, createTestRouter} from '@quilted/react-router/testing';
29
-
30
- export {QuiltAppTesting} from './TestApp.tsx';
package/build/cjs/App.cjs DELETED
@@ -1,72 +0,0 @@
1
- 'use strict';
2
-
3
- var reactHttp = require('@quilted/react-http');
4
- var reactHtml = require('@quilted/react-html');
5
- var reactRouter = require('@quilted/react-router');
6
- var reactPerformance = require('@quilted/react-performance');
7
- var reactLocalize = require('@quilted/react-localize');
8
- var jsxRuntime = require('react/jsx-runtime');
9
-
10
- // TODO: have craft options to remove the bundle impact of parts of this that are
11
- // unused.
12
- function QuiltApp({
13
- http = true,
14
- html = true,
15
- routes,
16
- routing = true,
17
- localization = true,
18
- children,
19
- performance = true
20
- }) {
21
- const htmlContent = typeof html === 'boolean' ? html ? /*#__PURE__*/jsxRuntime.jsx(HtmlUpdater, {}) : null : /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
22
- children: [/*#__PURE__*/jsxRuntime.jsx(HtmlUpdater, {}), html]
23
- });
24
- const httpContent = typeof http === 'boolean' ? null : http;
25
- const content = /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
26
- children: [httpContent, htmlContent, children]
27
- });
28
- const withMaybeRouting = typeof routing === 'boolean' ? routing ? /*#__PURE__*/jsxRuntime.jsx(reactRouter.Routing, {
29
- routes: routes,
30
- children: content
31
- }) : content : 'navigate' in routing ? /*#__PURE__*/jsxRuntime.jsx(reactRouter.Routing, {
32
- routes: routes,
33
- router: routing,
34
- children: content
35
- }) : /*#__PURE__*/jsxRuntime.jsx(reactRouter.Routing, {
36
- routes: routes,
37
- ...routing,
38
- children: content
39
- });
40
- const withMaybePerformance = typeof performance === 'boolean' ? performance ? /*#__PURE__*/jsxRuntime.jsx(reactPerformance.PerformanceContext, {
41
- children: withMaybeRouting
42
- }) : withMaybeRouting : /*#__PURE__*/jsxRuntime.jsx(reactPerformance.PerformanceContext, {
43
- performance: performance,
44
- children: withMaybeRouting
45
- });
46
- const withMaybeHttp = typeof http === 'boolean' ? http ? /*#__PURE__*/jsxRuntime.jsx(reactHttp.HttpContext, {
47
- children: /*#__PURE__*/jsxRuntime.jsx(reactHttp.CookieContext, {
48
- children: withMaybePerformance
49
- })
50
- }) : withMaybePerformance : /*#__PURE__*/jsxRuntime.jsx(reactHttp.HttpContext, {
51
- children: /*#__PURE__*/jsxRuntime.jsx(reactHttp.CookieContext, {
52
- children: withMaybePerformance
53
- })
54
- });
55
- const withMaybeLocalization = typeof localization === 'boolean' ? localization ? /*#__PURE__*/jsxRuntime.jsx(reactLocalize.Localization, {
56
- locale: "en",
57
- children: withMaybeHttp
58
- }) : withMaybeHttp : typeof localization === 'string' ? /*#__PURE__*/jsxRuntime.jsx(reactLocalize.Localization, {
59
- locale: localization,
60
- children: withMaybeHttp
61
- }) : /*#__PURE__*/jsxRuntime.jsx(reactLocalize.Localization, {
62
- ...localization,
63
- children: withMaybeHttp
64
- });
65
- return withMaybeLocalization;
66
- }
67
- function HtmlUpdater() {
68
- reactHtml.useHtmlUpdater();
69
- return null;
70
- }
71
-
72
- exports.QuiltApp = QuiltApp;
@@ -1,20 +0,0 @@
1
- 'use strict';
2
-
3
- var App = require('./App.cjs');
4
- var jsxRuntime = require('react/jsx-runtime');
5
-
6
- // TODO: have craft options to remove the bundle impact of parts of this that are
7
- // unused.
8
- function QuiltAppTesting({
9
- routing = true,
10
- localization = true,
11
- children
12
- }) {
13
- return /*#__PURE__*/jsxRuntime.jsx(App.QuiltApp, {
14
- routing: routing,
15
- localization: localization,
16
- children: children
17
- });
18
- }
19
-
20
- exports.QuiltAppTesting = QuiltAppTesting;
@@ -1,4 +0,0 @@
1
- 'use strict';
2
-
3
- require('@quilted/react-testing/matchers');
4
-
package/build/esm/App.mjs DELETED
@@ -1,70 +0,0 @@
1
- import { HttpContext, CookieContext } from '@quilted/react-http';
2
- import { useHtmlUpdater } from '@quilted/react-html';
3
- import { Routing } from '@quilted/react-router';
4
- import { PerformanceContext } from '@quilted/react-performance';
5
- import { Localization } from '@quilted/react-localize';
6
- import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
7
-
8
- // TODO: have craft options to remove the bundle impact of parts of this that are
9
- // unused.
10
- function QuiltApp({
11
- http = true,
12
- html = true,
13
- routes,
14
- routing = true,
15
- localization = true,
16
- children,
17
- performance = true
18
- }) {
19
- const htmlContent = typeof html === 'boolean' ? html ? /*#__PURE__*/jsx(HtmlUpdater, {}) : null : /*#__PURE__*/jsxs(Fragment, {
20
- children: [/*#__PURE__*/jsx(HtmlUpdater, {}), html]
21
- });
22
- const httpContent = typeof http === 'boolean' ? null : http;
23
- const content = /*#__PURE__*/jsxs(Fragment, {
24
- children: [httpContent, htmlContent, children]
25
- });
26
- const withMaybeRouting = typeof routing === 'boolean' ? routing ? /*#__PURE__*/jsx(Routing, {
27
- routes: routes,
28
- children: content
29
- }) : content : 'navigate' in routing ? /*#__PURE__*/jsx(Routing, {
30
- routes: routes,
31
- router: routing,
32
- children: content
33
- }) : /*#__PURE__*/jsx(Routing, {
34
- routes: routes,
35
- ...routing,
36
- children: content
37
- });
38
- const withMaybePerformance = typeof performance === 'boolean' ? performance ? /*#__PURE__*/jsx(PerformanceContext, {
39
- children: withMaybeRouting
40
- }) : withMaybeRouting : /*#__PURE__*/jsx(PerformanceContext, {
41
- performance: performance,
42
- children: withMaybeRouting
43
- });
44
- const withMaybeHttp = typeof http === 'boolean' ? http ? /*#__PURE__*/jsx(HttpContext, {
45
- children: /*#__PURE__*/jsx(CookieContext, {
46
- children: withMaybePerformance
47
- })
48
- }) : withMaybePerformance : /*#__PURE__*/jsx(HttpContext, {
49
- children: /*#__PURE__*/jsx(CookieContext, {
50
- children: withMaybePerformance
51
- })
52
- });
53
- const withMaybeLocalization = typeof localization === 'boolean' ? localization ? /*#__PURE__*/jsx(Localization, {
54
- locale: "en",
55
- children: withMaybeHttp
56
- }) : withMaybeHttp : typeof localization === 'string' ? /*#__PURE__*/jsx(Localization, {
57
- locale: localization,
58
- children: withMaybeHttp
59
- }) : /*#__PURE__*/jsx(Localization, {
60
- ...localization,
61
- children: withMaybeHttp
62
- });
63
- return withMaybeLocalization;
64
- }
65
- function HtmlUpdater() {
66
- useHtmlUpdater();
67
- return null;
68
- }
69
-
70
- export { QuiltApp };
@@ -1,18 +0,0 @@
1
- import { QuiltApp } from './App.mjs';
2
- import { jsx } from 'react/jsx-runtime';
3
-
4
- // TODO: have craft options to remove the bundle impact of parts of this that are
5
- // unused.
6
- function QuiltAppTesting({
7
- routing = true,
8
- localization = true,
9
- children
10
- }) {
11
- return /*#__PURE__*/jsx(QuiltApp, {
12
- routing: routing,
13
- localization: localization,
14
- children: children
15
- });
16
- }
17
-
18
- export { QuiltAppTesting };
@@ -1 +0,0 @@
1
- import '@quilted/react-testing/matchers';
@@ -1,10 +0,0 @@
1
- export { SERVER_ACTION_ID as HTML_SERVER_ACTION_ID, Html, HtmlContext, HtmlManager, Serialize, renderHtmlToString } from '@quilted/react-html/server';
2
- export { ServerAction, ServerRenderManager, ServerRenderManagerContext, extract, useServerAction } from '@quilted/react-server-render/server';
3
- export { createBrowserAssetsEntryFromManifest, createBrowserAssetsFromManifests, scriptAssetAttributes, scriptAssetPreloadAttributes, styleAssetAttributes, styleAssetPreloadAttributes } from '@quilted/assets';
4
- export { SERVER_ACTION_ID as ASSETS_SERVER_ACTION_ID, AssetsContext, AssetsManager, useAssetsCacheKey, useModuleAssets } from '@quilted/react-assets/server';
5
- export { createRequestRouterLocalization } from '@quilted/react-localize/request-router';
6
- export { EnhancedRequest, EnhancedResponse, Request, Response, createHeaders, createRequestRouter } from '@quilted/request-router';
7
- export { parseAcceptLanguageHeader } from '@quilted/react-localize';
8
- export { ServerContext } from './ServerContext.mjs';
9
- export { createServerRender, renderAppToResponse, renderAppToStreamedResponse } from './request-router.mjs';
10
- export { createAssetPreloader } from './preload.mjs';
@@ -1,70 +0,0 @@
1
- import { HttpContext, CookieContext } from '@quilted/react-http';
2
- import { useHtmlUpdater } from '@quilted/react-html';
3
- import { Routing } from '@quilted/react-router';
4
- import { PerformanceContext } from '@quilted/react-performance';
5
- import { Localization } from '@quilted/react-localize';
6
- import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
7
-
8
- // TODO: have craft options to remove the bundle impact of parts of this that are
9
- // unused.
10
- function QuiltApp({
11
- http = true,
12
- html = true,
13
- routes,
14
- routing = true,
15
- localization = true,
16
- children,
17
- performance = true
18
- }) {
19
- const htmlContent = typeof html === 'boolean' ? html ? /*#__PURE__*/jsx(HtmlUpdater, {}) : null : /*#__PURE__*/jsxs(Fragment, {
20
- children: [/*#__PURE__*/jsx(HtmlUpdater, {}), html]
21
- });
22
- const httpContent = typeof http === 'boolean' ? null : http;
23
- const content = /*#__PURE__*/jsxs(Fragment, {
24
- children: [httpContent, htmlContent, children]
25
- });
26
- const withMaybeRouting = typeof routing === 'boolean' ? routing ? /*#__PURE__*/jsx(Routing, {
27
- routes: routes,
28
- children: content
29
- }) : content : 'navigate' in routing ? /*#__PURE__*/jsx(Routing, {
30
- routes: routes,
31
- router: routing,
32
- children: content
33
- }) : /*#__PURE__*/jsx(Routing, {
34
- routes: routes,
35
- ...routing,
36
- children: content
37
- });
38
- const withMaybePerformance = typeof performance === 'boolean' ? performance ? /*#__PURE__*/jsx(PerformanceContext, {
39
- children: withMaybeRouting
40
- }) : withMaybeRouting : /*#__PURE__*/jsx(PerformanceContext, {
41
- performance: performance,
42
- children: withMaybeRouting
43
- });
44
- const withMaybeHttp = typeof http === 'boolean' ? http ? /*#__PURE__*/jsx(HttpContext, {
45
- children: /*#__PURE__*/jsx(CookieContext, {
46
- children: withMaybePerformance
47
- })
48
- }) : withMaybePerformance : /*#__PURE__*/jsx(HttpContext, {
49
- children: /*#__PURE__*/jsx(CookieContext, {
50
- children: withMaybePerformance
51
- })
52
- });
53
- const withMaybeLocalization = typeof localization === 'boolean' ? localization ? /*#__PURE__*/jsx(Localization, {
54
- locale: "en",
55
- children: withMaybeHttp
56
- }) : withMaybeHttp : typeof localization === 'string' ? /*#__PURE__*/jsx(Localization, {
57
- locale: localization,
58
- children: withMaybeHttp
59
- }) : /*#__PURE__*/jsx(Localization, {
60
- ...localization,
61
- children: withMaybeHttp
62
- });
63
- return withMaybeLocalization;
64
- }
65
- function HtmlUpdater() {
66
- useHtmlUpdater();
67
- return null;
68
- }
69
-
70
- export { QuiltApp };
@@ -1,18 +0,0 @@
1
- import { QuiltApp } from './App.esnext';
2
- import { jsx } from 'react/jsx-runtime';
3
-
4
- // TODO: have craft options to remove the bundle impact of parts of this that are
5
- // unused.
6
- function QuiltAppTesting({
7
- routing = true,
8
- localization = true,
9
- children
10
- }) {
11
- return /*#__PURE__*/jsx(QuiltApp, {
12
- routing: routing,
13
- localization: localization,
14
- children: children
15
- });
16
- }
17
-
18
- export { QuiltAppTesting };
@@ -1 +0,0 @@
1
- import '@quilted/react-testing/matchers';
@@ -1,10 +0,0 @@
1
- export { SERVER_ACTION_ID as HTML_SERVER_ACTION_ID, Html, HtmlContext, HtmlManager, Serialize, renderHtmlToString } from '@quilted/react-html/server';
2
- export { ServerAction, ServerRenderManager, ServerRenderManagerContext, extract, useServerAction } from '@quilted/react-server-render/server';
3
- export { createBrowserAssetsEntryFromManifest, createBrowserAssetsFromManifests, scriptAssetAttributes, scriptAssetPreloadAttributes, styleAssetAttributes, styleAssetPreloadAttributes } from '@quilted/assets';
4
- export { SERVER_ACTION_ID as ASSETS_SERVER_ACTION_ID, AssetsContext, AssetsManager, useAssetsCacheKey, useModuleAssets } from '@quilted/react-assets/server';
5
- export { createRequestRouterLocalization } from '@quilted/react-localize/request-router';
6
- export { EnhancedRequest, EnhancedResponse, Request, Response, createHeaders, createRequestRouter } from '@quilted/request-router';
7
- export { parseAcceptLanguageHeader } from '@quilted/react-localize';
8
- export { ServerContext } from './ServerContext.esnext';
9
- export { createServerRender, renderAppToResponse, renderAppToStreamedResponse } from './request-router.esnext';
10
- export { createAssetPreloader } from './preload.esnext';