Skip to content

refactor: make ImageBundlePlugin.imageBundles private#1052

Merged
redfish4ktc merged 1 commit into
mainfrom
refactor/ImageBundlePlugin_private_imageBundles_prop
Apr 27, 2026
Merged

refactor: make ImageBundlePlugin.imageBundles private#1052
redfish4ktc merged 1 commit into
mainfrom
refactor/ImageBundlePlugin_private_imageBundles_prop

Conversation

@redfish4ktc

@redfish4ktc redfish4ktc commented Apr 27, 2026

Copy link
Copy Markdown

The property is plugin-internal state; exposing it on the public API serves no caller use case and locks the implementation to today's array shape. Tests still need to inspect it, so they use a local internals() cast helper defined inside the test file — production code, stories, and downstream consumers cannot reach the property through the type system.

Not a breaking change: ImageBundlePlugin was introduced in c3e4de1 and has not been released.

Notes

Generated with Claude Code (claude-opus-4-7).

The property is plugin-internal state; exposing it on the public API serves no caller use case and locks the
implementation to today's array shape. Tests still need to inspect it, so they use a local `internals()` cast helper
defined inside the test file — production code, stories, and downstream consumers cannot reach the property through the
type system.

Not a breaking change: ImageBundlePlugin was introduced in c3e4de1 and has not been released.

Generated with Claude Code (claude-opus-4-7).
@redfish4ktc redfish4ktc added refactor Code refactoring skip-changelog Do not include in Changelog and Release Notes labels Apr 27, 2026
@coderabbitai

coderabbitai Bot commented Apr 27, 2026

Copy link
Copy Markdown

Walkthrough

The imageBundles field in ImageBundlePlugin is changed from public to private. Tests are updated to access the now-private field through a type-cast helper function that exposes internal properties for testing purposes.

Changes

Cohort / File(s) Summary
Field Encapsulation
packages/core/src/view/plugin/ImageBundlePlugin.ts
Changed imageBundles field from public to private, restricting external access to the bundle collection while preserving internal functionality.
Test Updates
packages/core/__tests__/view/plugin/ImageBundlePlugin.test.ts
Updated all test assertions to access the private imageBundles field via an internals() type-cast helper function, covering equality checks, array identity, length/index access, and removal behavior validations.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description addresses the change and rationale but lacks formal structure and completeness against the required template. Add PR checklist items (issue reference, scope confirmation, test verification, breaking change notice), and expand the Overview section with more structured details about the problem and solution.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main change: making ImageBundlePlugin.imageBundles private.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@sonarqubecloud

Copy link
Copy Markdown

@redfish4ktc redfish4ktc merged commit 5f189e7 into main Apr 27, 2026
14 checks passed
@redfish4ktc redfish4ktc deleted the refactor/ImageBundlePlugin_private_imageBundles_prop branch April 27, 2026 09:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactor Code refactoring skip-changelog Do not include in Changelog and Release Notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant