Skip to content
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

Release #1908

Merged
merged 2 commits into from
Feb 27, 2025
Merged

Release #1908

merged 2 commits into from
Feb 27, 2025

Conversation

wang1212
Copy link
Member

No description provided.

wang1212 and others added 2 commits February 24, 2025 13:40
* fix: image element rendering triggers an exception

* chore: add image bugfix demo #1906
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Copy link

Walkthrough

This pull request introduces several changes across multiple packages, primarily focusing on updating dependencies and fixing issues related to image rendering. It includes changes to ESLint configurations, test cases for bug fixes, and updates to changelogs and package.json files for various packages.

Changes

Files Summary
.eslintrc.cjs Added a rule to warn on console usage, allowing 'warn' and 'error'.
tests/demos/bugfix/1906.ts, tests/demos/bugfix/index.ts Added a test case for issue 1906 and updated exports.
packages/*/CHANGELOG.md Added patch changes and updated dependencies for multiple packages.
packages/*/package.json Updated dependencies and version numbers for multiple packages.
packages/g-plugin-canvas-renderer/src/shapes/styles/Image.ts Fixed image rendering issues by handling exceptions and ensuring objects are part of the DOM tree before rendering.
packages/g-plugin-image-loader/src/ImagePool.ts Improved error handling by logging errors to the console.


// remove && expect no error
requestAnimationFrame(() => {
image.remove();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The variable image is used before it is defined. This will lead to a runtime error. Consider defining image before using it in the requestAnimationFrame callback.

@@ -244,7 +254,9 @@ export class ImageRenderer extends DefaultRenderer {
imageRect,
drawRect,
});
} catch {}
} catch {
// expected error

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Catching an empty block without handling or logging the error might lead to silent failures. Consider logging the error or handling it appropriately to avoid missing critical issues.

@wang1212 wang1212 merged commit c17534b into master Feb 27, 2025
4 checks passed
@wang1212 wang1212 deleted the release branch February 27, 2025 08:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant