Brijesh619 opened a new pull request, #733:
URL: https://github.com/apache/atlas/pull/733

   ## What changes were proposed in this pull request?
   
   This PR resolves **ATLAS-5382** by upgrading the `react-router` and 
`react-router-dom` dependencies in the Atlas React UI (`/dashboard`) from `v6` 
to the latest `v7`. 
   
   Upgrading to version 7 introduced a known issue with the Jest test 
environment (`jsdom`), which does not natively expose the `TextEncoder` and 
`TextDecoder` globals that the modern router relies on, causing the test suite 
to crash immediately upon importing routing components.
   
   To safely migrate to v7 while keeping the test suite green, this PR includes 
the following changes:
   
   1. **`package.json` / `package-lock.json`**: Bumped `react-router` and 
`react-router-dom` to `^7.18.2`.
   2. **`src/setupTests.simple.ts`**: Added explicit polyfills for 
`TextEncoder` and `TextDecoder` (imported from the Node.js native `util` 
module) into the global test environment. This ensures full compatibility with 
`react-router-dom` v7 under Jest's `jsdom`.
   
   *(Note: There were no code-level deprecations or breaking API changes that 
affected our React components. All `useNavigate`, `useLocation`, `<Routes>`, 
and `<Route>` implementations remain fully compatible with v7).*
   
   ## How was this patch tested?
   
   **Build & Type Tests:**
   * Ran `npm install` and `npm run build` to ensure the TypeScript compiler 
successfully builds the app without any type errors or API deprecation warnings 
from the new router version.
   
   **Unit Tests (Resolving the Jest crash):**
   * Ran `npm run test` across the entire `/dashboard` directory. 
   * Verified that the `TextEncoder` polyfill successfully intercepts the 
router imports and that all 189 test suites and 4,790 tests pass with a 100% 
success rate, proving identical backwards compatibility with our v6 component 
usage.
   
   **Manual UI Verification:**
   * Started the local Vite dev server and verified that the client-side router 
functions correctly in the browser. Navigated between main tabs (Administrator, 
Search, Entities, Lineage) to ensure the URL updates and views render as 
expected.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to