@quilted/quilt 0.5.108 → 0.5.109

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 (81) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/build/tsconfig.tsbuildinfo +1 -1
  3. package/build/typescript/magic/http-handler.d.ts +2 -2
  4. package/build/typescript/magic/http-handler.d.ts.map +1 -1
  5. package/package.json +1 -1
  6. package/source/magic/http-handler.ts +2 -2
  7. package/build/cjs/AppContext.cjs +0 -22
  8. package/build/cjs/email.cjs +0 -32
  9. package/build/cjs/env.cjs +0 -7
  10. package/build/cjs/global.cjs +0 -5
  11. package/build/cjs/html.cjs +0 -112
  12. package/build/cjs/http-handlers/index.cjs +0 -14
  13. package/build/cjs/http-handlers/node.cjs +0 -14
  14. package/build/cjs/http.cjs +0 -108
  15. package/build/cjs/index.cjs +0 -216
  16. package/build/cjs/matchers.cjs +0 -5
  17. package/build/cjs/polyfills/abort-controller.cjs +0 -4
  18. package/build/cjs/polyfills/base.cjs +0 -4
  19. package/build/cjs/polyfills/crypto.cjs +0 -4
  20. package/build/cjs/polyfills/fetch.cjs +0 -4
  21. package/build/cjs/polyfills/noop.cjs +0 -4
  22. package/build/cjs/server/ServerContext.cjs +0 -22
  23. package/build/cjs/server/http-handler.cjs +0 -90
  24. package/build/cjs/server/index.cjs +0 -119
  25. package/build/cjs/server/render.cjs +0 -46
  26. package/build/cjs/static/StaticContext.cjs +0 -22
  27. package/build/cjs/static/index.cjs +0 -307
  28. package/build/cjs/static/render.cjs +0 -46
  29. package/build/cjs/testing.cjs +0 -61
  30. package/build/cjs/threads.cjs +0 -74
  31. package/build/cjs/utilities/react.cjs +0 -14
  32. package/build/esm/AppContext.mjs +0 -18
  33. package/build/esm/email.mjs +0 -1
  34. package/build/esm/env.mjs +0 -3
  35. package/build/esm/global.mjs +0 -3
  36. package/build/esm/html.mjs +0 -1
  37. package/build/esm/http-handlers/index.mjs +0 -1
  38. package/build/esm/http-handlers/node.mjs +0 -1
  39. package/build/esm/http.mjs +0 -1
  40. package/build/esm/index.mjs +0 -12
  41. package/build/esm/matchers.mjs +0 -2
  42. package/build/esm/polyfills/abort-controller.mjs +0 -1
  43. package/build/esm/polyfills/base.mjs +0 -1
  44. package/build/esm/polyfills/crypto.mjs +0 -1
  45. package/build/esm/polyfills/fetch.mjs +0 -1
  46. package/build/esm/polyfills/noop.mjs +0 -1
  47. package/build/esm/server/ServerContext.mjs +0 -18
  48. package/build/esm/server/http-handler.mjs +0 -84
  49. package/build/esm/server/index.mjs +0 -11
  50. package/build/esm/server/render.mjs +0 -42
  51. package/build/esm/static/StaticContext.mjs +0 -18
  52. package/build/esm/static/index.mjs +0 -285
  53. package/build/esm/static/render.mjs +0 -42
  54. package/build/esm/testing.mjs +0 -4
  55. package/build/esm/threads.mjs +0 -3
  56. package/build/esm/utilities/react.mjs +0 -10
  57. package/build/esnext/AppContext.esnext +0 -18
  58. package/build/esnext/email.esnext +0 -1
  59. package/build/esnext/env.esnext +0 -3
  60. package/build/esnext/global.esnext +0 -3
  61. package/build/esnext/html.esnext +0 -1
  62. package/build/esnext/http-handlers/index.esnext +0 -1
  63. package/build/esnext/http-handlers/node.esnext +0 -1
  64. package/build/esnext/http.esnext +0 -1
  65. package/build/esnext/index.esnext +0 -12
  66. package/build/esnext/matchers.esnext +0 -2
  67. package/build/esnext/polyfills/abort-controller.esnext +0 -1
  68. package/build/esnext/polyfills/base.esnext +0 -1
  69. package/build/esnext/polyfills/crypto.esnext +0 -1
  70. package/build/esnext/polyfills/fetch.esnext +0 -1
  71. package/build/esnext/polyfills/noop.esnext +0 -1
  72. package/build/esnext/server/ServerContext.esnext +0 -18
  73. package/build/esnext/server/http-handler.esnext +0 -82
  74. package/build/esnext/server/index.esnext +0 -11
  75. package/build/esnext/server/render.esnext +0 -40
  76. package/build/esnext/static/StaticContext.esnext +0 -18
  77. package/build/esnext/static/index.esnext +0 -281
  78. package/build/esnext/static/render.esnext +0 -40
  79. package/build/esnext/testing.esnext +0 -4
  80. package/build/esnext/threads.esnext +0 -3
  81. package/build/esnext/utilities/react.esnext +0 -10
@@ -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 +0,0 @@
1
- export { usePlainTextContent, useSendBcc, useSendCc, useSendTo, useSender, useSubject } from '@quilted/react-email';
package/build/esm/env.mjs DELETED
@@ -1,3 +0,0 @@
1
- const Env = {};
2
-
3
- export { Env as default };
@@ -1,3 +0,0 @@
1
- import { installAsyncAssetsGlobal } from '@quilted/async';
2
-
3
- installAsyncAssetsGlobal();
@@ -1 +0,0 @@
1
- export { Alternate, BodyAttributes, Favicon, HtmlAttributes, Hydrator, Link, Meta, SearchRobots, Serialize, ThemeColor, Title, Viewport, getSerialized, useAlternateUrl, useBodyAttributes, useFavicon, useHtmlAttributes, useHtmlUpdater, useLink, useLocale, useMeta, useSearchRobots, useSerialized, useThemeColor, useTitle, useViewport } from '@quilted/react-html';
@@ -1 +0,0 @@
1
- export * from '@quilted/http-handlers';
@@ -1 +0,0 @@
1
- export * from '@quilted/http-handlers/node';
@@ -1 +0,0 @@
1
- export { CacheControl, ContentSecurityPolicy, ContentSecurityPolicyDirective, ContentSecurityPolicySandboxAllow, ContentSecurityPolicySpecialSource, HttpContext, HttpMethod, NotFound, PermissionsPolicy, ResponseCookie, ResponseHeader, ResponseStatus, ResponseType, StatusCode, StrictTransportSecurity, useCacheControl, useContentSecurityPolicy, useDeleteResponseCookie, usePermissionsPolicy, useRequestHeader, useResponseCookie, useResponseHeader, useResponseRedirect, useResponseStatus, useStrictTransportSecurity } from '@quilted/react-http';
@@ -1,12 +0,0 @@
1
- export { createAsyncLoader } from '@quilted/async';
2
- export { AbortError, NestedAbortController, createEmitter, on, once } from '@quilted/events';
3
- export { createAsyncComponent, useAsync, useAsyncAsset, usePreload } from '@quilted/react-async';
4
- export { GraphQLContext, createGraphQLHttpFetch, useGraphQLFetch } from '@quilted/react-graphql';
5
- export { useIdleCallback } from '@quilted/react-idle';
6
- export { ServerAction, useServerAction, useServerContext } from '@quilted/react-server-render';
7
- export { Localization, LocalizedLink, LocalizedRouter, createRouteLocalization, createRoutePathLocalization, createRouteSubdomainLocalization, useLocale, useLocaleFromEnvironment, useLocalizedFormatting, useRouteLocalization } from '@quilted/react-localize';
8
- export { PerformanceContext, usePerformance, usePerformanceNavigation } from '@quilted/react-performance';
9
- export { Link, NavigationBlock, Preloader, Redirect, Router, useCurrentUrl, useInitialUrl, useMatch, useNavigate, useNavigationBlock, useRedirect, useRouteChangeFocusRef, useRouter, useRoutes, useScrollRestoration } from '@quilted/react-router';
10
- export { CookieContext, useCookie, useCookies } from '@quilted/react-http';
11
- export { createUseContextHook } from '@quilted/react-utilities';
12
- export { AppContext } from './AppContext.mjs';
@@ -1,2 +0,0 @@
1
- import '@quilted/react-testing/matchers';
2
- import '@quilted/graphql/matchers';
@@ -1 +0,0 @@
1
- import '@quilted/polyfills/abort-controller';
@@ -1 +0,0 @@
1
- import '@quilted/polyfills/base';
@@ -1 +0,0 @@
1
- import '@quilted/polyfills/crypto';
@@ -1 +0,0 @@
1
- import '@quilted/polyfills/fetch';
@@ -1 +0,0 @@
1
- import '@quilted/polyfills/noop';
@@ -1,18 +0,0 @@
1
- import { InitialUrlContext } from '@quilted/react-router';
2
- import { HtmlContext } from '@quilted/react-html/server';
3
- import { AsyncAssetContext } from '@quilted/react-async/server';
4
- import { HttpServerContext } from '@quilted/react-http/server';
5
- import { maybeWrapContext } from '../utilities/react.mjs';
6
-
7
- function ServerContext({
8
- url,
9
- html,
10
- http,
11
- asyncAssets,
12
- children
13
- }) {
14
- const normalizedUrl = typeof url === 'string' ? new URL(url) : url;
15
- return maybeWrapContext(AsyncAssetContext, asyncAssets, maybeWrapContext(HttpServerContext, http, maybeWrapContext(HtmlContext, html, maybeWrapContext(InitialUrlContext, normalizedUrl, children))));
16
- }
17
-
18
- export { ServerContext };
@@ -1,84 +0,0 @@
1
- import { render, Html } from '@quilted/react-html/server';
2
- import { createHttpHandler, redirect, html } from '@quilted/http-handlers';
3
- import { renderApp } from './render.mjs';
4
- import { jsx } from 'react/jsx-runtime';
5
-
6
- function createServerRenderingHttpHandler(render, {
7
- handler = createHttpHandler(),
8
- ...options
9
- }) {
10
- handler.get(createServerRenderingRequestHandler(render, options));
11
- return handler;
12
- }
13
- function createServerRenderingRequestHandler(render, {
14
- context,
15
- ...options
16
- } = {}) {
17
- return async (request, requestContext) => {
18
- var _context;
19
-
20
- const app = await render(request, requestContext);
21
- return renderToResponse(app, request, { ...options,
22
- context: (_context = context === null || context === void 0 ? void 0 : context(request, requestContext)) !== null && _context !== void 0 ? _context : requestContext
23
- });
24
- };
25
- }
26
- async function renderToResponse(app, request, {
27
- assets,
28
- ...options
29
- } = {}) {
30
- const accepts = request.headers.get('Accept');
31
- if (accepts != null && !accepts.includes('text/html')) return;
32
- const {
33
- html: htmlManager,
34
- http,
35
- markup,
36
- asyncAssets
37
- } = await renderApp(app, { ...options,
38
- url: request.url,
39
- headers: request.headers
40
- });
41
- const {
42
- headers,
43
- statusCode = 200,
44
- redirectUrl
45
- } = http.state;
46
-
47
- if (redirectUrl) {
48
- return redirect(redirectUrl, {
49
- status: statusCode,
50
- headers
51
- });
52
- }
53
-
54
- const usedAssets = asyncAssets.used({
55
- timing: 'load'
56
- });
57
- const assetOptions = {
58
- userAgent: request.headers.get('User-Agent')
59
- };
60
- const [styles, scripts, preload] = assets ? await Promise.all([assets.styles({
61
- async: usedAssets,
62
- options: assetOptions
63
- }), assets.scripts({
64
- async: usedAssets,
65
- options: assetOptions
66
- }), assets.asyncAssets(asyncAssets.used({
67
- timing: 'preload'
68
- }), {
69
- options: assetOptions
70
- })]) : [];
71
- return html(render( /*#__PURE__*/jsx(Html, {
72
- url: new URL(request.url),
73
- manager: htmlManager,
74
- styles: styles,
75
- scripts: scripts,
76
- preloadAssets: preload,
77
- children: markup
78
- })), {
79
- headers,
80
- status: statusCode
81
- });
82
- }
83
-
84
- export { createServerRenderingHttpHandler, createServerRenderingRequestHandler, renderToResponse };
@@ -1,11 +0,0 @@
1
- export { SERVER_ACTION_ID as HTML_SERVER_ACTION_ID, Html, HtmlContext, HtmlManager, Serialize, render } from '@quilted/react-html/server';
2
- export { ServerAction, ServerRenderManager, ServerRenderManagerContext, extract, useServerAction } from '@quilted/react-server-render/server';
3
- export { createAssetManifest } from '@quilted/async/server';
4
- export { SERVER_ACTION_ID as ASYNC_ASSETS_SERVER_ACTION_ID, AsyncAssetContext, AsyncAssetManager } from '@quilted/react-async/server';
5
- export { renderEmail } from '@quilted/react-email/server';
6
- export { createHttpHandlerLocalization } from '@quilted/react-localize/http-handlers';
7
- export { EnhancedRequest, EnhancedResponse, Request, Response, createHeaders, createHttpHandler } from '@quilted/http-handlers';
8
- export { parseAcceptLanguageHeader } from '@quilted/react-localize';
9
- export { renderApp } from './render.mjs';
10
- export { ServerContext } from './ServerContext.mjs';
11
- export { createServerRenderingHttpHandler, createServerRenderingRequestHandler, renderToResponse } from './http-handler.mjs';
@@ -1,42 +0,0 @@
1
- import { extract } from '@quilted/react-server-render/server';
2
- import { HtmlManager } from '@quilted/react-html/server';
3
- import { HttpManager } from '@quilted/react-http/server';
4
- import { AsyncAssetManager } from '@quilted/react-async/server';
5
- import { ServerContext } from './ServerContext.mjs';
6
- import { jsx } from 'react/jsx-runtime';
7
-
8
- async function renderApp(app, {
9
- decorate,
10
- url,
11
- headers,
12
- ...rest
13
- } = {}) {
14
- const html = new HtmlManager();
15
- const asyncAssets = new AsyncAssetManager();
16
- const http = new HttpManager({
17
- headers
18
- });
19
- const markup = await extract(app, {
20
- decorate(app) {
21
- var _decorate;
22
-
23
- return /*#__PURE__*/jsx(ServerContext, {
24
- asyncAssets: asyncAssets,
25
- http: http,
26
- html: html,
27
- url: url,
28
- children: (_decorate = decorate === null || decorate === void 0 ? void 0 : decorate(app)) !== null && _decorate !== void 0 ? _decorate : app
29
- });
30
- },
31
-
32
- ...rest
33
- });
34
- return {
35
- markup,
36
- http,
37
- html,
38
- asyncAssets
39
- };
40
- }
41
-
42
- export { renderApp };
@@ -1,18 +0,0 @@
1
- import { InitialUrlContext } from '@quilted/react-router';
2
- import { HtmlContext } from '@quilted/react-html/server';
3
- import { AsyncAssetContext } from '@quilted/react-async/server';
4
- import { HttpServerContext } from '@quilted/react-http/server';
5
- import { maybeWrapContext } from '../utilities/react.mjs';
6
-
7
- function StaticContext({
8
- url,
9
- html,
10
- http,
11
- asyncAssets,
12
- children
13
- }) {
14
- const normalizedUrl = typeof url === 'string' ? new URL(url) : url;
15
- return maybeWrapContext(AsyncAssetContext, asyncAssets, maybeWrapContext(HttpServerContext, http, maybeWrapContext(HtmlContext, html, maybeWrapContext(InitialUrlContext, normalizedUrl, children))));
16
- }
17
-
18
- export { StaticContext };
@@ -1,285 +0,0 @@
1
- import { render, Html } from '@quilted/react-html/server';
2
- import { StaticRenderer, StaticRendererContext } from '@quilted/react-router/static';
3
- import { renderApp } from './render.mjs';
4
- import { jsx } from 'react/jsx-runtime';
5
-
6
- const BASE_URL = 'http://localhost:3000';
7
- async function renderStatic(App, {
8
- assets,
9
- routes: startingRoutes,
10
- onRender,
11
- crawl = true,
12
- baseUrl = BASE_URL,
13
- prettify = true
14
- }) {
15
- const routesToHandle = startingRoutes.map(route => ({
16
- route: removePostfixSlash(new URL(route, baseUrl).pathname),
17
- fallback: false
18
- }));
19
- const seenRoutes = [...routesToHandle];
20
- const seenRouteIds = new Set(seenRoutes.map(({
21
- route
22
- }) => route));
23
- let renderableRoute;
24
-
25
- while (renderableRoute = routesToHandle.shift()) {
26
- const {
27
- route,
28
- fallback
29
- } = renderableRoute;
30
- const url = new URL(route, baseUrl);
31
- const {
32
- html,
33
- http,
34
- routes
35
- } = await renderUrl(url, {
36
- fallback
37
- });
38
-
39
- if (crawl) {
40
- for (const {
41
- routes: routeDefinitions,
42
- fallback = false,
43
- consumedPath,
44
- prefix
45
- } of routes) {
46
- var _routeDefinitions;
47
-
48
- const basePathname = joinPath(prefix, consumedPath);
49
- const baseId = basePathname === '/' ? basePathname : `__QUILT_BASE_${basePathname}__`;
50
-
51
- for (const routeDefinition of routeDefinitions) {
52
- await recordRouteDefinition(routeDefinition, {
53
- baseId,
54
- basePathname,
55
- addFallbacks: fallback
56
- });
57
- }
58
-
59
- if (fallback && ((_routeDefinitions = routeDefinitions[routeDefinitions.length - 1]) === null || _routeDefinitions === void 0 ? void 0 : _routeDefinitions.match) != null) {
60
- await recordRouteDefinition({}, {
61
- baseId,
62
- basePathname,
63
- addFallbacks: fallback
64
- });
65
- }
66
- }
67
- }
68
-
69
- await onRender({
70
- route,
71
- content: html,
72
- http,
73
- fallback,
74
- hasChildren: !fallback && seenRoutes.some(otherRoute => otherRoute.route.startsWith(`${route}/`))
75
- });
76
- }
77
-
78
- async function recordRouteDefinition({
79
- match,
80
- children,
81
- renderStatic
82
- }, {
83
- basePathname,
84
- baseId,
85
- addFallbacks
86
- }) {
87
- if (renderStatic === false) return;
88
- let routeId;
89
- const hasChildren = children && children.length > 0;
90
- const hasManualMatches = typeof renderStatic === 'function' && typeof match !== 'string';
91
- const matchedRoutes = [];
92
-
93
- if (typeof match === 'string') {
94
- routeId = joinPath(baseId, match);
95
- matchedRoutes.push({
96
- id: routeId,
97
- route: joinPath(basePathname, match),
98
- fallback: false
99
- });
100
- } else if (typeof match === 'function') {
101
- routeId = joinPath(baseId, `__QUILT_FUNCTION_ROUTE_${match.toString()}__`);
102
- } else if (match instanceof RegExp) {
103
- routeId = joinPath(`__QUILT_REGEX_ROUTE_${match.source}__`);
104
- } else {
105
- routeId = joinPath(baseId, '__QUILT_FALLBACK_ROUTE__');
106
-
107
- if (!hasManualMatches) {
108
- matchedRoutes.push({
109
- id: routeId,
110
- route: basePathname,
111
- fallback: true
112
- });
113
- }
114
- }
115
-
116
- if (seenRouteIds.has(routeId)) return;
117
- seenRouteIds.add(routeId);
118
-
119
- if (typeof renderStatic === 'function' && typeof match !== 'string') {
120
- const matchedRouteParts = await renderStatic();
121
-
122
- for (const routePart of matchedRouteParts) {
123
- const id = joinPath(baseId, `__QUILT_MATCH_${routePart}__`);
124
- seenRouteIds.add(id);
125
- matchedRoutes.push({
126
- id,
127
- route: joinPath(basePathname, routePart),
128
- fallback: false
129
- });
130
- }
131
- }
132
-
133
- if (hasChildren) {
134
- for (const {
135
- id,
136
- route
137
- } of matchedRoutes) {
138
- var _ref;
139
-
140
- for (const child of children) {
141
- await recordRouteDefinition(child, {
142
- addFallbacks,
143
- basePathname: route,
144
- baseId: id
145
- });
146
- }
147
-
148
- if (addFallbacks && ((_ref = children[children.length - 1]) === null || _ref === void 0 ? void 0 : _ref.match) != null) {
149
- await recordRouteDefinition({}, {
150
- addFallbacks,
151
- basePathname: route,
152
- baseId: id
153
- });
154
- }
155
- }
156
-
157
- return;
158
- }
159
-
160
- for (const {
161
- route,
162
- fallback
163
- } of matchedRoutes) {
164
- const renderableRoute = {
165
- route,
166
- fallback
167
- };
168
- seenRoutes.push(renderableRoute);
169
- routesToHandle.push(renderableRoute);
170
- }
171
- }
172
-
173
- async function renderUrl(url, {
174
- fallback = false
175
- }) {
176
- const routeRecorder = new StaticRenderer({
177
- forceFallback: fallback ? url.pathname : undefined
178
- });
179
- const {
180
- http,
181
- html: htmlManager,
182
- markup,
183
- asyncAssets
184
- } = await renderApp( /*#__PURE__*/jsx(App, {}), {
185
- url,
186
-
187
- decorate(app) {
188
- return /*#__PURE__*/jsx(StaticRendererContext.Provider, {
189
- value: routeRecorder,
190
- children: app
191
- });
192
- }
193
-
194
- });
195
- const usedAssets = asyncAssets.used({
196
- timing: 'load'
197
- });
198
- const [moduleStyles, moduleScripts, modulePreload, nomoduleStyles, nomoduleScripts] = await Promise.all([assets.styles({
199
- async: usedAssets,
200
- options: {
201
- modules: true
202
- }
203
- }), assets.scripts({
204
- async: usedAssets,
205
- options: {
206
- modules: true
207
- }
208
- }), assets.asyncAssets(asyncAssets.used({
209
- timing: 'preload'
210
- }), {
211
- options: {
212
- modules: true
213
- }
214
- }), assets.styles({
215
- async: usedAssets,
216
- options: {
217
- modules: false
218
- }
219
- }), assets.scripts({
220
- async: usedAssets,
221
- options: {
222
- modules: false
223
- }
224
- })]); // We don’t want to load styles from both bundles, so we only use module styles,
225
- // since modules are intended to be the default and CSS (usually) doesn’t
226
- // have features that meaningfully break older user agents.
227
-
228
- const styles = moduleStyles.length > 0 ? moduleStyles : nomoduleStyles; // If there are nomodule scripts, we can’t really do preloading, because we can’t
229
- // prevent the nomodule scripts from being preloaded in module browsers. If there
230
- // are only module scripts, we can preload those.
231
-
232
- const preload = nomoduleScripts.length > 0 ? [] : modulePreload;
233
- const scripts = [...moduleScripts, ...nomoduleScripts.map(script => ({ ...script,
234
- nomodule: true
235
- }))];
236
- const minifiedHtml = render( /*#__PURE__*/jsx(Html, {
237
- url: url,
238
- manager: htmlManager,
239
- styles: styles,
240
- scripts: scripts,
241
- preloadAssets: preload,
242
- children: markup
243
- }));
244
- const html = prettify ? await prettifyHtml(minifiedHtml) : minifiedHtml;
245
- return {
246
- html,
247
- http: http.state,
248
- routes: routeRecorder.state
249
- };
250
- }
251
- }
252
-
253
- async function prettifyHtml(html) {
254
- try {
255
- const {
256
- default: prettier
257
- } = await import('prettier');
258
- return prettier.format(html, {
259
- parser: 'html'
260
- });
261
- } catch (error) {
262
- return html;
263
- }
264
- }
265
-
266
- function joinPath(...parts) {
267
- let path = '/';
268
-
269
- for (const part of parts) {
270
- if (typeof part !== 'string') continue;
271
- const normalizedPart = part.startsWith('/') ? part.slice(1) : part;
272
- if (normalizedPart.length === 0) continue;
273
- if (path !== '/') path += '/';
274
- path += normalizedPart;
275
- path = removePostfixSlash(path);
276
- }
277
-
278
- return path;
279
- }
280
-
281
- function removePostfixSlash(value) {
282
- return value.endsWith('/') && value !== '/' ? value.slice(0, value.length - 1) : value;
283
- }
284
-
285
- export { renderStatic };
@@ -1,42 +0,0 @@
1
- import { extract } from '@quilted/react-server-render/server';
2
- import { HtmlManager } from '@quilted/react-html/server';
3
- import { HttpManager } from '@quilted/react-http/server';
4
- import { AsyncAssetManager } from '@quilted/react-async/server';
5
- import { StaticContext } from './StaticContext.mjs';
6
- import { jsx } from 'react/jsx-runtime';
7
-
8
- async function renderApp(app, {
9
- decorate,
10
- url,
11
- headers,
12
- ...rest
13
- }) {
14
- const html = new HtmlManager();
15
- const asyncAssets = new AsyncAssetManager();
16
- const http = new HttpManager({
17
- headers
18
- });
19
- const markup = await extract(app, {
20
- decorate(app) {
21
- var _decorate;
22
-
23
- return /*#__PURE__*/jsx(StaticContext, {
24
- asyncAssets: asyncAssets,
25
- html: html,
26
- http: http,
27
- url: url,
28
- children: (_decorate = decorate === null || decorate === void 0 ? void 0 : decorate(app)) !== null && _decorate !== void 0 ? _decorate : app
29
- });
30
- },
31
-
32
- ...rest
33
- });
34
- return {
35
- markup,
36
- http,
37
- html,
38
- asyncAssets
39
- };
40
- }
41
-
42
- export { renderApp };
@@ -1,4 +0,0 @@
1
- export * from '@quilted/testing';
2
- export { createMount, mount, mounted, unmountAll } from '@quilted/react-testing';
3
- export { TestRouter, createTestRouter } from '@quilted/react-router/testing';
4
- export { GraphQLController, TestGraphQL, createFiller, createGraphQLController, createSchema } from '@quilted/react-graphql/testing';
@@ -1,3 +0,0 @@
1
- export { acceptThreadAbortSignal, createThread, createThreadAbortSignal, release, retain, targetFromBrowserWebSocket, targetFromMessagePort, targetFromWebWorker } from '@quilted/threads';
2
- export { AbortError, NestedAbortController, createEmitter, on, once } from '@quilted/events';
3
- export { createThreadWorker, createWorker, useThreadWorker } from '@quilted/react-workers';
@@ -1,10 +0,0 @@
1
- import { jsx } from 'react/jsx-runtime';
2
-
3
- function maybeWrapContext(Context, value, children) {
4
- return value ? /*#__PURE__*/jsx(Context.Provider, {
5
- value: value,
6
- children: children
7
- }) : children;
8
- }
9
-
10
- export { maybeWrapContext };
@@ -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 +0,0 @@
1
- export { usePlainTextContent, useSendBcc, useSendCc, useSendTo, useSender, useSubject } from '@quilted/react-email';
@@ -1,3 +0,0 @@
1
- const Env = {};
2
-
3
- export { Env as default };
@@ -1,3 +0,0 @@
1
- import { installAsyncAssetsGlobal } from '@quilted/async';
2
-
3
- installAsyncAssetsGlobal();
@@ -1 +0,0 @@
1
- export { Alternate, BodyAttributes, Favicon, HtmlAttributes, Hydrator, Link, Meta, SearchRobots, Serialize, ThemeColor, Title, Viewport, getSerialized, useAlternateUrl, useBodyAttributes, useFavicon, useHtmlAttributes, useHtmlUpdater, useLink, useLocale, useMeta, useSearchRobots, useSerialized, useThemeColor, useTitle, useViewport } from '@quilted/react-html';
@@ -1 +0,0 @@
1
- export * from '@quilted/http-handlers';
@@ -1 +0,0 @@
1
- export * from '@quilted/http-handlers/node';
@@ -1 +0,0 @@
1
- export { CacheControl, ContentSecurityPolicy, ContentSecurityPolicyDirective, ContentSecurityPolicySandboxAllow, ContentSecurityPolicySpecialSource, HttpContext, HttpMethod, NotFound, PermissionsPolicy, ResponseCookie, ResponseHeader, ResponseStatus, ResponseType, StatusCode, StrictTransportSecurity, useCacheControl, useContentSecurityPolicy, useDeleteResponseCookie, usePermissionsPolicy, useRequestHeader, useResponseCookie, useResponseHeader, useResponseRedirect, useResponseStatus, useStrictTransportSecurity } from '@quilted/react-http';
@@ -1,12 +0,0 @@
1
- export { createAsyncLoader } from '@quilted/async';
2
- export { AbortError, NestedAbortController, createEmitter, on, once } from '@quilted/events';
3
- export { createAsyncComponent, useAsync, useAsyncAsset, usePreload } from '@quilted/react-async';
4
- export { GraphQLContext, createGraphQLHttpFetch, useGraphQLFetch } from '@quilted/react-graphql';
5
- export { useIdleCallback } from '@quilted/react-idle';
6
- export { ServerAction, useServerAction, useServerContext } from '@quilted/react-server-render';
7
- export { Localization, LocalizedLink, LocalizedRouter, createRouteLocalization, createRoutePathLocalization, createRouteSubdomainLocalization, useLocale, useLocaleFromEnvironment, useLocalizedFormatting, useRouteLocalization } from '@quilted/react-localize';
8
- export { PerformanceContext, usePerformance, usePerformanceNavigation } from '@quilted/react-performance';
9
- export { Link, NavigationBlock, Preloader, Redirect, Router, useCurrentUrl, useInitialUrl, useMatch, useNavigate, useNavigationBlock, useRedirect, useRouteChangeFocusRef, useRouter, useRoutes, useScrollRestoration } from '@quilted/react-router';
10
- export { CookieContext, useCookie, useCookies } from '@quilted/react-http';
11
- export { createUseContextHook } from '@quilted/react-utilities';
12
- export { AppContext } from './AppContext.esnext';