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

Expose inferRemoteSize function #11098

Merged
merged 16 commits into from
Jul 17, 2024

Conversation

itsmatteomanf
Copy link
Contributor

@itsmatteomanf itsmatteomanf commented May 18, 2024

Changes

This change exposes the old inferSize(), renamed to inferRemoteSize() per https://discord.com/channels/830184174198718474/1240790957591367701.

Testing

No additional testing needed, it was never tested directly.

Docs

withastro/docs#8808

Copy link

changeset-bot bot commented May 18, 2024

🦋 Changeset detected

Latest commit: 934a54f

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

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

@github-actions github-actions bot added the pkg: astro Related to the core `astro` package (scope) label May 18, 2024
@github-actions github-actions bot added the semver: minor Change triggers a `minor` release label May 27, 2024
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

This PR is blocked because it contains a minor changeset. A reviewer will merge this at the next release if approved.

@Princesseuh
Copy link
Member

Refactored it a bit, the only thing missing will be adding better error messages now that this is exposed and stuff. I'll do that later, thank you for contributing!

@itsmatteomanf
Copy link
Contributor Author

Thank you, as always, @Princesseuh!

@ematipico
Copy link
Member

@itsmatteomanf please ping me when this PR is ready to be shipped. Do you think it will be ready for the next minor?

@itsmatteomanf
Copy link
Contributor Author

@ematipico as far as I am concerned it's ready, I know @Princesseuh had some changes in mind though, but said she was going to do them herself...

@Princesseuh
Copy link
Member

Yeah, will tackle when I'm back from holidays if no one does. The changes required are just making the errors better, now that the feature is exposed. Docs might be great as well!

@Princesseuh Princesseuh added this to the 4.12.0 milestone Jul 12, 2024
Copy link
Member

@sarah11918 sarah11918 left a comment

Choose a reason for hiding this comment

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

Blocking this while we figure out what docs are needed!

The current docs for inferSize are here: https://docs.astro.build/en/guides/images/#infersize so this would be a place to check.

Also checking that we don't need any new error messages associated with making this available to users now?

Additionally, adding the necessary context (why this PR was made, what this allows you to do) inside the PR description rather than linking to a Discord message (not publicly available) is helpful! This would have helped me suggest an appropriate changeset message.

.changeset/large-geese-play.md Outdated Show resolved Hide resolved
@Princesseuh
Copy link
Member

Hmm, okay there's a problem with exporting it from astro:assets, i'll keep investigating and see if I can fix this before release.

Copy link
Member

@sarah11918 sarah11918 left a comment

Choose a reason for hiding this comment

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

Fantastic example, thank you @Princesseuh ! One quick thought for your consideration, but happy for you to make the final call.

.changeset/large-geese-play.md Outdated Show resolved Hide resolved
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
@Princesseuh Princesseuh dismissed sarah11918’s stale review July 16, 2024 10:44

Did the docs and the changeset!

@@ -1,4 +1,4 @@
export { emitESMImage } from './emitAsset.js';
export { emitESMImage } from './node/emitAsset.js';
Copy link
Member

Choose a reason for hiding this comment

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

So this is annoying, emitAsset (obviously) isn't non-Node safe, but I exported it from the utils without thinking a while ago, and now it means that astro:assets can't actually import from astro/assets/utils otherwise it breaks runtime.

For now, I moved emitAsset to its own folder to reduce damage, and in the future I'll update the Markdoc integration and stuff to import it from the proper place.

Copy link
Member

@sarah11918 sarah11918 left a comment

Choose a reason for hiding this comment

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

Approving for Docs!

Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
@matthewp matthewp merged commit 36e30a3 into withastro:main Jul 17, 2024
14 checks passed
@astrobot-houston astrobot-houston mentioned this pull request Jul 17, 2024
ematipico pushed a commit that referenced this pull request Jul 18, 2024
* feat: expose and rename `inferSize`

* feat: separate `ISize` type

* feat: reformat function to use `ImageMetadata`

* nit(assets): re-use image-metadata code for remote images

* chore: changeset

* chore: changeset

* feat(assets): Export from `astro:assets`

* fix: proper errors

* fix: dont export from astro/assets

* fix: ests

* Update .changeset/large-geese-play.md

Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>

* fix: ests

* Update .changeset/large-geese-play.md

Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>

---------

Co-authored-by: Erika <3019731+Princesseuh@users.noreply.github.com>
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
@astrobot-houston astrobot-houston mentioned this pull request Jul 18, 2024
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) semver: minor Change triggers a `minor` release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants