Skip to content

Commit 0a14db0

Browse files
Migrate pgAdmin UI to use React 19. #8676
1 parent 53a994b commit 0a14db0

File tree

204 files changed

+812
-669
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

204 files changed

+812
-669
lines changed

tools/get_chromedriver.py

Lines changed: 246 additions & 157 deletions
Large diffs are not rendered by default.

web/.eslintrc.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,9 @@ module.exports = [
9292
'no-import-assign': 'off',
9393
...reactjs.configs.recommended.rules,
9494
...reactjs.configs['jsx-runtime'].rules,
95-
'react/jsx-uses-react': 'error',
95+
'react/prop-types': 'off',
96+
'react/react-in-jsx-scope': 0,
97+
'react/jsx-uses-react': 0,
9698
'react/jsx-uses-vars': 'error',
9799
'no-unused-vars': 'off',
98100
'unused-imports/no-unused-imports': 'error',

web/babel.config.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
{
2-
"presets": [["@babel/preset-env", {"modules": "commonjs", "useBuiltIns": "usage", "corejs": 3}], "@babel/preset-react", "@babel/preset-typescript"],
3-
"plugins": ["@babel/plugin-proposal-class-properties", "@babel/proposal-object-rest-spread", "@babel/plugin-transform-runtime"]
2+
"presets": [["@babel/preset-env", {"modules": "commonjs", "useBuiltIns": "usage", "corejs": 3}], ["@babel/preset-react", {
3+
"runtime": "automatic"
4+
}], "@babel/preset-typescript"],
5+
"plugins": ["@babel/plugin-proposal-class-properties", "@babel/proposal-object-rest-spread"]
46
}

web/jest.config.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ const webpackShimAlias = require('./webpack.shim').resolveAlias;
22

33
const webpackAliasToJestModules = ()=>{
44
const ret = {
5-
'\\.svg': '<rootDir>/regression/javascript/__mocks__/svg.js'
5+
'\\.svg\\?svgr$': '<rootDir>/regression/javascript/__mocks__/svg.js',
6+
'react-dom/server': 'react-dom/server.edge',
67
};
78
Object.keys(webpackShimAlias).forEach((an)=>{
89
// eg - sources: ./pgadmin/static/js/ to '^sources/(.*)$': '<rootDir>/pgadmin/static/js/$1'

web/package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171
},
7272
"dependencies": {
7373
"@babel/plugin-proposal-class-properties": "^7.10.4",
74-
"@babel/preset-react": "^7.12.13",
74+
"@babel/preset-react": "^7.27.1",
7575
"@codemirror/lang-json": "^6.0.1",
7676
"@codemirror/lang-sql": "^6.10.0",
7777
"@date-io/core": "^3.0.0",
@@ -90,8 +90,8 @@
9090
"@tanstack/react-table": "^8.16.0",
9191
"@tanstack/react-virtual": "^3.13.6",
9292
"@types/classnames": "^2.3.4",
93-
"@types/react": "^18.0.2",
94-
"@types/react-dom": "^18.0.0",
93+
"@types/react": "^19.0.0",
94+
"@types/react-dom": "^19.0.0",
9595
"@xterm/addon-fit": "^0.10.0",
9696
"@xterm/addon-search": "^0.15.0",
9797
"@xterm/addon-web-links": "^0.11.0",
@@ -124,15 +124,15 @@
124124
"papaparse": "^5.5.2",
125125
"path-fx": "^2.0.0",
126126
"postcss": "^8.5.6",
127-
"rc-dock": "^3.3.2",
128-
"react": "^18.2.0",
127+
"rc-dock": "^4.0.0-alpha.2",
128+
"react": "^19.0.0",
129129
"react-arborist": "^3.2.0",
130130
"react-aspen": "^1.1.0",
131131
"react-checkbox-tree": "^1.7.2",
132132
"react-data-grid": "https://github.com/pgadmin-org/react-data-grid.git#3dfc2ca01a046d55c1c7a45392dcec104815dc76",
133133
"react-dnd": "^16.0.1",
134134
"react-dnd-html5-backend": "^16.0.1",
135-
"react-dom": "^18.2.0",
135+
"react-dom": "^19.0.0",
136136
"react-draggable": "^4.4.6",
137137
"react-dropzone": "^14.2.1",
138138
"react-frame-component": "^5.2.6",

web/pgadmin/about/static/js/AboutComponent.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
import gettext from 'sources/gettext';
1111
import url_for from 'sources/url_for';
12-
import React, { useEffect, useState, useRef } from 'react';
12+
import { useEffect, useState, useRef } from 'react';
1313
import { Box, Grid, InputLabel } from '@mui/material';
1414
import { InputSQL } from '../../../static/js/components/FormComponents';
1515
import getApiInstance from '../../../static/js/api_instance';

web/pgadmin/about/static/js/about.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
//
88
//////////////////////////////////////////////////////////////
99

10-
import React from 'react';
1110
import gettext from 'sources/gettext';
1211
import pgAdmin from 'sources/pgadmin';
1312
import AboutComponent from './AboutComponent';

web/pgadmin/browser/static/js/node.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
import _ from 'lodash';
1111
import getApiInstance from '../../../static/js/api_instance';
1212
import { AllPermissionTypes, BROWSER_PANELS } from './constants';
13-
import React from 'react';
1413
import ObjectNodeProperties from '../../../misc/properties/ObjectNodeProperties';
1514
import ErrorBoundary from '../../../static/js/helpers/ErrorBoundary';
1615
import toPx from '../../../static/js/to_px';

web/pgadmin/dashboard/static/js/Dashboard.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
// This software is released under the PostgreSQL Licence
77
//
88
//////////////////////////////////////////////////////////////
9-
import React, { useEffect, useMemo, useState, Fragment } from 'react';
9+
import { useEffect, useMemo, useState, Fragment } from 'react';
1010
import { styled } from '@mui/material/styles';
1111
import gettext from 'sources/gettext';
1212
import PropTypes from 'prop-types';

web/pgadmin/dashboard/static/js/Graphs.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
// This software is released under the PostgreSQL Licence
77
//
88
//////////////////////////////////////////////////////////////
9-
import React, { useEffect, useRef, useState, useReducer, useMemo } from 'react';
9+
import { useEffect, useRef, useState, useReducer, useMemo } from 'react';
1010
import { DATA_POINT_SIZE } from 'sources/chartjs';
1111
import ChartContainer from './components/ChartContainer';
1212
import url_for from 'sources/url_for';

0 commit comments

Comments
 (0)