Closed ya6 closed 14 hours ago
The recent updates primarily involve enhancements to the Image
component and its utility functions to handle image formats better and ensure robust state initialization. Key adjustments include the introduction of a new checkIfSvg
utility, changes to the import statements, and additional logic for state handling based on environment variables and image format checks.
File | Change Summary |
---|---|
src/shared/ui/image/image.tsx |
Updated imports, added checkIfSvg utility, and modified srcSet and sizes state initialization. |
src/shared/ui/image/utils/checkIfSvg.ts |
Introduced a new function to check if an image URL ends with .svg . |
src/shared/ui/image/utils/convertToWebp.ts |
Converted convertToWebp from a default export to a named exported constant. |
src/shared/ui/image/utils/generateSizes.ts |
Modified generateSizes to be a named exported function. |
src/shared/ui/image/utils/generateSrcSet.ts |
Changed generateSrcSet from a default export to a named export. |
Sequence diagrams are not applicable for these changes as they mainly include small adjustments and refactoring rather than new features or complex control flows.
Objective (Issue #) | Addressed | Explanation |
---|---|---|
Fix the error in console when browser window is small (#264) | β |
A code so sleek in image fair, To thwart the errors hiding there, With checks for SVGs in sight, And states that initialize just right, For bugs we bid a swift goodbye, As windows small, our code will fly! π°π
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
It seems all right π
No new problems were found according to the checks applied
π‘ Qodana analysis was run in the pull request mode: only the changed files were checked βοΈ View the detailed Qodana report
Please, merge master branch
Lighthouse Report:
Lighthouse Report:
Lighthouse Report:
Lighthouse Report:
Lighthouse Report:
In my opinion the approach works like a "silver bullet" with the presence of this error After trying several approaches, in the latest version of the files I suggest:
Lighthouse Report:
It seems all right π
No new problems were found according to the checks applied
π‘ Qodana analysis was run in the pull request mode: only the changed files were checked βοΈ View the detailed Qodana report
Lighthouse Report:
Lighthouse Report:
Lighthouse Report:
What type of PR is this? (select all that apply)
Description
In my opinion the approach works like a "silver bullet" with the presence of this error
After trying several approaches, in the latest version of the files I suggest:
Related Tickets & Documents
Screenshots, Recordings
Added/updated tests?
Summary by CodeRabbit
New Features
srcSet
andsizes
attributes for better image loading capabilities.Improvements