Currently, @astrojs/image allows *importing* images from srcDir
only. Importing images from outside srcDir fails miserably *in dev
mode* and produces incorrect src.
This happens because `path.relative(fileURLToPath(config.srcDir), id)`
resolves to "../something" and when joined with '/@astroimage' cancels
it out (`join('/@astroimage', '../../something')` => `'/something'`).
Rework /@astroimage URL scheme to be similar to "/@fs/" scheme—always
export absolute path to the target file.
* [ci] release
* Update changelogs (#5955)
* [ci] release
* Wrap astro 2.0 beta logs in `<details>`
* Add link to docs upgrade guide
* First pass cleaning up 2.0 release notes
* mdx changes from Sarah
* combine 5584 and 5842 in deno, image, netlify
* markdown/remark incl (5684 & 5769) to match mdx
* Tweak markdown/remark formatting
* Format astro-prism
* Format astro-rss
* Format create-astro
* Format cloudflare
* Format lit
* Format partytown
* Format node
* Format preact
* Format react
* Format solid
* Format svelte
* Format tailwind
* Format vercel
* Format vue
* Format telemetry
* Format webapi
* Format scripts
* Reinstate h3s for headings
Co-authored-by: Ben Holmes <hey@bholmes.dev>
* Reformat mdx
* astro & markdown/remark: Combine #5679 & #5684 changelogs
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Chris Swithinbank <swithinbank@gmail.com>
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
Co-authored-by: Ben Holmes <hey@bholmes.dev>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Matthew Phillips <matthew@skypack.dev>
Co-authored-by: Chris Swithinbank <swithinbank@gmail.com>
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
Co-authored-by: Ben Holmes <hey@bholmes.dev>
* fix(image): Remove unnecessary polyfill now that we dropped Node 14
* fix(squoosh): Remove fetch of local wasm binary since undici doesn't support that
* chore: changeset
* Add Astro as a peerDependency
* Add changeset
* Update .changeset/thin-seahorses-worry.md
Co-authored-by: Bjorn Lu <bjornlu.dev@gmail.com>
Co-authored-by: Bjorn Lu <bjornlu.dev@gmail.com>
* WIP: adding a service built on @squoosh/lib
* WIP: investigating memory leaks in Squoosh
* WIP: vendoring Squoosh to work with our build
* chore: a bit of cleanup and a small perf gain
* removing a few unused deps
* fix: removing temp .only() in sharp test
* hooking up the last build steps to copy over .wasm files
* removing the duplicated lib/*.wasm files
* defaulting to Sharp for the initial @next release
* make sure pnpm always runs the postbuild script
* removing a few node dependencies
* refactor: move the copy .wasm build step out of the SSR bundle
* linter fixes
* fixing lock file
* chore: add TEMP changeset
* fix built wasm location for SSG builds
* Revert "defaulting to Sharp for the initial @next release"
This reverts commit 1a8d4f7f60.
* removing sharp dependency
* Revert "fix built wasm location for SSG builds"
This reverts commit 446b80bb53.
* chore: update lockfile
* fixing up image tests for the wasm loader
* updating the README for squoosh
* parallel wasm builds
* refactor: a bit of house keeping
* perf: allow a thread for each output encoding format
* fix: dev broke with the shift to wasm workers
* adds a new `astro:build:generated` hook for SSG builds
* fix: typo + calling cleanup methods in wasm codecs
* adding @astrojs/webapi for the TransformStream polyfill
* Revert "adding @astrojs/webapi for the TransformStream polyfill"
This reverts commit 39e5b845a5.
* perf: using sharp for most of the CI tests
* chore: update lockfile
* removing hard-coded squoosh imports
* fix: adding sharp to rollup externals
* test: using dev for the squoosh tests
* fix: updating the build output dir for wasm filles in SSG builds
* updating the changeset with migration details
* Revert "adds a new `astro:build:generated` hook for SSG builds"
This reverts commit 59b5fec7be.
* nit: adding comments for the wasm file copy
* chore: fix eslint warning
* WIP: simplifying the use of `fs` vs. the vite plugin
* removing a few node deps (etag and node:path)
* adding ts defs for sharp
* using the same mime package as astro's core App
* fixing file URL support in windows
* using file URLs when loading local image metadata
* fixing a bug in the etag helper
* Windows compat
* splitting out dev & build tests
* why do these suites fail in parallel?
* one last windows compat case
* Adding tests for treating /public images the same as remote URLs
* a couple fixes for Astro's `base` config
* adding base path tests for SSR
* fixing a bad merge, lost the kleur dependency
* adding a test suite for images + MDX
* chore: add changeset
* simplifying the with-mdx tests
* bugfix: don't duplicate the period when using existing file extensions
* let Vite cache the image loader service
* adding some docs for using /public images
* fixing changeset
* Update packages/integrations/image/README.md
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
* Update packages/integrations/image/README.md
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
* nit: minor README syntax tweaks
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>