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

Image integration refactor and cleanup #4482

Merged
merged 32 commits into from
Aug 30, 2022
Merged

Conversation

tony-sull
Copy link
Contributor

@tony-sull tony-sull commented Aug 25, 2022

Changes

  • Images in /public can now be used like remote images 🎉
<!-- The image will now be pulled in from /public/hero.jpg -->
<Image src="/hero.jpg" width={768} height={414} format="webp" />
  • Moves work for reading local image files into Vite (where it belongs)
  • Removes most of Node dependencies that get bundled into the SSR bundle (deno support coming soon!)
  • Removes the nasty glob that the SSR build was doing
  • Simplifies the injected endpoint routes, mainly due to leaning further into Vite

Testing

Tests updated to match the new logic, mainly related to output filenames including Vite hashes

Docs

README updated with a few details on using /public images

@changeset-bot
Copy link

changeset-bot bot commented Aug 25, 2022

🦋 Changeset detected

Latest commit: 11f16fa

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

This PR includes changesets to release 1 package
Name Type
@astrojs/image Minor

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: integration Related to any renderer integration (scope) label Aug 25, 2022
@tony-sull tony-sull marked this pull request as ready for review August 26, 2022 15:51
@tony-sull tony-sull changed the title WIP: Image integration refactor and cleanup Image integration refactor and cleanup Aug 26, 2022
@tony-sull tony-sull marked this pull request as draft August 28, 2022 16:00
@tony-sull
Copy link
Contributor Author

Flipping this back to draft to test out a few more potential optimizations

@tony-sull tony-sull force-pushed the feat/images-vite-plugin branch from 279be90 to c1ba2e9 Compare August 29, 2022 22:20
@tony-sull tony-sull self-assigned this Aug 30, 2022
@tony-sull tony-sull marked this pull request as ready for review August 30, 2022 19:27
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.

Ooh, you're gonna make lots of people happy, @tony-sull 🥳

Left some suggestions for your consideration! Including a reminder that you can set a file name for a code sample and get a fancy Hippo title tab for your snippet.

packages/integrations/image/README.md Outdated Show resolved Hide resolved
packages/integrations/image/README.md Outdated Show resolved Hide resolved
Tony Sullivan and others added 3 commits August 30, 2022 20:23
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
@tony-sull tony-sull merged commit 00c605c into main Aug 30, 2022
@tony-sull tony-sull deleted the feat/images-vite-plugin branch August 30, 2022 21:09
@astrobot-houston astrobot-houston mentioned this pull request Aug 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg: integration Related to any renderer integration (scope)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants