Skip to content

feat(repack): resolve scale automatically for inlined assets#328

Merged
RafikiTiki merged 2 commits into
mainfrom
feat/inline-assets-resolve-scale
Apr 6, 2023
Merged

feat(repack): resolve scale automatically for inlined assets#328
RafikiTiki merged 2 commits into
mainfrom
feat/inline-assets-resolve-scale

Conversation

@jbroma
Copy link
Copy Markdown
Contributor

@jbroma jbroma commented Apr 4, 2023

Summary

Added automatic scale resolution for inlined assets. This change only affects scaled inlined assets.
This resolves an issue where an unstyled Image with inlined source was not being displayed (the width & height won't be picked up properly unless it's a single URISource

Result of inlining scaled asset before:

[
  {
    uri: 'data:image/png;base64,...',
    scale: 1,
    width: 10,
    height: 10,
  },
  {
    uri: 'data:image/png;base64,...',
    scale: 2,
    width: 10,
    height: 10,
  },
]

Result of inlining scaled asset after:

{
  uri: 'data:image/png;base64,...',
  scale: 2,   // only the matching scale gets picked up
  width: 10,
  height: 10,
},

Test plan

  • UI tests

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Apr 4, 2023

🦋 Changeset detected

Latest commit: 99ba5e3

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

This PR includes changesets to release 2 packages
Name Type
@callstack/repack Minor
testerapp Patch

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

@jbroma jbroma force-pushed the feat/inline-assets-resolve-scale branch from 06af660 to 88a78a4 Compare April 4, 2023 13:41
@jbroma jbroma requested a review from thymikee April 4, 2023 15:08
@jbroma jbroma added the type:feature Proposal or idea for a new feature or enhancement. label Apr 5, 2023
@jbroma jbroma self-assigned this Apr 5, 2023
@RafikiTiki RafikiTiki merged commit 4f155dd into main Apr 6, 2023
@RafikiTiki RafikiTiki deleted the feat/inline-assets-resolve-scale branch April 6, 2023 11:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type:feature Proposal or idea for a new feature or enhancement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants