Skip to content

Commit d731c92

Browse files
committed
upgrade web to node 22
1 parent 8d7688c commit d731c92

File tree

6 files changed

+8579
-8231
lines changed

6 files changed

+8579
-8231
lines changed

alfalfa_web/.babelrc.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,16 @@ const presets = [
1414
]
1515
];
1616

17-
if (isProd) presets.push(["minify", { builtIns: false }]);
17+
// Use Webpack's built-in Terser for minification instead of babel-preset-minify
18+
// which has compatibility issues with newer Babel versions
1819

1920
module.exports = {
2021
assumptions: {
2122
noDocumentAll: true,
2223
noClassCalls: true
2324
},
2425
comments: false,
25-
plugins: ["@babel/plugin-proposal-class-properties"],
26+
plugins: ["@babel/plugin-transform-class-properties"],
2627
presets,
2728
sourceMaps: isProd ? false : "inline"
2829
};

alfalfa_web/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM node:16 AS base
1+
FROM node:22 AS base
22
ARG GIT_COMMIT
33
ENV GIT_COMMIT=$GIT_COMMIT
44

alfalfa_web/components/app.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,17 @@ import React from "react";
22
import "@fontsource/material-icons";
33
import "@fontsource/roboto";
44
import "normalize.css/normalize.css";
5-
import ReactDOM from "react-dom";
5+
import { createRoot } from "react-dom/client";
66
import { BrowserRouter } from "react-router-dom";
77
import { App } from "./App/App.js";
88

9-
ReactDOM.render(
9+
const container = document.getElementById("root");
10+
const root = createRoot(container);
11+
12+
root.render(
1013
<BrowserRouter>
1114
<React.StrictMode>
1215
<App />
1316
</React.StrictMode>
14-
</BrowserRouter>,
15-
document.getElementById("root")
17+
</BrowserRouter>
1618
);

0 commit comments

Comments
 (0)