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)
Sat, Dec 21, 2:55 AM
Unknown Object (File)
Fri, Nov 29, 11:13 PM
Unknown Object (File)
Fri, Nov 29, 12:59 AM
Unknown Object (File)
Mon, Nov 25, 7:08 PM
Unknown Object (File)
Nov 22 2024, 4:06 AM
Unknown Object (File)
Nov 14 2024, 7:21 PM
Unknown Object (File)
Oct 29 2024, 2:45 PM
Unknown Object (File)
Oct 26 2024, 1:12 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
Lint Not Applicable
Unit
Tests Not Applicable

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.