@quilted/quilt 0.5.107 → 0.5.108
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 +6 -0
- package/build/cjs/AppContext.cjs +3 -2
- package/build/cjs/env.cjs +1 -1
- package/build/cjs/server/ServerContext.cjs +8 -7
- package/build/cjs/server/http-handler.cjs +72 -188
- package/build/cjs/server/render.cjs +32 -75
- package/build/cjs/static/StaticContext.cjs +8 -7
- package/build/cjs/static/index.cjs +250 -591
- package/build/cjs/static/render.cjs +32 -75
- package/build/esm/AppContext.mjs +3 -2
- package/build/esm/env.mjs +1 -1
- package/build/esm/server/ServerContext.mjs +8 -7
- package/build/esm/server/http-handler.mjs +73 -181
- package/build/esm/server/render.mjs +32 -68
- package/build/esm/static/StaticContext.mjs +8 -7
- package/build/esm/static/index.mjs +252 -585
- package/build/esm/static/render.mjs +32 -68
- package/package.json +1 -1
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
2
|
-
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
3
|
-
import _asyncToGenerator from '@babel/runtime/helpers/asyncToGenerator';
|
|
4
|
-
import _regeneratorRuntime from '@babel/runtime/regenerator';
|
|
5
1
|
import { extract } from '@quilted/react-server-render/server';
|
|
6
2
|
import { HtmlManager } from '@quilted/react-html/server';
|
|
7
3
|
import { HttpManager } from '@quilted/react-http/server';
|
|
@@ -9,70 +5,38 @@ import { AsyncAssetManager } from '@quilted/react-async/server';
|
|
|
9
5
|
import { StaticContext } from './StaticContext.mjs';
|
|
10
6
|
import { jsx } from 'react/jsx-runtime';
|
|
11
7
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
http,
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
_context.next = 6;
|
|
45
|
-
return extract(app, _objectSpread({
|
|
46
|
-
decorate: function decorate(app) {
|
|
47
|
-
var _decorate2;
|
|
48
|
-
|
|
49
|
-
return /*#__PURE__*/jsx(StaticContext, {
|
|
50
|
-
asyncAssets: asyncAssets,
|
|
51
|
-
html: html,
|
|
52
|
-
http: http,
|
|
53
|
-
url: url,
|
|
54
|
-
children: (_decorate2 = _decorate === null || _decorate === void 0 ? void 0 : _decorate(app)) !== null && _decorate2 !== void 0 ? _decorate2 : app
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
}, rest));
|
|
58
|
-
|
|
59
|
-
case 6:
|
|
60
|
-
markup = _context.sent;
|
|
61
|
-
return _context.abrupt("return", {
|
|
62
|
-
markup: markup,
|
|
63
|
-
http: http,
|
|
64
|
-
html: html,
|
|
65
|
-
asyncAssets: asyncAssets
|
|
66
|
-
});
|
|
67
|
-
|
|
68
|
-
case 8:
|
|
69
|
-
case "end":
|
|
70
|
-
return _context.stop();
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
}, _callee);
|
|
74
|
-
}));
|
|
75
|
-
return _renderApp.apply(this, arguments);
|
|
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
|
+
};
|
|
76
40
|
}
|
|
77
41
|
|
|
78
42
|
export { renderApp };
|