Page MenuHomePhabricator

[native] introduce user profile constants
ClosedPublic

Authored by ginsu on Oct 4 2023, 10:10 AM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Nov 22, 4:06 AM
Unknown Object (File)
Thu, Nov 14, 7:21 PM
Unknown Object (File)
Tue, Oct 29, 2:45 PM
Unknown Object (File)
Oct 26 2024, 1:12 AM
Unknown Object (File)
Oct 20 2024, 3:41 PM
Unknown Object (File)
Oct 20 2024, 3:41 PM
Unknown Object (File)
Oct 20 2024, 3:41 PM
Unknown Object (File)
Oct 20 2024, 3:41 PM
Subscribers

Details

Summary

Some of the constants defined in D9274 are going to be used across different files. To ensure that this code is future proof and less "brittle" I created this constants file as a single source of truth where we define and export the relevant constants

Test Plan

flow

Diff Detail

Repository
rCOMM Comm
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

ginsu requested review of this revision.Oct 4 2023, 10:28 AM

Don't love the indirection, but seems like a reasonable approach

This revision is now accepted and ready to land.Oct 4 2023, 4:28 PM

Don't love the indirection, but seems like a reasonable approach

Wdym by indirection here? Happy to make any updates to make it less indirect

cc @atul

In D9358#275095, @ginsu wrote:

Don't love the indirection, but seems like a reasonable approach

Wdym by indirection here? Happy to make any updates to make it less indirect

cc @atul

Just that the constants are in a separate file creates "distance" from where the values are defined and where they're used. But given you need to use them in multiple places this seems like a good bet.

IDE will "show" value of eg userProfileActionButtonHeight on hover anyways

In D9358#275100, @atul wrote:
In D9358#275095, @ginsu wrote:

Don't love the indirection, but seems like a reasonable approach

Wdym by indirection here? Happy to make any updates to make it less indirect

cc @atul

Just that the constants are in a separate file creates "distance" from where the values are defined and where they're used. But given you need to use them in multiple places this seems like a good bet.

IDE will "show" value of eg userProfileActionButtonHeight on hover anyways

Ah gotcha, thanks for clarifying. I know we also do this with chat constants too. My main concern is that if we use these values in different files, I am concerned that a future dev might edit a value in one place, but forget to/is not aware they need to update another place too.

Given both of these reasons, I will just keep this approach

Keeping constants that are imported from lots of different places in separate files also helps to avoid import cycles

This revision was automatically updated to reflect the committed changes.