Skip to content

Commit f18d896

Browse files
camdclaudeArchaeopteryx
authored
2nd: Upgrade date pickers dayjs resizable panels (#9115)
* Migrate webpack to RSPack * optimize tests and docker * review fixups * Add comprehensive unit tests for RSPack migration - Add tests/ui/App.test.jsx: Test URL transformations and routing - URL backwards compatibility (perf.html, pushhealth.html, logviewer.html) - Permalink hash preservation - Document title updates for perfherder alerts - Export verification (no react-hot-loader wrapper) - Expand tests/ui/helpers/filter.test.js: Comprehensive filter helper tests - thMatchType, thFieldChoices, thFilterDefaults constants - arraysEqual and matchesDefaults functions - hasUrlFilterChanges URL comparison - reloadOnChangeParameters and allFilterParams arrays - Add tests/ui/perfherder/App.test.jsx: Export and structure verification - Verify no hot loader wrapper (RSPack migration regression test) - Validate class component structure and lifecycle methods - Add tests/ui/push-health/App.test.jsx: Component and routing tests - Component loading and API call verification - Route handling (push, my-pushes, usage) - Export verification for RSPack migration 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * Update jest-puppeteer config to use pnpm Change server command from 'yarn start' to 'pnpm start' to match the package manager migration. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * Upgrade packages * fix lint errors * Add unit tests for dayjs, date-pickers, and resizable-panels migrations - Add tests for dayjs helper module (UTC, customParseFormat, isSameOrAfter, relativeTime plugins) - Add tests for display.js dayjs migration (toMercurialDateStr, toMercurialShortDateStr) - Add tests for taskcluster.js credential expiration with dayjs - Add tests for DateRangePicker MUI component migration - Add tests for intermittent-failures helpers (prettyDate, calculateMetrics) - Add tests for perfherder helpers (getFilledBugSummary date formatting) - Add tests for GraphsContainer and TableView date formatting - Add tests for job-view App react-resizable-panels migration 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * Add markdown formatting scripts and fix lint errors - Add format:md, format:md:check, and lint:md scripts using prettier - Fix lint errors in test files: - taskcluster.test.js: Use toThrow() instead of try/catch - DateRangePicker.test.jsx: Remove jest.mock with require(), use toHaveLength() - helpers.test.jsx: Use toHaveLength() - GraphsContainer.test.jsx: Remove unused variable 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * remove unnecessary unit tests * reduze resizer height to 3px * set UTC as timezone for tests to have datetime string formatting test always pass --------- Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com> Co-authored-by: Sebastian Hengst <aryx.github@gmx-topmail.de>
1 parent 2248cd0 commit f18d896

29 files changed

+1888
-499
lines changed

eslint.config.mjs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,24 @@ export default [
3333
parser: babelParser,
3434
},
3535
files: ['**/*.js', '**/*.jsx'],
36+
settings: {
37+
'import/resolver': {
38+
node: {
39+
extensions: ['.js', '.jsx', '.json'],
40+
moduleDirectory: ['node_modules', 'ui'],
41+
},
42+
},
43+
},
3644
rules: {
3745
'class-methods-use-this': 'off',
3846
'consistent-return': 'off',
3947
'default-case': 'off',
4048
'default-param-last': 'off',
4149
'import/extensions': 'off',
50+
'import/no-unresolved': [
51+
'error',
52+
{ ignore: ['^react-resizable-panels$'] },
53+
],
4254
'jsx-a11y/click-events-have-key-events': 'off',
4355
'no-alert': 'off',
4456
'no-continue': 'off',

jest.config.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
const path = require('path');
22

3+
// Consistency for date formatting tests
4+
process.env.TZ = 'UTC';
5+
36
module.exports = {
47
rootDir: path.resolve(__dirname),
58
moduleDirectories: ['node_modules'],
@@ -9,6 +12,8 @@ module.exports = {
912
'<rootDir>/tests/jest/file-mock.js',
1013
'\\.(css|less|sass|scss)$': '<rootDir>/tests/jest/style-mock.js',
1114
'^react-native$': '<rootDir>/node_modules/react-native-web',
15+
'^react-resizable-panels$':
16+
'<rootDir>/tests/jest/react-resizable-panels-mock.js',
1217
},
1318
bail: true,
1419
collectCoverageFrom: ['ui/**/*.{mjs,jsx,js}'],

package.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
"@fortawesome/react-fontawesome": "0.2.6",
1919
"@mui/material": "7.1.2",
2020
"@mui/styled-engine-sc": "npm:@mui/styled-engine-sc@latest",
21+
"@mui/x-date-pickers": "8.21.0",
2122
"@popperjs/core": "2.11.8",
2223
"@types/react": "*",
2324
"@types/react-dom": "*",
@@ -27,6 +28,7 @@
2728
"buffer": "6.0.3",
2829
"connected-react-router": "6.9.3",
2930
"crypto-browserify": "3.12.1",
31+
"dayjs": "1.11.19",
3032
"fuse.js": "6.0.4",
3133
"history": "4.10.1",
3234
"js-cookie": "3.0.5",
@@ -35,24 +37,22 @@
3537
"json-schema-defaults": "0.4.0",
3638
"lodash": "4.17.21",
3739
"mobx": "6.13.7",
38-
"moment": "2.30.1",
3940
"numeral": "2.0.6",
4041
"pako": "2.1.0",
4142
"process": "0.11.10",
4243
"prop-types": "15.8.1",
4344
"query-string": "7.0.1",
4445
"react": "18.3.1",
4546
"react-bootstrap": "2.10.10",
46-
"react-dates": "21.8.0",
4747
"react-dom": "18.3.1",
4848
"react-helmet": "6.1.0",
4949
"react-highlight-words": "0.20.0",
5050
"react-hot-keys": "2.7.3",
5151
"react-lazylog": "4.5.3",
5252
"react-linkify": "0.2.2",
5353
"react-redux": "8.0.7",
54+
"react-resizable-panels": "3.0.6",
5455
"react-router-dom": "5.1.2",
55-
"react-split-pane": "0.1.92",
5656
"react-table-6": "6.11.0",
5757
"react-tabs": "6.1.0",
5858
"redoc": "2.4.0",
@@ -122,6 +122,9 @@
122122
"format:check": "prettier --check \"**/*.{css,html,js,jsx,json,md,yaml,yml}\"",
123123
"lint": "eslint --cache --cache-location .eslintcache --report-unused-disable-directives --max-warnings 0 --format codeframe ui/ tests/ui/",
124124
"markdownlint": "markdownlint -c .markdownlint.json -p .markdownlintignore .",
125+
"format:md": "prettier --write \"**/*.md\"",
126+
"format:md:check": "prettier --check \"**/*.md\"",
127+
"lint:md": "pnpm markdownlint && pnpm format:md:check",
125128
"prettier": "prettier --check .",
126129
"start": "rspack serve --mode development",
127130
"start:stage": "BACKEND=https://treeherder.allizom.org rspack serve --mode development",

0 commit comments

Comments
 (0)