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): Add support for srcset and a Picture component #8620

Merged
merged 18 commits into from
Oct 11, 2023

Conversation

Princesseuh
Copy link
Member

@Princesseuh Princesseuh commented Sep 21, 2023

Changes

This implements the following RFC: withastro/roadmap#715. Please refer to it for more details on how the feature work.

Testing

Added tests

Docs

withastro/docs#4866

@changeset-bot
Copy link

changeset-bot bot commented Sep 21, 2023

🦋 Changeset detected

Latest commit: 41f5fc6

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 Sep 21, 2023
@github-actions github-actions bot added the semver: minor Change triggers a `minor` release label Sep 22, 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.

@Princesseuh
Copy link
Member Author

!preview picture

@github-actions
Copy link
Contributor

 > [email protected] release /home/runner/work/astro/astro > pnpm run build && changeset publish "--tag" "next--picture" > [email protected] build /home/runner/work/astro/astro > turbo run build --filter=astro --filter=create-astro --filter="@astrojs/*" --filter="@benchmark/*" �[2m• Packages in scope: @astrojs/alpinejs, @astrojs/cloudflare, @astrojs/deno, @astrojs/internal-helpers, @astrojs/lit, @astrojs/markdoc, @astrojs/markdown-remark, @astrojs/mdx, @astrojs/netlify, @astrojs/node, @astrojs/partytown, @astrojs/preact, @astrojs/prefetch, @astrojs/prism, @astrojs/react, @astrojs/rss, @astrojs/sitemap, @astrojs/solid-js, @astrojs/svelte, @astrojs/tailwind, @astrojs/telemetry, @astrojs/underscore-redirects, @astrojs/vercel, @astrojs/vue, @benchmark/timer, astro, create-astro�[0m �[2m• Running�[0m �[2m�[1mbuild�[0m�[0m �[2min 27 packages�[0m �[2m• Remote caching enabled�[0m ::group::@astrojs/internal-helpers:build cache miss, executing �[2mdf798871feefe924�[0m > @astrojs/[email protected] build /home/runner/work/astro/astro/packages/internal-helpers > astro-scripts build "src/**/*.ts" && tsc -p tsconfig.json ::endgroup:: ::group::@astrojs/telemetry:build cache miss, executing �[2mb86db6349ed39fb4�[0m > @astrojs/[email protected] build /home/runner/work/astro/astro/packages/telemetry > astro-scripts build "src/**/*.ts" && tsc ::endgroup:: ::group::@astrojs/prism:build cache miss, executing �[2m0769371196f7d120�[0m > @astrojs/[email protected] build /home/runner/work/astro/astro/packages/astro-prism > astro-scripts build "src/**/*.ts" && tsc -p ./tsconfig.json ::endgroup:: ::group::create-astro:build cache miss, executing �[2m46484fc9249b86cc�[0m > [email protected] build /home/runner/work/astro/astro/packages/create-astro > astro-scripts build "src/index.ts" --bundle && tsc ::endgroup:: ::group::@astrojs/markdown-remark:build cache miss, executing �[2m1179abc98b9dcb97�[0m > @astrojs/[email protected] build /home/runner/work/astro/astro/packages/markdown/remark > astro-scripts build "src/**/*.ts" && tsc -p tsconfig.json ::endgroup:: ::group::astro:build cache miss, executing �[2mc82cec666781c358�[0m > [email protected] build /home/runner/work/astro/astro/packages/astro > pnpm run prebuild && astro-scripts build "src/**/*.{ts,js}" && tsc && pnpm run postbuild > [email protected] prebuild /home/runner/work/astro/astro/packages/astro > astro-scripts prebuild --to-string "src/runtime/server/astro-island.ts" "src/runtime/client/{idle,load,media,only,visible}.ts" > [email protected] postbuild /home/runner/work/astro/astro/packages/astro > astro-scripts copy "src/**/*.astro" && astro-scripts copy "src/**/*.wasm" ::endgroup:: ::group::@astrojs/underscore-redirects:build cache miss, executing �[2mf000c045fabe4cfa�[0m > @astrojs/[email protected] build /home/runner/work/astro/astro/packages/underscore-redirects > astro-scripts build "src/**/*.ts" && tsc -p tsconfig.json ::endgroup:: ::group::@astrojs/lit:build cache miss, executing �[2mb8bfcec597f6ab83�[0m > @astrojs/[email protected] build /home/runner/work/astro/astro/packages/integrations/lit > astro-scripts build "src/**/*.ts" && tsc ::endgroup:: ::group::@benchmark/timer:build cache miss, executing �[2mdb344dd451f181eb�[0m > @benchmark/[email protected] build /home/runner/work/astro/astro/benchmark/packages/timer > astro-scripts build "src/**/*.ts" && tsc ::endgroup:: ::group::@astrojs/partytown:build cache miss, executing �[2mfe56b2ef92d5facf�[0m > @astrojs/[email protected] build /home/runner/work/astro/astro/packages/integrations/partytown > astro-scripts build "src/**/*.ts" && tsc ::endgroup:: ::group::@astrojs/react:build cache miss, executing �[2m259595fd0b1ad06b�[0m > @astrojs/[email protected] build /home/runner/work/astro/astro/packages/integrations/react > astro-scripts build "src/**/*.ts" && tsc ::endgroup:: ::group::@astrojs/solid-js:build cache miss, executing �[2m6ee435aab9d142fb�[0m > @astrojs/[email protected] build /home/runner/work/astro/astro/packages/integrations/solid > astro-scripts build "src/**/*.ts" && tsc ::endgroup:: ::group::@astrojs/vercel:build cache miss, executing �[2m6378fd5d340bb16e�[0m > @astrojs/[email protected] build /home/runner/work/astro/astro/packages/integrations/vercel > astro-scripts build "src/**/*.ts" && tsc ::endgroup:: ::group::@astrojs/mdx:build cache miss, executing �[2m36129ebc2ad1fc36�[0m > @astrojs/[email protected] build /home/runner/work/astro/astro/packages/integrations/mdx > astro-scripts build "src/**/*.ts" && tsc ::endgroup:: ::group::@astrojs/markdoc:build cache miss, executing �[2m88d73abcba2d1b30�[0m > @astrojs/[email protected] build /home/runner/work/astro/astro/packages/integrations/markdoc > astro-scripts build "src/**/*.ts" && tsc ::endgroup:: ::group::@astrojs/svelte:build cache miss, executing �[2mfba34f2ca66f8be8�[0m > @astrojs/[email protected] build /home/runner/work/astro/astro/packages/integrations/svelte > astro-scripts build "src/index.ts" && astro-scripts build "src/editor.cts" --force-cjs --no-clean-dist && tsc ::endgroup:: ::group::@astrojs/tailwind:build cache miss, executing �[2m2f6fa94e8f27e332�[0m > @astrojs/[email protected] build /home/runner/work/astro/astro/packages/integrations/tailwind > astro-scripts build "src/**/*.ts" && tsc ::endgroup:: ::group::@astrojs/alpinejs:build cache miss, executing �[2m0e45dc38fbef337d�[0m > @astrojs/[email protected] build /home/runner/work/astro/astro/packages/integrations/alpinejs > astro-scripts build "src/**/*.ts" && tsc ::endgroup:: ::group::@astrojs/prefetch:build cache miss, executing �[2m16857ffc3bf230f2�[0m > @astrojs/[email protected] build /home/runner/work/astro/astro/packages/integrations/prefetch > astro-scripts build "src/**/*.ts" && tsc ::endgroup:: ::group::@astrojs/rss:build cache miss, executing �[2mb797d7a169d12e51�[0m > @astrojs/[email protected] build /home/runner/work/astro/astro/packages/astro-rss > astro-scripts build "src/**/*.ts" && tsc ::endgroup:: ::group::@astrojs/node:build cache miss, executing �[2mde6e5815f6f94763�[0m > @astrojs/[email protected] build /home/runner/work/astro/astro/packages/integrations/node > astro-scripts build "src/**/*.ts" && tsc ::endgroup:: ::group::@astrojs/vue:build cache miss, executing �[2mc70e6d6d3e1def75�[0m > @astrojs/[email protected] build /home/runner/work/astro/astro/packages/integrations/vue > astro-scripts build "src/index.ts" && astro-scripts build "src/editor.cts" --force-cjs --no-clean-dist && tsc ::endgroup:: ::group::@astrojs/deno:build cache miss, executing �[2m78b546e4e516028a�[0m > @astrojs/[email protected] build /home/runner/work/astro/astro/packages/integrations/deno > astro-scripts build "src/**/*.ts" && tsc ::endgroup:: ::group::@astrojs/preact:build cache miss, executing �[2mf1911042d40e87f4�[0m > @astrojs/[email protected] build /home/runner/work/astro/astro/packages/integrations/preact > astro-scripts build "src/**/*.ts" && tsc ::endgroup:: ::group::@astrojs/netlify:build cache miss, executing �[2m750db866a9fcc8ba�[0m > @astrojs/[email protected] build /home/runner/work/astro/astro/packages/integrations/netlify > astro-scripts build "src/**/*.ts" && tsc ::endgroup:: ::group::@astrojs/cloudflare:build cache miss, executing �[2md3f689093fd0c306�[0m > @astrojs/[email protected] build /home/runner/work/astro/astro/packages/integrations/cloudflare > astro-scripts build "src/**/*.ts" && tsc ::endgroup:: ::group::@astrojs/sitemap:build cache miss, executing �[2m12a030776b2cd281�[0m > @astrojs/[email protected] build /home/runner/work/astro/astro/packages/integrations/sitemap > astro-scripts build "src/**/*.ts" && tsc ::endgroup:: Tasks: 27 successful, 27 total Cached: 0 cached, 27 total Time: 1m16.147s 🦋 �[33mwarn�[39m �[31m===============================IMPORTANT!===============================�[39m 🦋 �[33mwarn�[39m Packages will be released under the next--picture tag 🦋 �[33mwarn�[39m �[31m----------------------------------------------------------------------�[39m 🦋 �[36minfo�[39m npm info astro 🦋 �[36minfo�[39m npm info @astrojs/prism 🦋 �[36minfo�[39m npm info @astrojs/rss 🦋 �[36minfo�[39m npm info create-astro 🦋 �[36minfo�[39m npm info @astrojs/alpinejs 🦋 �[36minfo�[39m npm info @astrojs/cloudflare 🦋 �[36minfo�[39m npm info @astrojs/deno 🦋 �[36minfo�[39m npm info @astrojs/lit 🦋 �[36minfo�[39m npm info @astrojs/markdoc 🦋 �[36minfo�[39m npm info @astrojs/mdx 🦋 �[36minfo�[39m npm info @astrojs/netlify 🦋 �[36minfo�[39m npm info @astrojs/node 🦋 �[36minfo�[39m npm info @astrojs/partytown 🦋 �[36minfo�[39m npm info @astrojs/preact 🦋 �[36minfo�[39m npm info @astrojs/prefetch 🦋 �[36minfo�[39m npm info @astrojs/react 🦋 �[36minfo�[39m npm info @astrojs/sitemap 🦋 �[36minfo�[39m npm info @astrojs/solid-js 🦋 �[36minfo�[39m npm info @astrojs/svelte 🦋 �[36minfo�[39m npm info @astrojs/tailwind 🦋 �[36minfo�[39m npm info @astrojs/vercel 🦋 �[36minfo�[39m npm info @astrojs/vue 🦋 �[36minfo�[39m npm info @astrojs/internal-helpers 🦋 �[36minfo�[39m npm info @astrojs/markdown-remark 🦋 �[36minfo�[39m npm info @astrojs/telemetry 🦋 �[36minfo�[39m npm info @astrojs/underscore-redirects 🦋 �[36minfo�[39m astro is being published because our local version (0.0.0-picture-20230922101801) has not been published on npm 🦋 �[33mwarn�[39m @astrojs/prism is not being published because version 3.0.0 is already published on npm 🦋 �[33mwarn�[39m @astrojs/rss is not being published because version 3.0.0 is already published on npm 🦋 �[33mwarn�[39m create-astro is not being published because version 4.2.0 is already published on npm 🦋 �[33mwarn�[39m @astrojs/alpinejs is not being published because version 0.3.0 is already published on npm 🦋 �[33mwarn�[39m @astrojs/cloudflare is not being published because version 7.2.0 is already published on npm 🦋 �[33mwarn�[39m @astrojs/deno is not being published because version 5.0.0 is already published on npm 🦋 �[33mwarn�[39m @astrojs/lit is not being published because version 3.0.0 is already published on npm 🦋 �[33mwarn�[39m @astrojs/markdoc is not being published because version 0.5.0 is already published on npm 🦋 �[33mwarn�[39m @astrojs/mdx is not being published because version 1.1.0 is already published on npm 🦋 �[33mwarn�[39m @astrojs/netlify is not being published because version 3.0.1 is already published on npm 🦋 �[33mwarn�[39m @astrojs/node is not being published because version 6.0.1 is already published on npm 🦋 �[33mwarn�[39m @astrojs/partytown is not being published because version 2.0.0 is already published on npm 🦋 �[33mwarn�[39m @astrojs/preact is not being published because version 3.0.0 is already published on npm 🦋 �[33mwarn�[39m @astrojs/prefetch is not being published because version 0.4.0 is already published on npm 🦋 �[33mwarn�[39m @astrojs/react is not being published because version 3.0.2 is already published on npm 🦋 �[33mwarn�[39m @astrojs/sitemap is not being published because version 3.0.0 is already published on npm 🦋 �[33mwarn�[39m @astrojs/solid-js is not being published because version 3.0.1 is already published on npm 🦋 �[33mwarn�[39m @astrojs/svelte is not being published because version 4.0.2 is already published on npm 🦋 �[33mwarn�[39m @astrojs/tailwind is not being published because version 5.0.0 is already published on npm 🦋 �[33mwarn�[39m @astrojs/vercel is not being published because version 5.0.1 is already published on npm 🦋 �[33mwarn�[39m @astrojs/vue is not being published because version 3.0.0 is already published on npm 🦋 �[33mwarn�[39m @astrojs/internal-helpers is not being published because version 0.2.0 is already published on npm 🦋 �[33mwarn�[39m @astrojs/markdown-remark is not being published because version 3.2.0 is already published on npm 🦋 �[33mwarn�[39m @astrojs/telemetry is not being published because version 3.0.2 is already published on npm 🦋 �[33mwarn�[39m @astrojs/underscore-redirects is not being published because version 0.3.0 is already published on npm 🦋 �[36minfo�[39m Publishing �[36m"astro"�[39m at �[32m"0.0.0-picture-20230922101801"�[39m 🦋 �[32msuccess�[39m packages published successfully: 🦋 [email protected] 🦋 Creating git tag... 🦋 New tag: [email protected]

@Princesseuh Princesseuh force-pushed the feat/picture-component branch from 63e341e to 7398d63 Compare September 28, 2023 13:39
@Princesseuh
Copy link
Member Author

!preview picture

@github-actions
Copy link
Contributor

 > [email protected] release /home/runner/work/astro/astro > pnpm run build && changeset publish "--tag" "next--picture" > [email protected] build /home/runner/work/astro/astro > turbo run build --filter=astro --filter=create-astro --filter="@astrojs/*" --filter="@benchmark/*" �[2m• Packages in scope: @astrojs/alpinejs, @astrojs/cloudflare, @astrojs/deno, @astrojs/internal-helpers, @astrojs/lit, @astrojs/markdoc, @astrojs/markdown-remark, @astrojs/mdx, @astrojs/netlify, @astrojs/node, @astrojs/partytown, @astrojs/preact, @astrojs/prefetch, @astrojs/prism, @astrojs/react, @astrojs/rss, @astrojs/sitemap, @astrojs/solid-js, @astrojs/svelte, @astrojs/tailwind, @astrojs/telemetry, @astrojs/underscore-redirects, @astrojs/vercel, @astrojs/vue, @benchmark/timer, astro, create-astro�[0m �[2m• Running�[0m �[2m�[1mbuild�[0m�[0m �[2min 27 packages�[0m �[2m• Remote caching enabled�[0m ::group::@astrojs/telemetry:build cache hit, suppressing logs �[2mb86db6349ed39fb4�[0m ::endgroup:: ::group::@astrojs/prism:build cache hit, suppressing logs �[2m0769371196f7d120�[0m ::endgroup:: ::group::@astrojs/markdown-remark:build cache hit, suppressing logs �[2m1179abc98b9dcb97�[0m ::endgroup:: ::group::@astrojs/internal-helpers:build cache hit, suppressing logs �[2mdf798871feefe924�[0m ::endgroup:: ::group::create-astro:build cache hit, suppressing logs �[2m46484fc9249b86cc�[0m ::endgroup:: ::group::astro:build cache miss, executing �[2m4fe14ec8406ce0a6�[0m > [email protected] build /home/runner/work/astro/astro/packages/astro > pnpm run prebuild && astro-scripts build "src/**/*.{ts,js}" && tsc && pnpm run postbuild > [email protected] prebuild /home/runner/work/astro/astro/packages/astro > astro-scripts prebuild --to-string "src/runtime/server/astro-island.ts" "src/runtime/client/{idle,load,media,only,visible}.ts" > [email protected] postbuild /home/runner/work/astro/astro/packages/astro > astro-scripts copy "src/**/*.astro" && astro-scripts copy "src/**/*.wasm" ::endgroup:: ::group::@astrojs/alpinejs:build cache miss, executing �[2m771014848c1e98cf�[0m > @astrojs/[email protected] build /home/runner/work/astro/astro/packages/integrations/alpinejs > astro-scripts build "src/**/*.ts" && tsc ::endgroup:: ::group::@astrojs/lit:build cache miss, executing �[2m3cbc92d080ef774d�[0m > @astrojs/[email protected] build /home/runner/work/astro/astro/packages/integrations/lit > astro-scripts build "src/**/*.ts" && tsc ::endgroup:: ::group::@astrojs/prefetch:build cache miss, executing �[2m709e0db3d6886876�[0m > @astrojs/[email protected] build /home/runner/work/astro/astro/packages/integrations/prefetch > astro-scripts build "src/**/*.ts" && tsc ::endgroup:: ::group::@astrojs/react:build cache miss, executing �[2m9b53736585b3e029�[0m > @astrojs/[email protected] build /home/runner/work/astro/astro/packages/integrations/react > astro-scripts build "src/**/*.ts" && tsc ::endgroup:: ::group::@astrojs/partytown:build cache miss, executing �[2ma883e9fd0eb1b7a1�[0m > @astrojs/[email protected] build /home/runner/work/astro/astro/packages/integrations/partytown > astro-scripts build "src/**/*.ts" && tsc ::endgroup:: ::group::@astrojs/rss:build cache miss, executing �[2m72a327393170b59c�[0m > @astrojs/[email protected] build /home/runner/work/astro/astro/packages/astro-rss > astro-scripts build "src/**/*.ts" && tsc ::endgroup:: ::group::@astrojs/solid-js:build cache miss, executing �[2m70e9493521b8de6f�[0m > @astrojs/[email protected] build /home/runner/work/astro/astro/packages/integrations/solid > astro-scripts build "src/**/*.ts" && tsc ::endgroup:: ::group::@astrojs/preact:build cache miss, executing �[2m15e95fd68fd953ef�[0m > @astrojs/[email protected] build /home/runner/work/astro/astro/packages/integrations/preact > astro-scripts build "src/**/*.ts" && tsc ::endgroup:: ::group::@astrojs/markdoc:build cache miss, executing �[2mfd478e519b3025b9�[0m > @astrojs/[email protected] build /home/runner/work/astro/astro/packages/integrations/markdoc > astro-scripts build "src/**/*.ts" && tsc ::endgroup:: ::group::@astrojs/vue:build cache miss, executing �[2m7e5fa10085f7ccf7�[0m > @astrojs/[email protected] build /home/runner/work/astro/astro/packages/integrations/vue > astro-scripts build "src/index.ts" && astro-scripts build "src/editor.cts" --force-cjs --no-clean-dist && tsc ::endgroup:: ::group::@astrojs/underscore-redirects:build cache miss, executing �[2m8adc32d93787f19e�[0m > @astrojs/[email protected] build /home/runner/work/astro/astro/packages/underscore-redirects > astro-scripts build "src/**/*.ts" && tsc -p tsconfig.json ::endgroup:: ::group::@astrojs/deno:build cache miss, executing �[2m4a26b4d617f72e0c�[0m > @astrojs/[email protected] build /home/runner/work/astro/astro/packages/integrations/deno > astro-scripts build "src/**/*.ts" && tsc ::endgroup:: ::group::@astrojs/tailwind:build cache miss, executing �[2maf773efb5ba554e8�[0m > @astrojs/[email protected] build /home/runner/work/astro/astro/packages/integrations/tailwind > astro-scripts build "src/**/*.ts" && tsc ::endgroup:: ::group::@benchmark/timer:build cache miss, executing �[2md2bf03a54368a52e�[0m > @benchmark/[email protected] build /home/runner/work/astro/astro/benchmark/packages/timer > astro-scripts build "src/**/*.ts" && tsc ::endgroup:: ::group::@astrojs/node:build cache miss, executing �[2mdfcc7d68f5ad0980�[0m > @astrojs/[email protected] build /home/runner/work/astro/astro/packages/integrations/node > astro-scripts build "src/**/*.ts" && tsc ::endgroup:: ::group::@astrojs/vercel:build cache miss, executing �[2m5f5446d45290fc3a�[0m > @astrojs/[email protected] build /home/runner/work/astro/astro/packages/integrations/vercel > astro-scripts build "src/**/*.ts" && tsc ::endgroup:: ::group::@astrojs/mdx:build cache miss, executing �[2ma92d47054f88cba2�[0m > @astrojs/[email protected] build /home/runner/work/astro/astro/packages/integrations/mdx > astro-scripts build "src/**/*.ts" && tsc ::endgroup:: ::group::@astrojs/svelte:build cache miss, executing �[2m591d2f350263381b�[0m > @astrojs/[email protected] build /home/runner/work/astro/astro/packages/integrations/svelte > astro-scripts build "src/index.ts" && astro-scripts build "src/editor.cts" --force-cjs --no-clean-dist && tsc ::endgroup:: ::group::@astrojs/sitemap:build cache miss, executing �[2mcb3854f52492dee6�[0m > @astrojs/[email protected] build /home/runner/work/astro/astro/packages/integrations/sitemap > astro-scripts build "src/**/*.ts" && tsc ::endgroup:: ::group::@astrojs/netlify:build cache miss, executing �[2m0d920c1d81a070e7�[0m > @astrojs/[email protected] build /home/runner/work/astro/astro/packages/integrations/netlify > astro-scripts build "src/**/*.ts" && tsc ::endgroup:: ::group::@astrojs/cloudflare:build cache miss, executing �[2mb28801ebdcb406d3�[0m > @astrojs/[email protected] build /home/runner/work/astro/astro/packages/integrations/cloudflare > astro-scripts build "src/**/*.ts" && tsc ::endgroup:: Tasks: 27 successful, 27 total Cached: 5 cached, 27 total Time: 1m7.15s 🦋 �[33mwarn�[39m �[31m===============================IMPORTANT!===============================�[39m 🦋 �[33mwarn�[39m Packages will be released under the next--picture tag 🦋 �[33mwarn�[39m �[31m----------------------------------------------------------------------�[39m 🦋 �[36minfo�[39m npm info astro 🦋 �[36minfo�[39m npm info @astrojs/prism 🦋 �[36minfo�[39m npm info @astrojs/rss 🦋 �[36minfo�[39m npm info create-astro 🦋 �[36minfo�[39m npm info @astrojs/alpinejs 🦋 �[36minfo�[39m npm info @astrojs/cloudflare 🦋 �[36minfo�[39m npm info @astrojs/deno 🦋 �[36minfo�[39m npm info @astrojs/lit 🦋 �[36minfo�[39m npm info @astrojs/markdoc 🦋 �[36minfo�[39m npm info @astrojs/mdx 🦋 �[36minfo�[39m npm info @astrojs/netlify 🦋 �[36minfo�[39m npm info @astrojs/node 🦋 �[36minfo�[39m npm info @astrojs/partytown 🦋 �[36minfo�[39m npm info @astrojs/preact 🦋 �[36minfo�[39m npm info @astrojs/prefetch 🦋 �[36minfo�[39m npm info @astrojs/react 🦋 �[36minfo�[39m npm info @astrojs/sitemap 🦋 �[36minfo�[39m npm info @astrojs/solid-js 🦋 �[36minfo�[39m npm info @astrojs/svelte 🦋 �[36minfo�[39m npm info @astrojs/tailwind 🦋 �[36minfo�[39m npm info @astrojs/vercel 🦋 �[36minfo�[39m npm info @astrojs/vue 🦋 �[36minfo�[39m npm info @astrojs/internal-helpers 🦋 �[36minfo�[39m npm info @astrojs/markdown-remark 🦋 �[36minfo�[39m npm info @astrojs/telemetry 🦋 �[36minfo�[39m npm info @astrojs/underscore-redirects 🦋 �[36minfo�[39m astro is being published because our local version (0.0.0-picture-20230928151018) has not been published on npm 🦋 �[33mwarn�[39m @astrojs/prism is not being published because version 3.0.0 is already published on npm 🦋 �[33mwarn�[39m @astrojs/rss is not being published because version 3.0.0 is already published on npm 🦋 �[33mwarn�[39m create-astro is not being published because version 4.2.0 is already published on npm 🦋 �[33mwarn�[39m @astrojs/alpinejs is not being published because version 0.3.0 is already published on npm 🦋 �[33mwarn�[39m @astrojs/cloudflare is not being published because version 7.2.0 is already published on npm 🦋 �[33mwarn�[39m @astrojs/deno is not being published because version 5.0.0 is already published on npm 🦋 �[33mwarn�[39m @astrojs/lit is not being published because version 3.0.0 is already published on npm 🦋 �[33mwarn�[39m @astrojs/markdoc is not being published because version 0.5.0 is already published on npm 🦋 �[33mwarn�[39m @astrojs/mdx is not being published because version 1.1.0 is already published on npm 🦋 �[33mwarn�[39m @astrojs/netlify is not being published because version 3.0.1 is already published on npm 🦋 �[33mwarn�[39m @astrojs/node is not being published because version 6.0.1 is already published on npm 🦋 �[33mwarn�[39m @astrojs/partytown is not being published because version 2.0.0 is already published on npm 🦋 �[33mwarn�[39m @astrojs/preact is not being published because version 3.0.0 is already published on npm 🦋 �[33mwarn�[39m @astrojs/prefetch is not being published because version 0.4.0 is already published on npm 🦋 �[33mwarn�[39m @astrojs/react is not being published because version 3.0.2 is already published on npm 🦋 �[33mwarn�[39m @astrojs/sitemap is not being published because version 3.0.0 is already published on npm 🦋 �[33mwarn�[39m @astrojs/solid-js is not being published because version 3.0.1 is already published on npm 🦋 �[33mwarn�[39m @astrojs/svelte is not being published because version 4.0.2 is already published on npm 🦋 �[33mwarn�[39m @astrojs/tailwind is not being published because version 5.0.0 is already published on npm 🦋 �[33mwarn�[39m @astrojs/vercel is not being published because version 5.0.1 is already published on npm 🦋 �[33mwarn�[39m @astrojs/vue is not being published because version 3.0.0 is already published on npm 🦋 �[33mwarn�[39m @astrojs/internal-helpers is not being published because version 0.2.0 is already published on npm 🦋 �[33mwarn�[39m @astrojs/markdown-remark is not being published because version 3.2.0 is already published on npm 🦋 �[33mwarn�[39m @astrojs/telemetry is not being published because version 3.0.2 is already published on npm 🦋 �[33mwarn�[39m @astrojs/underscore-redirects is not being published because version 0.3.0 is already published on npm 🦋 �[36minfo�[39m Publishing �[36m"astro"�[39m at �[32m"0.0.0-picture-20230928151018"�[39m 🦋 �[32msuccess�[39m packages published successfully: 🦋 [email protected] 🦋 Creating git tag... 🦋 New tag: [email protected]

@Princesseuh
Copy link
Member Author

!preview picture

@Princesseuh Princesseuh marked this pull request as ready for review October 6, 2023 17:13
@Princesseuh Princesseuh requested a review from a team as a code owner October 6, 2023 17:13
@lilnasy
Copy link
Contributor

lilnasy commented Oct 6, 2023

!preview picture

1 similar comment
@Princesseuh
Copy link
Member Author

!preview picture

@Princesseuh
Copy link
Member Author

!preview picture

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.

Looking great @Princesseuh ! I made some small suggestions here, and I think a tiny bit more hand-holding description could make sense in one or two places, so see what you think!

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.

I love where the changset landed! I just saw one tiny missing "the" somewhere, but good to go!

@Princesseuh Princesseuh merged commit b2ae9ee into main Oct 11, 2023
@Princesseuh Princesseuh deleted the feat/picture-component branch October 11, 2023 15:53
@astrobot-houston astrobot-houston mentioned this pull request Oct 11, 2023
Copy link
Contributor

@jasikpark jasikpark left a comment

Choose a reason for hiding this comment

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

looks great! thanks so much for championing this!

<picture>
<source srcset="..." type="image/avif" />
<source srcset="..." type="image/webp" />
<img src="..." alt="My super image in multiple formats!" />
Copy link
Contributor

Choose a reason for hiding this comment

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

will the img here be equivalent to the above image + densities example? a la "show the original file in the root image source?

@@ -23,6 +23,12 @@ if (typeof props.height === 'string') {
}

const image = await getImage(props);

const additionalAttributes: Record<string, any> = {};
Copy link
Contributor

Choose a reason for hiding this comment

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

why not unknown?

Copy link
Member Author

Choose a reason for hiding this comment

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

Mostly so we don't have to check the attributes before using them, since it doesn't really matter (it's classic Astro serializing, so it supports everything)


const fallbackImage = await getImage({
...props,
format: fallbackFormat,
Copy link
Contributor

Choose a reason for hiding this comment

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

ah, so the answer is yes!

densities: props.densities,
});

const additionalAttributes: Record<string, any> = {};
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
const additionalAttributes: Record<string, any> = {};
const additionalAttributes: Record<string, unknown> = {};

perhaps?

}
}

// TypeScript doesn't know this, but because of previous hooks we always know that targetWidth and targetHeight are defined
Copy link
Contributor

Choose a reason for hiding this comment

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

why not have multiple return points, so typescript does know they're defined?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, we could probably accept type params on image services, and have like a prop for validated props and stuff.

@mks-h
Copy link

mks-h commented Oct 12, 2023

Thanks for your work! I was looking forward to it. I'll go and use it instead of my own little script, as soon as I get to it.

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.

8 participants