Skip to content

Commit

Permalink
wip! blindly upgrade a bunch of things with problematic peer deps on …
Browse files Browse the repository at this point in the history
…react

All of these had peer deps on react that evaluated to <18.  Upgrades for
most were available, often major version bumps so they may come with
breaking changes.  A couple things were not available and we need to
switch to alternatives.  Our calling code for libraries has not been
updated, so it's unlikely to compile or run.  But npm is now happy!
  • Loading branch information
tsibley committed Mar 30, 2023
1 parent 45d4038 commit b535897
Show file tree
Hide file tree
Showing 8 changed files with 197 additions and 396 deletions.
1 change: 1 addition & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ module.exports = function babelConfig(api) {
"lodash"
];
if (api.env("development")) {
// XXX FIXME react-18
plugins.push(["react-hot-loader/babel", { safetyNet: false }]);
}
if (process.env.BABEL_INCLUDE_TIMING_FUNCTIONS === "false") {
Expand Down
553 changes: 169 additions & 384 deletions package-lock.json

Large diffs are not rendered by default.

17 changes: 8 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
"@babel/plugin-transform-runtime": "^7.8.3",
"@babel/preset-env": "^7.9.6",
"@babel/preset-react": "^7.0.0",
"@hot-loader/react-dom": "^16.13.0",
"argparse": "^1.0.10",
"babel-loader": "^8.0.4",
"babel-plugin-lodash": "^3.3.4",
Expand Down Expand Up @@ -94,18 +93,18 @@
"prop-types": "^15.6.0",
"query-string": "^4.2.3",
"react": "^18.2.0",
"react-collapsible": "^2.8.4",
"react-collapsible": "^2.10.0",
"react-dom": "^18.2.0",
"react-ga": "^2.2.0",
"react-helmet": "^5.2.1",
"react-hot-loader": "^4.8.4",
"react-ga": "^3.3.1",
"react-helmet": "^6.1.0",
"react-i18next": "^11.3.3",
"react-icons": "^3.9.0",
"react-redux": "^7.2.6",
"react-select": "^5.2.2",
"react-redux": "^7.2.9",
"react-select": "^5.7.2",
"react-side-effect": "^2.1.2",
"react-tooltip": "^4.2.10",
"react-transition-group": "^1.2.1",
"react-virtualized": "^9.22.3",
"react-transition-group": "^4.4.5",
"react-window": "^1.8.8",
"redux": "^4.0.1",
"redux-thunk": "^2.3.0",
"regenerator-runtime": "^0.13.5",
Expand Down
6 changes: 6 additions & 0 deletions src/components/controls/virtualizedMenuList.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import React, { useLayoutEffect, useRef } from "react";
// XXX FIXME react-18: react-virtualized has peer dep on react ^16 and won't
// get updates; need to switch to react-window
// <https://github.com/bvaughn/react-window#how-is-react-window-different-from-react-virtualized>
import { List } from "react-virtualized/dist/es/List";
import { CellMeasurer, CellMeasurerCache } from "react-virtualized/dist/es/CellMeasurer";
import { isEqual } from "lodash";
Expand All @@ -15,6 +18,7 @@ const VirtualizedMenuList = ({ children, maxHeight, focusedOption }) => {
const listRef = useRef(null);
const options = useRef(null);
const cache = useRef(
// XXX FIXME react-18
new CellMeasurerCache({
fixedWidth: true,
defaultHeight: DEFAULT_ROW_HEIGHT
Expand Down Expand Up @@ -58,6 +62,7 @@ const VirtualizedMenuList = ({ children, maxHeight, focusedOption }) => {
* component via the cache
*/
const rowRenderer = ({ index, key, parent, style }) => (
// XXX FIXME react-18
<CellMeasurer
cache={cache.current}
columnIndex={0}
Expand Down Expand Up @@ -85,6 +90,7 @@ const VirtualizedMenuList = ({ children, maxHeight, focusedOption }) => {
};

return (
// XXX FIXME react-18
<List
ref={listRef}
height={calcListHeight()}
Expand Down
4 changes: 4 additions & 0 deletions src/components/notifications/notifications.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import React from "react";
import PropTypes from 'prop-types';
import { connect } from "react-redux";
// XXX FIXME react-18: migrate from v1 → v2
// <https://github.com/reactjs/react-transition-group/blob/master/Migration.md>
import { CSSTransitionGroup } from "react-transition-group";
import { REMOVE_NOTIFICATION } from "../../actions/types";

Expand Down Expand Up @@ -100,6 +102,8 @@ class Notifications extends React.Component {
return null;
}
return (
// XXX FIXME react-18: migrate from v1 → v2
// <https://github.com/reactjs/react-transition-group/blob/master/Migration.md>
<CSSTransitionGroup className="notifications"
transitionName="notification"
transitionEnterTimeout={500}
Expand Down
1 change: 1 addition & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import "core-js";
import "regenerator-runtime";
import "css.escape";
/* L I B R A R I E S */
// XXX FIXME react-18
import "react-hot-loader";
import React from "react";
import ReactDOM from "react-dom";
Expand Down
1 change: 1 addition & 0 deletions src/root.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React, { lazy, Suspense } from 'react';
import { connect } from "react-redux";
// XXX FIXME react-18
import { hot } from 'react-hot-loader/root';
import Monitor from "./components/framework/monitor";
import DatasetLoader from "./components/datasetLoader";
Expand Down
10 changes: 7 additions & 3 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,11 @@ const generateConfig = ({extensionPath, devMode=false, customOutputPath, analyze
// Format is either "libName" or "libName:libPath"
const coreDeps = [
"react",
"react-hot-loader",
"react-dom:@hot-loader/react-dom",
// XXX FIXME react-18: react-hot-loader won't support react 18; must switch to
// react-refresh slash builtin support hooks? unclear without more digging.
// see <https://github.com/facebook/react/issues/16604>
//"react-hot-loader",
//"react-dom:@hot-loader/react-dom",
"regenerator-runtime",
"core-js",
"styled-components"
Expand Down Expand Up @@ -130,7 +133,8 @@ const generateConfig = ({extensionPath, devMode=false, customOutputPath, analyze
"regenerator-runtime",
"whatwg-fetch",
"style-loader",
"@hot-loader/react-dom",
// XXX FIXME react-18
//"@hot-loader/react-dom",
"react(-(redux|select|helmet|i18next))?",
"leaflet",
"redux",
Expand Down

0 comments on commit b535897

Please sign in to comment.