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

Do not serialize text attributes that are not used later #42703

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

cubuspl42
Copy link
Contributor

Summary:

Do not serialize text attributes that are not used later

Changelog:

[INTERNAL] [REMOVED] - Do not serialize text attributes that are not used later

Test Plan:

@facebook-github-bot facebook-github-bot added CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. labels Jan 29, 2024
@@ -144,7 +137,6 @@ private TextAttributeProps() {}
public static TextAttributeProps fromMapBuffer(MapBuffer props) {
TextAttributeProps result = new TextAttributeProps();

// TODO T83483191: Review constants that are not being set!
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We're deserializing text attributes of a fragment. Some attributes are not handled on the fragment level but apply to the whole Text element. I believe there's not much more to investigate here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Relevant:

// TODO: T63643819 refactor naming of TextAttributeProps to make explicit that this represents
// TextAttributes and not TextProps. As part of this refactor extract methods that don't belong to
// TextAttributeProps (e.g. TextAlign)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The fact that we currently don't do what this comment describes is blocking me.

I'd like to...

  • Split TextAttributes (C++) to TextAttributes (<Text>-level properties) and FragmentAttributes (fragment-level properties)
  • Refactor TextAttributeProps (Java) to FragmentAttributes

Currently, one is a subset of another; not modeling them separately is at most a code smell.

I'd like them to be two slightly different sets (sharing a great common subset), so not modeling them separately is a problem.

Copy link
Contributor

Choose a reason for hiding this comment

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

yes, this doesn't seem correct, thanks for cleaning up

@cubuspl42
Copy link
Contributor Author

@mdvacca I think I will need your eyes on this one.

Please see this thread.

@analysis-bot
Copy link

Platform Engine Arch Size (bytes) Diff
android hermes arm64-v8a 17,066,827 -5
android hermes armeabi-v7a n/a --
android hermes x86 n/a --
android hermes x86_64 n/a --
android jsc arm64-v8a 20,450,423 -9
android jsc armeabi-v7a n/a --
android jsc x86 n/a --
android jsc x86_64 n/a --

Base commit: cfc0ba0
Branch: main

@cubuspl42
Copy link
Contributor Author

@mdvacca What do you think? Is this a good way forward?

@facebook-github-bot
Copy link
Contributor

@mdvacca has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@@ -144,7 +137,6 @@ private TextAttributeProps() {}
public static TextAttributeProps fromMapBuffer(MapBuffer props) {
TextAttributeProps result = new TextAttributeProps();

// TODO T83483191: Review constants that are not being set!
Copy link
Contributor

Choose a reason for hiding this comment

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

yes, this doesn't seem correct, thanks for cleaning up

@cubuspl42
Copy link
Contributor Author

@mdvacca Let me know if I can help with making the internal build succeed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants