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

feat(assets): Delete original assets unused outside of the optimization pipeline #8954

Merged
merged 8 commits into from
Nov 8, 2023

Conversation

Princesseuh
Copy link
Member

Changes

What the title says. On the technical level, this works by making images Proxies, whenever any property of an image is referred to directly we add the image to a list of images to not delete.

Fix #8143

Testing

Tests should pass!

Docs

N/A, we didn't document that they stayed there before.

@changeset-bot
Copy link

changeset-bot bot commented Oct 30, 2023

🦋 Changeset detected

Latest commit: 023be5d

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: astro Related to the core `astro` package (scope) pr: docs A PR that includes documentation for review semver: minor Change triggers a `minor` release labels Oct 30, 2023
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.

Copy link
Contributor

@matthewp matthewp left a comment

Choose a reason for hiding this comment

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

clever

Copy link
Member

@natemoo-re natemoo-re left a comment

Choose a reason for hiding this comment

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

LGTM! Very nice use of Proxy. You could get rid of the // @ts-expect-error but it's not a huge deal.

packages/astro/src/assets/internal.ts Show resolved Hide resolved
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 turned this into something that could go in the blog post!

.changeset/nasty-elephants-provide.md Outdated Show resolved Hide resolved
@sarah11918 sarah11918 removed the pr: docs A PR that includes documentation for review label Nov 6, 2023
@github-actions github-actions bot added the pr: docs A PR that includes documentation for review label Nov 7, 2023
@Princesseuh Princesseuh merged commit f0031b0 into main Nov 8, 2023
@Princesseuh Princesseuh deleted the feat/delete-original-assets branch November 8, 2023 09:23
@astrobot-houston astrobot-houston mentioned this pull request Nov 8, 2023
natemoo-re pushed a commit that referenced this pull request Nov 22, 2023
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) pr: docs A PR that includes documentation for review semver: minor Change triggers a `minor` release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Exclude original images from output dir
4 participants