@quintype/framework 7.4.0-react-18.0 → 7.4.0-upgrade-react.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.
- package/client/start.js +3 -14
- package/package.json +3 -3
- package/test/babel.js +1 -5
package/client/start.js
CHANGED
|
@@ -11,7 +11,7 @@ import { BreakingNews, CLIENT_SIDE_RENDERED, NAVIGATE_TO_PAGE, PAGE_LOADING } fr
|
|
|
11
11
|
import { createBrowserHistory } from "history";
|
|
12
12
|
import get from "lodash/get";
|
|
13
13
|
import React from "react";
|
|
14
|
-
import
|
|
14
|
+
import ReactDOM from "react-dom";
|
|
15
15
|
import { Provider } from "react-redux";
|
|
16
16
|
import { IsomorphicComponent } from "../isomorphic/component";
|
|
17
17
|
import { makePickComponentSync } from "../isomorphic/impl/make-pick-component-sync";
|
|
@@ -181,21 +181,10 @@ export function maybeSetUrl(path, title) {
|
|
|
181
181
|
export function renderComponent(clazz, container, store, props = {}, callback) {
|
|
182
182
|
const component = React.createElement(Provider, { store }, React.createElement(clazz, props || {}));
|
|
183
183
|
|
|
184
|
-
function AppWithCallbackAfterRender() {
|
|
185
|
-
useEffect(() => {
|
|
186
|
-
callback();
|
|
187
|
-
});
|
|
188
|
-
|
|
189
|
-
return component;
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
let root = createRoot(document.getElementById(container));
|
|
193
|
-
|
|
194
184
|
if (props.hydrate) {
|
|
195
|
-
|
|
185
|
+
return ReactDOM.hydrate(component, document.getElementById(container), callback);
|
|
196
186
|
}
|
|
197
|
-
|
|
198
|
-
return root.render(<AppWithCallbackAfterRender />);
|
|
187
|
+
return ReactDOM.render(component, document.getElementById(container), callback);
|
|
199
188
|
}
|
|
200
189
|
|
|
201
190
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quintype/framework",
|
|
3
|
-
"version": "7.4.0-react
|
|
3
|
+
"version": "7.4.0-upgrade-react.0",
|
|
4
4
|
"description": "Libraries to help build Quintype Node.js apps",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -47,8 +47,8 @@
|
|
|
47
47
|
"mocha-snapshots": "^4.2.0",
|
|
48
48
|
"morgan": "^1.10.0",
|
|
49
49
|
"path-to-regexp": "^6.2.0",
|
|
50
|
-
"react": "^
|
|
51
|
-
"react-dom": "^
|
|
50
|
+
"react": "^17.0.2",
|
|
51
|
+
"react-dom": "^17.0.2",
|
|
52
52
|
"react-redux": "^7.2.5",
|
|
53
53
|
"react-router": "^5.2.1",
|
|
54
54
|
"redux": "^4.1.1",
|
package/test/babel.js
CHANGED
|
@@ -2,11 +2,7 @@ const ROOT_PATH = require("path").resolve(__dirname, "..");
|
|
|
2
2
|
|
|
3
3
|
require("babel-register")({
|
|
4
4
|
presets: ["react"],
|
|
5
|
-
plugins: [
|
|
6
|
-
"transform-es2015-modules-commonjs",
|
|
7
|
-
"transform-object-rest-spread",
|
|
8
|
-
"quintype-assets",
|
|
9
|
-
],
|
|
5
|
+
plugins: ["transform-es2015-modules-commonjs", "transform-object-rest-spread", "quintype-assets"],
|
|
10
6
|
ignore(file) {
|
|
11
7
|
return file.startsWith(ROOT_PATH + "/node_modules");
|
|
12
8
|
},
|