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)
Wed, Sep 11, 4:43 PM
Unknown Object (File)
Wed, Sep 11, 4:43 PM
Unknown Object (File)
Wed, Sep 11, 4:43 PM
Unknown Object (File)
Wed, Sep 11, 4:43 PM
Unknown Object (File)
Wed, Sep 11, 4:38 PM
Unknown Object (File)
Sat, Sep 7, 12:21 PM
Unknown Object (File)
Sep 2 2024, 5:32 PM
Unknown Object (File)
Aug 28 2024, 10:59 AM
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.