-
-
Notifications
You must be signed in to change notification settings - Fork 588
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
A revamped scalable HTMLImage component #389
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This was referenced Jul 24, 2020
jsamr
force-pushed
the
feat/scalable-images
branch
from
July 24, 2020 10:43
43ac44f
to
97b8240
Compare
jsamr
force-pushed
the
feat/scalable-images
branch
3 times, most recently
from
July 24, 2020 14:30
4905fe9
to
b4d906b
Compare
jsamr
force-pushed
the
feat/scalable-images
branch
6 times, most recently
from
July 27, 2020 18:50
0412245
to
5e1a8f1
Compare
jsamr
commented
Aug 10, 2020
jsamr
force-pushed
the
feat/scalable-images
branch
from
September 26, 2020 09:04
5e1a8f1
to
8ba20ea
Compare
jsamr
force-pushed
the
feat/scalable-images
branch
from
September 26, 2020 09:07
8ba20ea
to
0d3cfcf
Compare
Codecov Report
@@ Coverage Diff @@
## master #389 +/- ##
==========================================
+ Coverage 60.90% 63.76% +2.85%
==========================================
Files 6 6
Lines 376 436 +60
Branches 125 136 +11
==========================================
+ Hits 229 278 +49
Misses 64 64
- Partials 83 94 +11
Continue to review full report at Codecov.
|
BREAKING: imagesMaxWidth prop is discontinued in favor of contentWidth and computeImagesMaxWidth. See RFC001 for an exhaustive description. This patch offers a rewrite of the HTMLImage component to get a close match with RFC001, “a deterministic approach to images scaling”. The only part of this RFC which is unsupported is the unitConverter behavior, which is planned for a later major release. In addition to the capabilities defined in the RFC, this patch provides the following features and behaviors: - new property enableExperimentalPercentWidth. It allows percent width for <img> tags, computed relatively to contentWidth. - take margins into account when scaling down images; - support for overriding image styles, including resizeMode; - support for minWidth, minHeight, maxWidth, maxHeight styles. This patch also fixes #141, #172 and provides the features offered in PR #242 and #315. OPTIMIZATIONS: The imageBoxDimensions are computed when required. In addition, requirements are also recomputed when necessary, preventing expensive operations from happening too often. Also, because we need to flatten the style prop to infer requirements, this flatten value is now cached and re-evaluated when appropriate. Finally, styles have been moved to a stylesheet when that is possible, to avoid commiting updates to the native side. Note that these performance optimizations are made possible by the high coverage rate of the HTMLImage component. fixes #141 fixes #172 updates #412 (could fix) closes #315 closes #242
jsamr
force-pushed
the
feat/scalable-images
branch
from
September 26, 2020 09:35
78dce3f
to
c745a30
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
BREAKING:
imagesMaxWidth
prop is discontinued in favor ofcontentWidth
andcomputeImagesMaxWidth
. See RFC001 for an exhaustive description.This patch offers a rewrite of the
HTMLImage
component to get a close match with RFC001, “a deterministic approach to images scaling”. The only part of this RFC which is unsupported is theunitConverter
behavior, which is planned for a later major release.In addition to the capabilities defined in the RFC, these patches provide the new property enableExperimentalPercentWidth. It allows percent width for
<img>
tags, computed relatively tocontentWidth
.These patches also fix #141, #172. Kudos to authors of PRs #242 and #315 which have given inspiration for this work.
TODOS: