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

Add support for importing SVG, PNG, and JPEG files directly #2284

Merged
merged 6 commits into from
Mar 18, 2024

Conversation

Mrtenz
Copy link
Member

@Mrtenz Mrtenz commented Mar 18, 2024

This adds support for importing SVG, PNG, and JPEG files directly in a Snap. For example, you can now use this:

import file from './path/to/image.png';

And use that image in a snap UI using the image component:

content: image(file)

Internally the image is converted to an SVG string by the CLI, which makes this possible.

@Mrtenz Mrtenz requested a review from a team as a code owner March 18, 2024 11:53
Copy link

codecov bot commented Mar 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.60%. Comparing base (2933da0) to head (26840af).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2284   +/-   ##
=======================================
  Coverage   96.60%   96.60%           
=======================================
  Files         337      337           
  Lines        7622     7629    +7     
  Branches     1183     1186    +3     
=======================================
+ Hits         7363     7370    +7     
  Misses        259      259           

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

packages/snaps-cli/src/webpack/config.ts Show resolved Hide resolved
Copy link
Member

Choose a reason for hiding this comment

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

Could we use some other example than this icon we are trying to remove? 😅

@Mrtenz Mrtenz merged commit 8669459 into main Mar 18, 2024
150 checks passed
@Mrtenz Mrtenz deleted the mrtenz/image-improvements branch March 18, 2024 14:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants