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)
Sun, Apr 28, 4:41 AM
Unknown Object (File)
Sun, Apr 28, 4:41 AM
Unknown Object (File)
Sun, Apr 28, 4:41 AM
Unknown Object (File)
Sun, Apr 28, 4:41 AM
Unknown Object (File)
Sun, Apr 28, 4:41 AM
Unknown Object (File)
Sun, Apr 28, 4:39 AM
Unknown Object (File)
Sun, Apr 28, 4:19 AM
Unknown Object (File)
Apr 8 2024, 8:16 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
Lint Not Applicable
Unit
Tests Not Applicable

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 ↗(On Diff #21822)

Should we move the comment to where ET is defined?

85 ↗(On Diff #21822)

Is it intentional to make this optional?

99 ↗(On Diff #21822)

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

154 ↗(On Diff #21822)

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 ↗(On Diff #21822)

Yeah, good call

85 ↗(On Diff #21822)

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 ↗(On Diff #21822)

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 ↗(On Diff #21822)

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 ↗(On Diff #21822)

Interesting idea, thanks!