Add font size argument in text Wireframe builder #1613
Merged
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.
What and why?
Add font size argument in
createTextWireframe
public builder.Today passing a
font
argument is the only way to specify a font size for the text wireframe.With React Native text views we don't get direct access to the
UIFont
. However we get direct access to the fontSize,so we can bypass this by creating a new font on every call, but that takes a lot of time and impacts performance (on an app I tested, it took up to 300ms of time over a minute of usage of the app).
I've tried passing
nil
as font (DataDog/dd-sdk-reactnative#570), but then all elements have a small font size.I believe enabling to specify only the font size is the best way to get a great fidelity with a small performance cost.
How?
It seems that there is no test covering this part of the code, let me know if I should add some.
Review checklist
Custom CI job configuration (optional)
tools/