Commit da5d7f4
test(deps): make suite pass on React 19 / MUI 9 / chai 6 (#56)
* test(deps): make suite pass on React 19 / MUI 9 / chai 6
The dep upgrade left the test stack split between two React eras: enzyme +
react-shallow-renderer + the cfaester adapter were built for the React 17/18
internals, while React 19 ships a different shared-internals shape, removed
findDOMNode and Simulate, and freezes elements with a fiber back-reference
that breaks circular-graph assertions.
Reconstruct the legacy surface from inside the test setup, migrate the two
components whose APIs broke, and externalize runtime deps in rollup so the
bundle stops warning about subpath imports it shouldn't be inlining.
- test/setup-mocha-env.js: stub `__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED`,
route React.use* through the shallow renderer's dispatcher, polyfill
findDOMNode by walking the fiber tree, rebuild Simulate as native event
dispatch (with input-tracker reset and checkbox-via-click handling), and
skip Object.freeze for React elements so `_owner` can be cleared at
creation time.
- src/components/TablePagination.js: migrate `backIconButtonProps`/`nextIconButtonProps`/`SelectProps`
to MUI v9's `slotProps.actions.{previousButton,nextButton}` / `slotProps.select`.
- src/components/TableToolbar.js: replace the dropped `<ReactToPrint>` /
`<PrintContextConsumer>` pair with a `useReactToPrint` hook wrapper.
- rollup.config.js: derive externals from package.json so peerDeps and
`@babel/runtime-corejs3/*` subpaths don't trigger "Unresolved dependencies".
- package.json: pin react-is to ^19.2.5 via overrides so the adapter's
isElement check recognizes React 19's `react.transitional.element` symbol.
Signed-off-by: Lee Calcote <lee.calcote@layer5.io>
* fix(test): tighten findDOMNode polyfill and Simulate alias map
- findDOMNode: walk the BFS queue with an index pointer instead of array shift
so traversal stays O(n) on larger fiber trees.
- Simulate: map doubleClick -> dblclick (the actual DOM type) and route it
through MouseEvent so onDoubleClick handlers fire.
Signed-off-by: Lee Calcote <lee.calcote@layer5.io>
* No new changes needed — re-reviewing latest state
Agent-Logs-Url: https://github.com/layer5io/mui-datatables/sessions/b0c2f601-a18d-4cc1-a2e8-72245263a539
Co-authored-by: leecalcote <7570704+leecalcote@users.noreply.github.com>
---------
Signed-off-by: Lee Calcote <lee.calcote@layer5.io>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>1 parent 025a496 commit da5d7f4
6 files changed
Lines changed: 351 additions & 111 deletions
File tree
- src/components
- test
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
133 | 133 | | |
134 | 134 | | |
135 | 135 | | |
136 | | - | |
| 136 | + | |
| 137 | + | |
137 | 138 | | |
138 | 139 | | |
139 | 140 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
5 | 19 | | |
6 | 20 | | |
7 | 21 | | |
| 22 | + | |
8 | 23 | | |
9 | 24 | | |
10 | 25 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
97 | 101 | | |
98 | 102 | | |
99 | 103 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| |||
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
106 | 127 | | |
107 | 128 | | |
108 | 129 | | |
| |||
379 | 400 | | |
380 | 401 | | |
381 | 402 | | |
382 | | - | |
383 | | - | |
384 | | - | |
385 | | - | |
386 | | - | |
387 | | - | |
388 | | - | |
389 | | - | |
390 | | - | |
391 | | - | |
392 | | - | |
393 | | - | |
394 | | - | |
395 | | - | |
396 | | - | |
397 | | - | |
398 | | - | |
399 | | - | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
400 | 411 | | |
401 | 412 | | |
402 | 413 | | |
| |||
0 commit comments