@quilted/quilt 0.5.157 → 0.6.0

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 (171) hide show
  1. package/CHANGELOG.md +42 -0
  2. package/build/esm/graphql/testing/matchers/operations.mjs +1 -1
  3. package/build/esm/graphql/testing/matchers/utilities.mjs +1 -1
  4. package/build/esm/graphql/testing/matchers.mjs +4 -3
  5. package/build/esm/graphql/testing.mjs +5 -1
  6. package/build/esm/react/testing.mjs +5 -2
  7. package/build/esnext/globals.esnext +1 -1
  8. package/build/esnext/graphql/testing/matchers/operations.esnext +49 -19
  9. package/build/esnext/graphql/testing/matchers/utilities.esnext +18 -15
  10. package/build/esnext/graphql/testing/matchers.esnext +4 -3
  11. package/build/esnext/graphql/testing.esnext +4 -1
  12. package/build/esnext/html/HTML.esnext +6 -9
  13. package/build/esnext/react/testing.esnext +4 -2
  14. package/build/esnext/server/ServerContext.esnext +14 -2
  15. package/build/esnext/server/preload.esnext +9 -10
  16. package/build/esnext/server/request-router.esnext +138 -141
  17. package/build/esnext/utilities/react.esnext +1 -4
  18. package/build/tsconfig.tsbuildinfo +1 -1
  19. package/build/typescript/globals.d.ts +1 -0
  20. package/build/typescript/globals.d.ts.map +1 -1
  21. package/build/typescript/graphql/testing/matchers/utilities.d.ts +1 -1
  22. package/build/typescript/graphql/testing/matchers/utilities.d.ts.map +1 -1
  23. package/build/typescript/graphql/testing/matchers.d.ts +10 -8
  24. package/build/typescript/graphql/testing/matchers.d.ts.map +1 -1
  25. package/build/typescript/graphql/testing.d.ts +7 -1
  26. package/build/typescript/graphql/testing.d.ts.map +1 -1
  27. package/build/typescript/modules.d.ts +23 -0
  28. package/build/typescript/modules.d.ts.map +1 -0
  29. package/build/typescript/react/testing.d.ts +7 -2
  30. package/build/typescript/react/testing.d.ts.map +1 -1
  31. package/configuration/rollup.config.js +3 -0
  32. package/package.json +66 -197
  33. package/source/globals.ts +2 -0
  34. package/source/graphql/testing/matchers/operations.ts +1 -1
  35. package/source/graphql/testing/matchers/utilities.ts +1 -1
  36. package/source/graphql/testing/matchers.ts +15 -22
  37. package/source/graphql/testing.ts +11 -1
  38. package/source/modules.ts +31 -0
  39. package/source/react/testing.ts +10 -3
  40. package/tsconfig.json +1 -3
  41. package/build/cjs/assets.cjs +0 -39
  42. package/build/cjs/async.cjs +0 -32
  43. package/build/cjs/env.cjs +0 -7
  44. package/build/cjs/events.cjs +0 -46
  45. package/build/cjs/globals.cjs +0 -21
  46. package/build/cjs/graphql/server.cjs +0 -14
  47. package/build/cjs/graphql/testing/matchers/operations.cjs +0 -42
  48. package/build/cjs/graphql/testing/matchers/utilities.cjs +0 -43
  49. package/build/cjs/graphql/testing/matchers.cjs +0 -10
  50. package/build/cjs/graphql/testing.cjs +0 -18
  51. package/build/cjs/graphql.cjs +0 -21
  52. package/build/cjs/html/HTML.cjs +0 -21
  53. package/build/cjs/html.cjs +0 -133
  54. package/build/cjs/http.cjs +0 -146
  55. package/build/cjs/index.cjs +0 -2
  56. package/build/cjs/localize.cjs +0 -46
  57. package/build/cjs/magic/app.cjs +0 -2
  58. package/build/cjs/magic/assets.cjs +0 -2
  59. package/build/cjs/magic/request-router.cjs +0 -2
  60. package/build/cjs/navigate/testing.cjs +0 -12
  61. package/build/cjs/navigate.cjs +0 -70
  62. package/build/cjs/performance.cjs +0 -26
  63. package/build/cjs/polyfills/abort-controller.cjs +0 -4
  64. package/build/cjs/polyfills/base.cjs +0 -4
  65. package/build/cjs/polyfills/crypto.cjs +0 -4
  66. package/build/cjs/polyfills/fetch-get-set-cookie.cjs +0 -4
  67. package/build/cjs/polyfills/fetch.cjs +0 -4
  68. package/build/cjs/polyfills/noop.cjs +0 -4
  69. package/build/cjs/react/testing.cjs +0 -30
  70. package/build/cjs/react/tools.cjs +0 -19
  71. package/build/cjs/react.cjs +0 -15
  72. package/build/cjs/request-router/index.cjs +0 -12
  73. package/build/cjs/request-router/node.cjs +0 -12
  74. package/build/cjs/server/ServerContext.cjs +0 -20
  75. package/build/cjs/server/preload.cjs +0 -37
  76. package/build/cjs/server/request-router.cjs +0 -266
  77. package/build/cjs/server.cjs +0 -114
  78. package/build/cjs/signals.cjs +0 -51
  79. package/build/cjs/static/StaticContext.cjs +0 -20
  80. package/build/cjs/static/index.cjs +0 -261
  81. package/build/cjs/static/render.cjs +0 -44
  82. package/build/cjs/testing.cjs +0 -12
  83. package/build/cjs/threads.cjs +0 -117
  84. package/build/cjs/utilities/react.cjs +0 -12
  85. package/build/esm/magic/request-router.mjs +0 -1
  86. package/build/esm/polyfills/abort-controller.mjs +0 -1
  87. package/build/esm/polyfills/base.mjs +0 -1
  88. package/build/esm/polyfills/crypto.mjs +0 -1
  89. package/build/esm/polyfills/fetch-get-set-cookie.mjs +0 -1
  90. package/build/esm/polyfills/fetch.mjs +0 -1
  91. package/build/esm/polyfills/noop.mjs +0 -1
  92. package/build/esm/static/StaticContext.mjs +0 -18
  93. package/build/esm/static/index.mjs +0 -259
  94. package/build/esm/static/render.mjs +0 -42
  95. package/build/esm/testing.mjs +0 -1
  96. package/build/esnext/magic/app.esnext +0 -1
  97. package/build/esnext/magic/assets.esnext +0 -1
  98. package/build/esnext/magic/request-router.esnext +0 -1
  99. package/build/esnext/polyfills/abort-controller.esnext +0 -1
  100. package/build/esnext/polyfills/base.esnext +0 -1
  101. package/build/esnext/polyfills/crypto.esnext +0 -1
  102. package/build/esnext/polyfills/fetch-get-set-cookie.esnext +0 -1
  103. package/build/esnext/polyfills/fetch.esnext +0 -1
  104. package/build/esnext/polyfills/noop.esnext +0 -1
  105. package/build/esnext/static/StaticContext.esnext +0 -18
  106. package/build/esnext/static/index.esnext +0 -259
  107. package/build/esnext/static/render.esnext +0 -42
  108. package/build/esnext/testing.esnext +0 -1
  109. package/build/typescript/App.d.ts +0 -48
  110. package/build/typescript/App.d.ts.map +0 -1
  111. package/build/typescript/TestApp.d.ts +0 -17
  112. package/build/typescript/TestApp.d.ts.map +0 -1
  113. package/build/typescript/global.d.ts +0 -8
  114. package/build/typescript/global.d.ts.map +0 -1
  115. package/build/typescript/magic/app.d.ts +0 -4
  116. package/build/typescript/magic/app.d.ts.map +0 -1
  117. package/build/typescript/magic/assets.d.ts +0 -5
  118. package/build/typescript/magic/assets.d.ts.map +0 -1
  119. package/build/typescript/magic/request-router.d.ts +0 -4
  120. package/build/typescript/magic/request-router.d.ts.map +0 -1
  121. package/build/typescript/matchers/graphql/operations.d.ts +0 -7
  122. package/build/typescript/matchers/graphql/operations.d.ts.map +0 -1
  123. package/build/typescript/matchers/graphql/utilities.d.ts +0 -8
  124. package/build/typescript/matchers/graphql/utilities.d.ts.map +0 -1
  125. package/build/typescript/matchers/graphql.d.ts +0 -9
  126. package/build/typescript/matchers/graphql.d.ts.map +0 -1
  127. package/build/typescript/matchers.d.ts +0 -3
  128. package/build/typescript/matchers.d.ts.map +0 -1
  129. package/build/typescript/polyfills/abort-controller.d.ts +0 -2
  130. package/build/typescript/polyfills/abort-controller.d.ts.map +0 -1
  131. package/build/typescript/polyfills/base.d.ts +0 -2
  132. package/build/typescript/polyfills/base.d.ts.map +0 -1
  133. package/build/typescript/polyfills/crypto.d.ts +0 -2
  134. package/build/typescript/polyfills/crypto.d.ts.map +0 -1
  135. package/build/typescript/polyfills/fetch-get-set-cookie.d.ts +0 -2
  136. package/build/typescript/polyfills/fetch-get-set-cookie.d.ts.map +0 -1
  137. package/build/typescript/polyfills/fetch.d.ts +0 -2
  138. package/build/typescript/polyfills/fetch.d.ts.map +0 -1
  139. package/build/typescript/polyfills/noop.d.ts +0 -2
  140. package/build/typescript/polyfills/noop.d.ts.map +0 -1
  141. package/build/typescript/react/index.d.ts +0 -3
  142. package/build/typescript/react/index.d.ts.map +0 -1
  143. package/build/typescript/react-dom/index.d.ts +0 -3
  144. package/build/typescript/react-dom/index.d.ts.map +0 -1
  145. package/build/typescript/server/index.d.ts +0 -16
  146. package/build/typescript/server/index.d.ts.map +0 -1
  147. package/build/typescript/static/StaticContext.d.ts +0 -13
  148. package/build/typescript/static/StaticContext.d.ts.map +0 -1
  149. package/build/typescript/static/index.d.ts +0 -20
  150. package/build/typescript/static/index.d.ts.map +0 -1
  151. package/build/typescript/static/render.d.ts +0 -19
  152. package/build/typescript/static/render.d.ts.map +0 -1
  153. package/build/typescript/testing.d.ts +0 -2
  154. package/build/typescript/testing.d.ts.map +0 -1
  155. package/quilt.project.ts +0 -5
  156. package/source/magic/app.ts +0 -5
  157. package/source/magic/assets.ts +0 -8
  158. package/source/magic/request-router.ts +0 -5
  159. package/source/polyfills/README.md +0 -3
  160. package/source/polyfills/abort-controller.ts +0 -1
  161. package/source/polyfills/base.ts +0 -1
  162. package/source/polyfills/crypto.ts +0 -1
  163. package/source/polyfills/fetch-get-set-cookie.ts +0 -1
  164. package/source/polyfills/fetch.ts +0 -1
  165. package/source/polyfills/noop.ts +0 -1
  166. package/source/static/StaticContext.tsx +0 -39
  167. package/source/static/index.tsx +0 -315
  168. package/source/static/render.tsx +0 -40
  169. package/source/testing.ts +0 -1
  170. /package/build/esm/{magic/app.mjs → modules.mjs} +0 -0
  171. /package/build/{esm/magic/assets.mjs → esnext/modules.esnext} +0 -0
@@ -1,261 +0,0 @@
1
- 'use strict';
2
-
3
- var server = require('react-dom/server');
4
- var server$1 = require('@quilted/react-html/server');
5
- var _static = require('@quilted/react-router/static');
6
- var render = require('./render.cjs');
7
- var jsxRuntime = require('react/jsx-runtime');
8
-
9
- const BASE_URL = 'http://localhost:3000';
10
- async function renderStatic(App, {
11
- assets,
12
- routes: startingRoutes,
13
- onRender,
14
- crawl = true,
15
- baseUrl = BASE_URL,
16
- prettify = true
17
- }) {
18
- const routesToHandle = startingRoutes.map(route => ({
19
- route: removePostfixSlash(new URL(route, baseUrl).pathname),
20
- fallback: false
21
- }));
22
- const seenRoutes = [...routesToHandle];
23
- const seenRouteIds = new Set(seenRoutes.map(({
24
- route
25
- }) => route));
26
- let renderableRoute;
27
- while (renderableRoute = routesToHandle.shift()) {
28
- const {
29
- route,
30
- fallback
31
- } = renderableRoute;
32
- const url = new URL(route, baseUrl);
33
- const {
34
- html,
35
- http,
36
- routes
37
- } = await renderUrl(url, {
38
- fallback
39
- });
40
- if (crawl) {
41
- for (const {
42
- routes: routeDefinitions,
43
- fallback = false,
44
- consumedPath,
45
- prefix
46
- } of routes) {
47
- const basePathname = joinPath(prefix, consumedPath);
48
- const baseId = basePathname === '/' ? basePathname : `__QUILT_BASE_${basePathname}__`;
49
- for (const routeDefinition of routeDefinitions) {
50
- await recordRouteDefinition(routeDefinition, {
51
- baseId,
52
- basePathname,
53
- addFallbacks: fallback
54
- });
55
- }
56
- if (fallback && routeDefinitions[routeDefinitions.length - 1]?.match != null) {
57
- await recordRouteDefinition({}, {
58
- baseId,
59
- basePathname,
60
- addFallbacks: fallback
61
- });
62
- }
63
- }
64
- }
65
- await onRender({
66
- route,
67
- content: html,
68
- http,
69
- fallback,
70
- hasChildren: !fallback && seenRoutes.some(otherRoute => otherRoute.route.startsWith(`${route}/`))
71
- });
72
- }
73
- async function recordRouteDefinition({
74
- match,
75
- children,
76
- renderStatic
77
- }, {
78
- basePathname,
79
- baseId,
80
- addFallbacks
81
- }) {
82
- if (renderStatic === false) return;
83
- let routeId;
84
- const hasChildren = children && children.length > 0;
85
- const hasManualMatches = typeof renderStatic === 'function' && typeof match !== 'string';
86
- const matchedRoutes = [];
87
- if (typeof match === 'string') {
88
- routeId = joinPath(baseId, match);
89
- matchedRoutes.push({
90
- id: routeId,
91
- route: joinPath(basePathname, match),
92
- fallback: false
93
- });
94
- } else if (typeof match === 'function') {
95
- routeId = joinPath(baseId, `__QUILT_FUNCTION_ROUTE_${match.toString()}__`);
96
- } else if (match instanceof RegExp) {
97
- routeId = joinPath(`__QUILT_REGEX_ROUTE_${match.source}__`);
98
- } else {
99
- routeId = joinPath(baseId, '__QUILT_FALLBACK_ROUTE__');
100
- if (!hasManualMatches) {
101
- matchedRoutes.push({
102
- id: routeId,
103
- route: basePathname,
104
- fallback: true
105
- });
106
- }
107
- }
108
- if (seenRouteIds.has(routeId)) return;
109
- seenRouteIds.add(routeId);
110
- if (typeof renderStatic === 'function' && typeof match !== 'string') {
111
- const matchedRouteParts = await renderStatic();
112
- for (const routePart of matchedRouteParts) {
113
- const id = joinPath(baseId, `__QUILT_MATCH_${routePart}__`);
114
- seenRouteIds.add(id);
115
- matchedRoutes.push({
116
- id,
117
- route: joinPath(basePathname, routePart),
118
- fallback: false
119
- });
120
- }
121
- }
122
- if (hasChildren) {
123
- for (const {
124
- id,
125
- route
126
- } of matchedRoutes) {
127
- for (const child of children) {
128
- await recordRouteDefinition(child, {
129
- addFallbacks,
130
- basePathname: route,
131
- baseId: id
132
- });
133
- }
134
- if (addFallbacks && children[children.length - 1]?.match != null) {
135
- await recordRouteDefinition({}, {
136
- addFallbacks,
137
- basePathname: route,
138
- baseId: id
139
- });
140
- }
141
- }
142
- return;
143
- }
144
- for (const {
145
- route,
146
- fallback
147
- } of matchedRoutes) {
148
- const renderableRoute = {
149
- route,
150
- fallback
151
- };
152
- seenRoutes.push(renderableRoute);
153
- routesToHandle.push(renderableRoute);
154
- }
155
- }
156
- async function renderUrl(url, {
157
- fallback = false
158
- } = {}) {
159
- const routeRecorder = new _static.StaticRenderer({
160
- forceFallback: fallback ? url.pathname : undefined
161
- });
162
- const initialCacheKey = await assets.cacheKey?.(new Request(url));
163
- const {
164
- http,
165
- html: htmlManager,
166
- assets: assetsManager,
167
- markup
168
- } = await render.renderApp( /*#__PURE__*/jsxRuntime.jsx(App, {}), {
169
- url,
170
- cacheKey: initialCacheKey,
171
- decorate(app) {
172
- return /*#__PURE__*/jsxRuntime.jsx(_static.StaticRendererContext.Provider, {
173
- value: routeRecorder,
174
- children: app
175
- });
176
- }
177
- });
178
- const cacheKey = assetsManager.cacheKey;
179
- const [mainAssets, preloadAssets] = await Promise.all([assets.entry({
180
- modules: assetsManager.usedModules({
181
- timing: 'load'
182
- }),
183
- cacheKey
184
- }), assets.modules(assetsManager.usedModules({
185
- timing: 'preload'
186
- }), {
187
- cacheKey
188
- })]);
189
- const {
190
- htmlAttributes,
191
- bodyAttributes,
192
- ...headProps
193
- } = htmlManager.state;
194
- const minifiedHTML = '<!DOCTYPE html>' + server.renderToStaticMarkup(
195
- /*#__PURE__*/
196
- // eslint-disable-next-line jsx-a11y/html-has-lang
197
- jsxRuntime.jsxs("html", {
198
- ...htmlAttributes,
199
- children: [/*#__PURE__*/jsxRuntime.jsxs("head", {
200
- children: [/*#__PURE__*/jsxRuntime.jsx(server$1.Head, {
201
- ...headProps
202
- }), mainAssets?.scripts.map(script => /*#__PURE__*/jsxRuntime.jsx(server$1.Script, {
203
- asset: script,
204
- baseUrl: url
205
- }, script.source)), mainAssets?.styles.map(style => /*#__PURE__*/jsxRuntime.jsx(server$1.Style, {
206
- asset: style,
207
- baseUrl: url
208
- }, style.source)), preloadAssets?.styles.map(style => /*#__PURE__*/jsxRuntime.jsx(server$1.StylePreload, {
209
- asset: style,
210
- baseUrl: url
211
- }, style.source)), preloadAssets?.scripts.map(script => /*#__PURE__*/jsxRuntime.jsx(server$1.ScriptPreload, {
212
- asset: script,
213
- baseUrl: url
214
- }, script.source))]
215
- }), /*#__PURE__*/jsxRuntime.jsx("body", {
216
- ...bodyAttributes,
217
- children: /*#__PURE__*/jsxRuntime.jsx("div", {
218
- id: "app",
219
- dangerouslySetInnerHTML: {
220
- __html: markup ?? ''
221
- }
222
- })
223
- })]
224
- }));
225
- const html = prettify ? await prettifyHTML(minifiedHTML) : minifiedHTML;
226
- return {
227
- html,
228
- http: http.state,
229
- routes: routeRecorder.state
230
- };
231
- }
232
- }
233
- async function prettifyHTML(html) {
234
- try {
235
- const {
236
- default: prettier
237
- } = await import('prettier');
238
- return prettier.format(html, {
239
- parser: 'html'
240
- });
241
- } catch (error) {
242
- return html;
243
- }
244
- }
245
- function joinPath(...parts) {
246
- let path = '/';
247
- for (const part of parts) {
248
- if (typeof part !== 'string') continue;
249
- const normalizedPart = part.startsWith('/') ? part.slice(1) : part;
250
- if (normalizedPart.length === 0) continue;
251
- if (path !== '/') path += '/';
252
- path += normalizedPart;
253
- path = removePostfixSlash(path);
254
- }
255
- return path;
256
- }
257
- function removePostfixSlash(value) {
258
- return value.endsWith('/') && value !== '/' ? value.slice(0, value.length - 1) : value;
259
- }
260
-
261
- exports.renderStatic = renderStatic;
@@ -1,44 +0,0 @@
1
- 'use strict';
2
-
3
- var server$3 = require('@quilted/react-server-render/server');
4
- var server = require('@quilted/react-html/server');
5
- var server$1 = require('@quilted/react-http/server');
6
- var server$2 = require('@quilted/react-assets/server');
7
- var StaticContext = require('./StaticContext.cjs');
8
- var jsxRuntime = require('react/jsx-runtime');
9
-
10
- async function renderApp(app, {
11
- decorate,
12
- url,
13
- headers,
14
- cacheKey,
15
- ...rest
16
- } = {}) {
17
- const html = new server.HTMLManager();
18
- const http = new server$1.HttpManager({
19
- headers
20
- });
21
- const assets = new server$2.AssetsManager({
22
- cacheKey
23
- });
24
- const markup = await server$3.extract(app, {
25
- decorate(app) {
26
- return /*#__PURE__*/jsxRuntime.jsx(StaticContext.StaticContext, {
27
- html: html,
28
- http: http,
29
- url: url,
30
- assets: assets,
31
- children: decorate?.(app) ?? app
32
- });
33
- },
34
- ...rest
35
- });
36
- return {
37
- markup,
38
- http,
39
- html,
40
- assets
41
- };
42
- }
43
-
44
- exports.renderApp = renderApp;
@@ -1,12 +0,0 @@
1
- 'use strict';
2
-
3
- var testing = require('@quilted/testing');
4
-
5
-
6
-
7
- Object.keys(testing).forEach(function (k) {
8
- if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
9
- enumerable: true,
10
- get: function () { return testing[k]; }
11
- });
12
- });
@@ -1,117 +0,0 @@
1
- 'use strict';
2
-
3
- var threads = require('@quilted/threads');
4
- var signals = require('@quilted/threads/signals');
5
- var events = require('@quilted/events');
6
- var reactWorkers = require('@quilted/react-workers');
7
-
8
-
9
-
10
- Object.defineProperty(exports, 'ENCODE_METHOD', {
11
- enumerable: true,
12
- get: function () { return threads.ENCODE_METHOD; }
13
- });
14
- Object.defineProperty(exports, 'acceptThreadAbortSignal', {
15
- enumerable: true,
16
- get: function () { return threads.acceptThreadAbortSignal; }
17
- });
18
- Object.defineProperty(exports, 'createBasicEncoder', {
19
- enumerable: true,
20
- get: function () { return threads.createBasicEncoder; }
21
- });
22
- Object.defineProperty(exports, 'createThread', {
23
- enumerable: true,
24
- get: function () { return threads.createThread; }
25
- });
26
- Object.defineProperty(exports, 'createThreadAbortSignal', {
27
- enumerable: true,
28
- get: function () { return threads.createThreadAbortSignal; }
29
- });
30
- Object.defineProperty(exports, 'createThreadFromBrowserWebSocket', {
31
- enumerable: true,
32
- get: function () { return threads.createThreadFromBrowserWebSocket; }
33
- });
34
- Object.defineProperty(exports, 'createThreadFromIframe', {
35
- enumerable: true,
36
- get: function () { return threads.createThreadFromIframe; }
37
- });
38
- Object.defineProperty(exports, 'createThreadFromInsideIframe', {
39
- enumerable: true,
40
- get: function () { return threads.createThreadFromInsideIframe; }
41
- });
42
- Object.defineProperty(exports, 'createThreadFromMessagePort', {
43
- enumerable: true,
44
- get: function () { return threads.createThreadFromMessagePort; }
45
- });
46
- Object.defineProperty(exports, 'createThreadFromWebWorker', {
47
- enumerable: true,
48
- get: function () { return threads.createThreadFromWebWorker; }
49
- });
50
- Object.defineProperty(exports, 'isMemoryManageable', {
51
- enumerable: true,
52
- get: function () { return threads.isMemoryManageable; }
53
- });
54
- Object.defineProperty(exports, 'release', {
55
- enumerable: true,
56
- get: function () { return threads.release; }
57
- });
58
- Object.defineProperty(exports, 'retain', {
59
- enumerable: true,
60
- get: function () { return threads.retain; }
61
- });
62
- Object.defineProperty(exports, 'acceptThreadSignal', {
63
- enumerable: true,
64
- get: function () { return signals.acceptThreadSignal; }
65
- });
66
- Object.defineProperty(exports, 'createThreadSignal', {
67
- enumerable: true,
68
- get: function () { return signals.createThreadSignal; }
69
- });
70
- Object.defineProperty(exports, 'isThreadSignal', {
71
- enumerable: true,
72
- get: function () { return signals.isThreadSignal; }
73
- });
74
- Object.defineProperty(exports, 'AbortError', {
75
- enumerable: true,
76
- get: function () { return events.AbortError; }
77
- });
78
- Object.defineProperty(exports, 'EventEmitter', {
79
- enumerable: true,
80
- get: function () { return events.EventEmitter; }
81
- });
82
- Object.defineProperty(exports, 'NestedAbortController', {
83
- enumerable: true,
84
- get: function () { return events.NestedAbortController; }
85
- });
86
- Object.defineProperty(exports, 'TimedAbortController', {
87
- enumerable: true,
88
- get: function () { return events.TimedAbortController; }
89
- });
90
- Object.defineProperty(exports, 'addEventHandler', {
91
- enumerable: true,
92
- get: function () { return events.addEventHandler; }
93
- });
94
- Object.defineProperty(exports, 'createEventEmitter', {
95
- enumerable: true,
96
- get: function () { return events.createEventEmitter; }
97
- });
98
- Object.defineProperty(exports, 'on', {
99
- enumerable: true,
100
- get: function () { return events.on; }
101
- });
102
- Object.defineProperty(exports, 'once', {
103
- enumerable: true,
104
- get: function () { return events.once; }
105
- });
106
- Object.defineProperty(exports, 'createThreadWorker', {
107
- enumerable: true,
108
- get: function () { return reactWorkers.createThreadWorker; }
109
- });
110
- Object.defineProperty(exports, 'createWorker', {
111
- enumerable: true,
112
- get: function () { return reactWorkers.createWorker; }
113
- });
114
- Object.defineProperty(exports, 'useThreadWorker', {
115
- enumerable: true,
116
- get: function () { return reactWorkers.useThreadWorker; }
117
- });
@@ -1,12 +0,0 @@
1
- 'use strict';
2
-
3
- var jsxRuntime = require('react/jsx-runtime');
4
-
5
- function maybeWrapContext(Context, value, children) {
6
- return value ? /*#__PURE__*/jsxRuntime.jsx(Context.Provider, {
7
- value: value,
8
- children: children
9
- }) : children;
10
- }
11
-
12
- exports.maybeWrapContext = maybeWrapContext;
@@ -1 +0,0 @@
1
-
@@ -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-get-set-cookie';
@@ -1 +0,0 @@
1
- import '@quilted/polyfills/fetch';
@@ -1 +0,0 @@
1
- import '@quilted/polyfills/noop';
@@ -1,18 +0,0 @@
1
- import { AssetsContext } from '@quilted/react-assets/server';
2
- import { InitialUrlContext } from '@quilted/react-router';
3
- import { HTMLContext } from '@quilted/react-html/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
- assets,
12
- children
13
- }) {
14
- const normalizedUrl = typeof url === 'string' ? new URL(url) : url;
15
- return maybeWrapContext(AssetsContext, assets, maybeWrapContext(HttpServerContext, http, maybeWrapContext(HTMLContext, html, maybeWrapContext(InitialUrlContext, normalizedUrl, children))));
16
- }
17
-
18
- export { StaticContext };