FluidFramework icon indicating copy to clipboard operation
FluidFramework copied to clipboard

`IClient.type` should be split or clarified

Open wes-carlson opened this issue 7 years ago • 4 comments

This value is usually set to "browser", which according to @vladsud is not really a client type but an environment. "browser" should be replaced with "human" and a separate field should be added to IClient to differentiate e.g. browser vs node, if necessary.

Also, the client type should be a string union or string enum or something, depending on if we expect outside developers to use custom client type strings.

See: #388 #339 #401 @vladsud @arinwt @anthony-murphy

wes-carlson avatar Oct 24 '19 19:10 wes-carlson

Thanks for thinking about this. As an alternate, we can think 'clientType' as a 'set of capabilities'. IClient will have a field (capabilities?) which is an object. And we can keep adding properties to that object (helpful for back-compat). As a start, we can have something like this.

Interface ICapabilities { interactive: boolean }

'interactive': true means a browser/node client because we can interact with them (click/type in browser. Typing commands in node). For bot and summarizer, it will be false cause we can't actually interact with them directly.

We can add another field such as 'Environment' to denote actual environment (Browser/Node) And may be another to denote device (Mobile/Desktop).

Thoughts?

tanviraumi avatar Nov 01 '19 00:11 tanviraumi

Sounds reasonable to me

vladsud avatar Nov 01 '19 02:11 vladsud

Are environment/device useful information to have about clients (or will they be in the future)?

wes-carlson avatar Nov 01 '19 21:11 wes-carlson

I think it's useful even today. Thought with caveat - engineers should not use it for feature detection (there are better ways for that)

vladsud avatar Nov 01 '19 22:11 vladsud