-
Notifications
You must be signed in to change notification settings - Fork 9
Uds 1663 check element changes #1601
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Conversation
update check changes compare file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces a new tool for tracking component HTML changes over time and fixes server-side rendering compatibility issues across multiple packages. The main addition is the check-element-changes script that compares component HTML output between different time periods to detect visual changes.
- Adds new
check-element-changesscript with supporting utilities for server-side component rendering - Fixes SSR compatibility issues in DOMPurify initialization and test setups
- Updates component mocks and test configurations to support the new tooling
Reviewed Changes
Copilot reviewed 14 out of 17 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/unity-react-core/vite.config.js | Updates global definition to use globalThis for better SSR compatibility |
| packages/unity-react-core/tsx.config.json | New TypeScript configuration for tsx runtime with image loader settings |
| packages/unity-react-core/tsconfig.json | Expands TypeScript scope to include scripts directory |
| packages/unity-react-core/tests/dataLayer.spec.mjs | Adds wait condition to ensure accordion elements are ready before testing |
| packages/unity-react-core/scripts/server-utils.js | New utility for initializing JSDOM environment for server-side rendering |
| packages/unity-react-core/scripts/image-loader.js | New custom loader to handle image imports in Node.js |
| packages/unity-react-core/scripts/check-element-changes.js | Main script for comparing component HTML between time periods |
| packages/unity-react-core/scripts/check-changes.tsx | Component rendering script that generates HTML snapshots for comparison |
| packages/static-site/src/pages/Home.tsx | Adds required type prop to Divider components |
| packages/shared/utils/html-utils.js | Refactors DOMPurify initialization to support SSR |
| packages/shared/utils/html-utils.d.ts | Updates type definition to allow null return value |
| packages/component-header-footer/setupTests.js | Adds TextEncoder polyfill for test environment |
| packages/app-degree-pages/vitest.setup.ts | Imports new unity-react-core mock |
| packages/app-degree-pages/mocks/unity-react-core-mock.jsx | Simplifies mock by removing unused imports and adding missing component mocks |
| package.json | Updates script path and adds new dependencies (diff, tsx) |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
Storybook deployed at https://unity-uds-staging.s3.us-west-2.amazonaws.com/pr-1601/index.html |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This pr adds the new check-element-changes too along with fixing the necessary packages that had errors when rendered in a server environment
Description
Checklist
Important Reminders
Links