Swc migration#26
Conversation
|
@leecalcote should i also upgrade mocha version ? please take a look |
kishore08-07
left a comment
There was a problem hiding this comment.
@YASHMAHAKAL I noticed inconsistent module configurations across files: .swcrc and .swcrc.test are using commonjs, while rollup.config.js is configured for es6.
Could we align these configs or rely on Rollup to handle the module format to avoid potential build inconsistencies?
The different module types are intentional and follow the recommended pattern for Rollup + SWC. |
@YASHMAHAKAL Thanks for clarifying, that makes sense. |
|
@saurabhraghuvanshii keep working this through, please. |
4c3f9b3 to
4cc37ff
Compare
|
@YASHMAHAKAL, did you test your changes? Did you see any improvement in build time? |
|
@saurabhraghuvanshii yes, build time was reduced to 900 ms vs 2.5 seconds |
|
@saurabhraghuvanshii however, i just resolved merge conflicts so i'm testing it again |
Wow!! |
|
@saurabhraghuvanshii i have tested it again and new build time is - 1.2 seconds vs 4.5 seconds after having changes in master recently : ) |
|
@YASHMAHAKAL did you test all the scripts that are mentioned in package.json especially ( npm run dev & npm run build ) ? |
|
a2948a4 to
a58174f
Compare
|
@saurabhraghuvanshii take a look again, i've made the fix |
a58174f to
6b0fd20
Compare
|
@miacycle please merge this then I can update my Pr. |
e9550ae to
e848b30
Compare
|
There are some conflicts that have to be resolved. |
554571a to
27d26af
Compare
YASHMAHAKAL
left a comment
There was a problem hiding this comment.
merge conflicts have been resolved
Signed-off-by: YASHMAHAKAL <[email protected]> remove @babel/runtime-corejs3 dependency Signed-off-by: YASHMAHAKAL <[email protected]> replaced 8-line IE11-era object with MUI v7 query string Signed-off-by: YASHMAHAKAL <[email protected]> removed mui/emotions Signed-off-by: YASHMAHAKAL <[email protected]> deleted .eslintrc Signed-off-by: YASHMAHAKAL <[email protected]> update rollup config Signed-off-by: YASHMAHAKAL <[email protected]> eliminate .eslintrc, fixed jsc.target errors Signed-off-by: YASHMAHAKAL <[email protected]> inconsistency fixed Signed-off-by: YASHMAHAKAL <[email protected]>
| 'use strict'; | ||
|
|
||
| // React 19 + Enzyme compatibility shims for Vitest. Mirrors master's setup-mocha-env.js. | ||
|
|
||
| // beforeAll/afterAll are Vitest globals (globals:true). Alias for Mocha-style tests. | ||
| global.before = beforeAll; | ||
| global.after = afterAll; | ||
|
|
||
| afterAll(async () => { | ||
| await new Promise((resolve) => setTimeout(resolve, 100)); | ||
| }); | ||
|
|
||
| // jsdom polyfills | ||
| if (global.document) { | ||
| global.document.createRange = () => ({ | ||
| setStart: () => {}, |
There was a problem hiding this comment.
test/setup-vitest.cjs is a temporary compatibility shim. The existing test suite relies on Enzyme, which is incompatible with React 19 — ReactDOM.findDOMNode, testUtils.Simulate, and the internal hook dispatcher were all removed in React 19, causing all 234 tests to fail. This file patches them back in so the tests pass for now, mirroring the same approach master uses in test/setup-mocha-env.js. The proper fix is migrating the test suite from Enzyme to React Testing Library, which I will do in a follow-up PR. Keeping it separate avoids stacking a large test refactor on top of this build toolchain migration, making both PRs easier to review and merge independently.
|
@leecalcote @Rajesh-Nagarajan-11 @saurabhraghuvanshii i've resolved all the merge conflicts, all the tests are passing, please take a look whenever convenient : ) |
ca86bea to
5452615
Compare
Signed-off-by: YASHMAHAKAL <[email protected]> addressed compatibility issues and test configuration fixes Signed-off-by: YASHMAHAKAL <[email protected]> leftover warnings fixed Signed-off-by: YASHMAHAKAL <[email protected]> applied suggestions Signed-off-by: YASHMAHAKAL <[email protected]> fixed bugs for validateDOM and props nesting Signed-off-by: YASHMAHAKAL <[email protected]> coverage differentiated and npm run coverage fixed Signed-off-by: YASHMAHAKAL <[email protected]> fix: update dependencies and config Signed-off-by: YASHMAHAKAL <[email protected]> changed tests to unplugin-swc Signed-off-by: YASHMAHAKAL <[email protected]> apply suggestions Signed-off-by: YASHMAHAKAL <[email protected]> vitest.config.mts edited Signed-off-by: YASHMAHAKAL <[email protected]> added test/setup-vitest.cjs Signed-off-by: YASHMAHAKAL <[email protected]>
Signed-off-by: YASHMAHAKAL <[email protected]>
5452615 to
f529756
Compare
|
LGTM |

Notes for Reviewers
This PR fixes #
Migrates from Babel to SWC
Signed commits