Skip to content

Conversation

@rururux
Copy link
Contributor

@rururux rururux commented Jan 17, 2026

Changes

As discussed in the issue #14515 and #15067, the current implementation of inferRemoteSize had the problem of increased network traffic because it did not cache data.
To address this issue, I added a getRemoteSize property to the Image Service and implemented the publicly exposed inferRemoteSize API to utilize this property.
Additionally, for baseService's getRemoteSize, I configured a function that simply wraps the existing inferRemoteSize. This ensures no breaking changes occur for users who do not wish to see their behavior altered.

  • Set getRemoteSize as an API of the Image Service.
  • Modified the publicly exposed inferRemoteSize function to utilize the Image Service's getRemoteSize.
  • Assigned the existing inferRemoteSize function to baseService's getRemoteSize. This prevents breaking changes and facilitates easy, lightweight extensions based on the existing implementation.

Testing

I implemented tests to verify that arbitrary processing can be configured and that delegation from baseService to the original inferRemoteSize is possible.

Docs

Since we are setting the existing inferRemoteSize as the default value, I don't believe this constitutes a breaking change. However, since we will be introducing a new property called getRemoteSize in the Image Service, I think the documentation will need to be updated.

/cc @withastro/maintainers-docs

As this is a PR introducing a new property, I would like to hear the opinions of the maintainers regarding this approach. Therefore, I will submit this PR as a draft for now.

@changeset-bot
Copy link

changeset-bot bot commented Jan 17, 2026

⚠️ No Changeset found

Latest commit: b9f0424

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions github-actions bot added the pkg: astro Related to the core `astro` package (scope) label Jan 17, 2026
@codspeed-hq
Copy link

codspeed-hq bot commented Jan 17, 2026

Merging this PR will not alter performance

✅ 9 untouched benchmarks


Comparing rururux:infer-remote-size (b9f0424) with main (9a609f4)1

Open in CodSpeed

Footnotes

  1. No successful run was found on main (2219b5e) during the generation of this report, so 9a609f4 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pkg: astro Related to the core `astro` package (scope)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant