Page MenuHomePhabricator

[lib] Add helpers for EntityText
ClosedPublic

Authored by ashoat on Feb 1 2023, 2:05 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, May 28, 6:01 AM
Unknown Object (File)
Tue, May 28, 6:01 AM
Unknown Object (File)
Tue, May 28, 6:01 AM
Unknown Object (File)
Tue, May 28, 6:01 AM
Unknown Object (File)
Tue, May 28, 6:01 AM
Unknown Object (File)
Tue, May 28, 6:00 AM
Unknown Object (File)
Tue, May 28, 5:54 AM
Unknown Object (File)
Apr 28 2024, 4:41 AM
Subscribers
None

Details

Summary

These helpers will be used by code that composes EntityTexts.

Depends on D6508

Test Plan

Tested in combination with the following diffs

Diff Detail

Repository
rCOMM Comm
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

ashoat requested review of this revision.Feb 1 2023, 2:21 PM

Include "this" in shortName ThreadEntity

tomek added inline comments.
lib/utils/entity-text.js
53–54

Should we move the comment to where ET is defined?

85

Is it intentional to make this optional?

99

What's the goal of assigning a function property to a function? How are we going to use it?

154

Why it isn't exact?

This revision is now accepted and ready to land.Feb 2 2023, 6:25 AM
lib/utils/entity-text.js
53–54

Yeah, good call

85

Yeah – see comment on line 78. I want to make it very "lightweight", so that the code that uses this framework is clean and readable

99

The goal is to make it lightweight. The thinking is basically that if you're using ET, you almost certainly will need access to these functions

By putting the function on ET, we make it possible to use the framework with only one import, and we have a short function name (eg. ET.thread) you can use

To see how it's used, check out some of the later diffs in the stack, eg. D6515

154

We want to allow the caller to pass in any UserInfo object that works here, eg. AccountUserInfo, RelativeUserInfo, MemberInfo, RelativeMemberInfo, etc.

This revision was automatically updated to reflect the committed changes.
lib/utils/entity-text.js
99

Interesting idea, thanks!