Skip to content

Conversation

@ematipico
Copy link
Member

Changes

Due to some mistake we've made, the utility function emitESMImage - which is exposed as public API - is broken.

To remedy the mistake, we will expose a new function to userland, which has a different signature (we removed the things we don't need).

I updated @astrojs/mdx to use the new function.

Testing

CI should stay green

Docs

I will send a PR to update the docs.

/cc @withastro/maintainers-docs for feedback!

@changeset-bot
Copy link

changeset-bot bot commented Apr 9, 2025

🦋 Changeset detected

Latest commit: 1c237ff

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 pkg: integration Related to any renderer integration (scope) pkg: astro Related to the core `astro` package (scope) labels Apr 9, 2025
@codspeed-hq
Copy link

codspeed-hq bot commented Apr 9, 2025

CodSpeed Performance Report

Merging #13589 will not alter performance

Comparing chore/deprecate-function (04cdb87) with main (7d251c1)

Summary

✅ 6 untouched benchmarks

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.

Just wanted to jump in here quickly since there's the potential for this change to affect users and break their stuff. 😄 In that case I always recommend providing a bit more information, so here's an example of what could be helpful, for your consideration!

Co-authored-by: Sarah Rainsberger <[email protected]>
@ascorbic
Copy link
Contributor

ascorbic commented Apr 9, 2025

In what way is it broken? This is the function we use internally in lots of others place, not just in the markdoc plugin. If we're deprecating it we should update those usages too.

@ematipico
Copy link
Member Author

ematipico commented Apr 9, 2025

If we're deprecating it we should update those usages too.

The deprecation is for the users. We still need to use that function internally to block the memory leak, and unfortunately, we can't rename it or change the exporting strategy.

The memory leak is currently blocked by the experimental flag passed to emitESMImage. In fact, I think I will revert the change in @astrojs/mdx, until we fix the memory leak.

@github-actions github-actions bot removed the pkg: integration Related to any renderer integration (scope) label Apr 9, 2025
@ascorbic
Copy link
Contributor

ascorbic commented Apr 9, 2025

It'll show as deprecated for internal use too though, right? I think best is to re-export it from packages/astro/src/assets/utils/index.ts with the deprecation in a different JSDoc

@ematipico
Copy link
Member Author

See if that's what you want: 5dda4da (#13589)

@ascorbic
Copy link
Contributor

ascorbic commented Apr 9, 2025

Yeah, that works. Might be worth adding a note saying to use emitImageMetadata instead

@ematipico
Copy link
Member Author

ematipico commented Apr 9, 2025

@sarah11918 can you please revisit the changeset again? I changed the last sentence to address Matt's comment

Co-authored-by: Sarah Rainsberger <[email protected]>
@ematipico ematipico merged commit 5a0563d into main Apr 9, 2025
16 checks passed
@ematipico ematipico deleted the chore/deprecate-function branch April 9, 2025 13:53
@astrobot-houston astrobot-houston mentioned this pull request Apr 9, 2025
openscript pushed a commit to openscript/astro that referenced this pull request Sep 12, 2025
Co-authored-by: Sarah Rainsberger <[email protected]>


Co-authored-by: ascorbic <[email protected]>
Co-authored-by: sarah11918 <[email protected]>
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.

3 participants