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

nuxt-picture: allow parsing format as array #886

Open
wants to merge 47 commits into
base: main
Choose a base branch
from

Conversation

marcelxpfeifer
Copy link
Contributor

To better align the image format prop with the global setting for format, I now allow parsing an array as prop as well. Also minor tweaks to the docs and tests.

@nuxt-studio
Copy link

nuxt-studio bot commented Jun 21, 2023

Live Preview ready!

Name Edit Preview Latest Commit
Image Edit on Studio ↗︎ View Live Preview 5a11310

@netlify
Copy link

netlify bot commented Jun 21, 2023

👷 Deploy request for nuxt-image pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 5a11310

Copy link
Collaborator

@hartmut-co-uk hartmut-co-uk left a comment

Choose a reason for hiding this comment

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

This looks good to me overall.
Extra ⭐ for the docs! :-)

Could you address the failing type checks? (pnpm test:types)

@codecov-commenter
Copy link

codecov-commenter commented Sep 12, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.19% 🎉

Comparison is base (e0a8183) 89.15% compared to head (ed2e268) 89.34%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #886      +/-   ##
==========================================
+ Coverage   89.15%   89.34%   +0.19%     
==========================================
  Files          44       44              
  Lines        2914     2967      +53     
  Branches      323      328       +5     
==========================================
+ Hits         2598     2651      +53     
  Misses        315      315              
  Partials        1        1              
Files Changed Coverage Δ
src/runtime/components/_base.ts 100.00% <100.00%> (ø)
src/runtime/components/nuxt-picture.ts 82.45% <100.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@danielroe danielroe added the enhancement New feature or request label Sep 13, 2023
@@ -109,3 +118,47 @@ export const useBaseImage = (props: ExtractPropTypes<typeof baseImageProps>) =>
modifiers
}
}

export const useBasePicture = (props: ExtractPropTypes<typeof basePictureProps>) => {
Copy link
Member

Choose a reason for hiding this comment

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

For simplicity and reduced bundle size, do you think we can avoid splitting out useBasePicture and instead override the props directly in nuxt-img?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants