Inlined assets with fractional scales resolve to the wrong variant
Maintainer thường phản hồi trong vòng 2 ngày
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 25/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- react-native, typescript, webpack
- Lĩnh vực
- build-system
Hướng nghiên cứu
Read the Re.Pack assets loader's inlineAssets path and its call to AssetSourceResolver.pickScale. The report identifies the unsorted scale list and gives reproductions at pixel ratios 3.5 and 1.5; confirm the expected variant against those cases. Done means fractional and integer scale variants resolve correctly. Pull request #1505 is already open for this issue.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Description
With inline: true in the assets loader, an image that has a fractional scale variant (@0.75x or @1.5x) resolves to the wrong scale at runtime.
inlineAssets passes Object.keys(sourceSet).map(Number) to AssetSourceResolver.pickScale. Integer-like object keys are listed before other keys, so [0.75, 1, 1.5, 2, 3] becomes [1, 2, 3, 0.75, 1.5]. pickScale expects an ascending list ("Packager guarantees that scales array is sorted").
Reproduction
- Add
[email protected],[email protected],[email protected]and[email protected]. - Enable
inline: truefor the Re.Pack assets loader and renderrequire('./star.png'). - Run on an Android device with a pixel ratio of 3.5.
Expected: the @3x image. Actual: the @1.5x image. A pixel ratio of 1.5 gets @2x instead of @1.5x.
Environment
@callstack/repack main (5.4.2), any React Native version.
- Ngôn ngữ chính
- TypeScript
- Star
- 1.9k
- Fork
- 177
- Merge trung bình
- 2 ngày 10 giờ
- Pull request đã merge (30 ngày)
- 23
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của callstack/repack
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
callstack/repack#1515 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
status:new type:feature
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 50/100
Maintainer thường phản hồi trong vòng 2 ngày
-
ScriptManager caches the rejected promise when a resolver throws, so loadScript/prefetchScript never retryCó thể đã có người làm @linhh-phv đã nhận 14 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 35/100
Maintainer thường phản hồi trong vòng 2 ngày
-
json as string in JS bundleCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
callstack/repack#1461 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
area:repack type:feature
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 42/100
callstack/repack#1423 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
Tất cả issue của callstack/repack
Issue tương tự
-
test: claim-conflict drop leaves both facts active and is never re-proposed (untested review cell)Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 83/100
Maintainer thường phản hồi trong vòng 1 ngày
-
[Feature]: Usage page should show API-equivalent cost and say when a connected plan shows info onlyĐang mởenhancement from-x
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
nightly-labs/openbot#4867 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
egonSchiele/agency-lang#1377 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
normalizePath removes the Windows device namespace prefixCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
caprover/caprover-frontend#273 ·
Maintainer thường phản hồi trong vòng 1 ngày