@maka/maka-cli 5.3.14 → 5.3.15
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/bundle/typescript/package.json +1 -1
- package/bundle/typescript/src/templates/meteor/app/imports/startup/lib/routes.js.tsx +2 -2
- package/bundle/typescript/src/templates/meteor/app/imports/startup/server/index.js.jsx +7 -10
- package/bundle/typescript/src/templates/meteor/app/imports/startup/server/index.js.tsx +11 -11
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@maka/maka-cli",
|
|
3
|
-
"version": "5.3.
|
|
3
|
+
"version": "5.3.15",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"summary": "A command line tool for scaffolding Meteor 2.x applications using either React.",
|
|
6
6
|
"description": "A command line tool for scaffolding Meteor 2.x applications using React.",
|
|
@@ -15,14 +15,14 @@ const PrivateRoute = () => {
|
|
|
15
15
|
};
|
|
16
16
|
|
|
17
17
|
const AppRoutes = () => (
|
|
18
|
-
|
|
18
|
+
<Routes>
|
|
19
19
|
<Route path="/" element={<Component.MainLayout />}>
|
|
20
20
|
<Route index element={<Component.Home />} />
|
|
21
21
|
<Route path="*" element={<Component.NotFound />} />
|
|
22
22
|
<Route element={<PrivateRoute />}>
|
|
23
23
|
</Route>
|
|
24
24
|
</Route>
|
|
25
|
-
|
|
25
|
+
</Routes>
|
|
26
26
|
);
|
|
27
27
|
|
|
28
28
|
export default AppRoutes;
|
|
@@ -10,7 +10,6 @@ import React from 'react';
|
|
|
10
10
|
import { renderToStaticMarkup } from 'react-dom/server';
|
|
11
11
|
import { onPageLoad } from 'meteor/server-render';
|
|
12
12
|
import { StaticRouter } from 'react-router-dom/server';
|
|
13
|
-
import { createMemoryHistory } from 'history';
|
|
14
13
|
<% if (config.engines.graphql === 'apollo') { %>
|
|
15
14
|
import { createMeteorNetworkInterface, meteorClientConfig } from 'meteor/apollo';
|
|
16
15
|
import { ApolloClient, ApolloProvider, renderToStringWithData } from '@apollo/client';
|
|
@@ -37,24 +36,22 @@ function createEmotionCache() {
|
|
|
37
36
|
}
|
|
38
37
|
|
|
39
38
|
onPageLoad((sink) => {
|
|
40
|
-
const
|
|
39
|
+
const request = sink.request;
|
|
41
40
|
// Create a sheets instance.
|
|
42
41
|
const cache = createEmotionCache();
|
|
43
42
|
const { extractCriticalToChunks, constructStyleTagsFromChunks } =
|
|
44
43
|
createEmotionServer(cache);
|
|
45
44
|
|
|
46
45
|
const App = (props) => (
|
|
47
|
-
<StaticRouter
|
|
48
|
-
|
|
49
|
-
context={{}}>
|
|
50
|
-
<AppRoutes history={history}/>
|
|
46
|
+
<StaticRouter location={props.location}>
|
|
47
|
+
<AppRoutes/>
|
|
51
48
|
</StaticRouter>
|
|
52
49
|
);<% if (config.engines.theme === 'material') { if (config.engines.graphql === 'apollo') { %>
|
|
53
50
|
renderToStringWithData(
|
|
54
51
|
<ApolloProvider client={client}>
|
|
55
52
|
<ThemeProvider theme={theme}>
|
|
56
53
|
<CssBaseline />
|
|
57
|
-
<App location={
|
|
54
|
+
<App location={request.url} />
|
|
58
55
|
</ThemeProvider>
|
|
59
56
|
</ApolloProvider>
|
|
60
57
|
).then((content) => {
|
|
@@ -67,7 +64,7 @@ onPageLoad((sink) => {
|
|
|
67
64
|
const html = renderToStaticMarkup(
|
|
68
65
|
<ThemeProvider theme={theme}>
|
|
69
66
|
<CssBaseline />
|
|
70
|
-
<App location={
|
|
67
|
+
<App location={request.url} />
|
|
71
68
|
</ThemeProvider>
|
|
72
69
|
);
|
|
73
70
|
const emotionChunks = extractCriticalToChunks(html);
|
|
@@ -78,7 +75,7 @@ onPageLoad((sink) => {
|
|
|
78
75
|
<% } } else { if (config.engines.graphql === 'apollo') { %>
|
|
79
76
|
renderToStringWithData(
|
|
80
77
|
<ApolloProvider client={client}>
|
|
81
|
-
<App location={
|
|
78
|
+
<App location={request.url} />
|
|
82
79
|
</ApolloProvider>
|
|
83
80
|
).then((content) => {
|
|
84
81
|
const emotionChunks = extractCriticalToChunks(html);
|
|
@@ -88,7 +85,7 @@ onPageLoad((sink) => {
|
|
|
88
85
|
sink.renderIntoElementById('app', content);
|
|
89
86
|
});<% } else { %>
|
|
90
87
|
const html = renderToStaticMarkup(
|
|
91
|
-
<App location={
|
|
88
|
+
<App location={request.url} />
|
|
92
89
|
);
|
|
93
90
|
const emotionChunks = extractCriticalToChunks(html);
|
|
94
91
|
const emotionCss = constructStyleTagsFromChunks(emotionChunks);
|
|
@@ -10,7 +10,6 @@ import * as React from 'react';
|
|
|
10
10
|
import { renderToStaticMarkup } from 'react-dom/server';
|
|
11
11
|
import { onPageLoad } from 'meteor/server-render';
|
|
12
12
|
import { StaticRouter } from 'react-router-dom/server';
|
|
13
|
-
import { createMemoryHistory } from 'history';
|
|
14
13
|
<% if (config.engines.graphql === 'apollo') { %>
|
|
15
14
|
import { createMeteorNetworkInterface, meteorClientConfig } from 'meteor/apollo';
|
|
16
15
|
import { ApolloClient, ApolloProvider, renderToStringWithData } from '@apollo/client';
|
|
@@ -37,24 +36,25 @@ function createEmotionCache() {
|
|
|
37
36
|
}
|
|
38
37
|
|
|
39
38
|
onPageLoad((sink) => {
|
|
40
|
-
|
|
39
|
+
// sink is typed ClientSink | ServerSink by @types/meteor; onPageLoad's
|
|
40
|
+
// callback only ever runs on the server, where it's always a ServerSink,
|
|
41
|
+
// but that's not something the union type alone can express.
|
|
42
|
+
const request = (sink as any).request;
|
|
41
43
|
// Create a sheets instance.
|
|
42
44
|
const cache = createEmotionCache();
|
|
43
45
|
const { extractCriticalToChunks, constructStyleTagsFromChunks } =
|
|
44
46
|
createEmotionServer(cache);
|
|
45
47
|
|
|
46
|
-
const App = (props) => (
|
|
47
|
-
<StaticRouter
|
|
48
|
-
|
|
49
|
-
context={{}}>
|
|
50
|
-
<AppRoutes history={history}/>
|
|
48
|
+
const App = (props: { location: string }) => (
|
|
49
|
+
<StaticRouter location={props.location}>
|
|
50
|
+
<AppRoutes/>
|
|
51
51
|
</StaticRouter>
|
|
52
52
|
);<% if (config.engines.theme === 'material') { if (config.engines.graphql === 'apollo') { %>
|
|
53
53
|
renderToStringWithData(
|
|
54
54
|
<ApolloProvider client={client}>
|
|
55
55
|
<ThemeProvider theme={theme}>
|
|
56
56
|
<CssBaseline />
|
|
57
|
-
<App location={
|
|
57
|
+
<App location={request.url} />
|
|
58
58
|
</ThemeProvider>
|
|
59
59
|
</ApolloProvider>
|
|
60
60
|
).then((content) => {
|
|
@@ -67,7 +67,7 @@ onPageLoad((sink) => {
|
|
|
67
67
|
const html = renderToStaticMarkup(
|
|
68
68
|
<ThemeProvider theme={theme}>
|
|
69
69
|
<CssBaseline />
|
|
70
|
-
<App location={
|
|
70
|
+
<App location={request.url} />
|
|
71
71
|
</ThemeProvider>
|
|
72
72
|
);
|
|
73
73
|
const emotionChunks = extractCriticalToChunks(html);
|
|
@@ -78,7 +78,7 @@ onPageLoad((sink) => {
|
|
|
78
78
|
<% } } else { if (config.engines.graphql === 'apollo') { %>
|
|
79
79
|
renderToStringWithData(
|
|
80
80
|
<ApolloProvider client={client}>
|
|
81
|
-
<App location={
|
|
81
|
+
<App location={request.url} />
|
|
82
82
|
</ApolloProvider>
|
|
83
83
|
).then((content) => {
|
|
84
84
|
const emotionChunks = extractCriticalToChunks(html);
|
|
@@ -88,7 +88,7 @@ onPageLoad((sink) => {
|
|
|
88
88
|
sink.renderIntoElementById('app', content);
|
|
89
89
|
});<% } else { %>
|
|
90
90
|
const html = renderToStaticMarkup(
|
|
91
|
-
<App location={
|
|
91
|
+
<App location={request.url} />
|
|
92
92
|
);
|
|
93
93
|
const emotionChunks = extractCriticalToChunks(html);
|
|
94
94
|
const emotionCss = constructStyleTagsFromChunks(emotionChunks);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@maka/maka-cli",
|
|
3
|
-
"version": "5.3.
|
|
3
|
+
"version": "5.3.15",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"summary": "A command line tool for scaffolding Meteor 2.x applications using either React.",
|
|
6
6
|
"description": "A command line tool for scaffolding Meteor 2.x applications using React.",
|