You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@guacamole.apache.org by "Joel Berger (Jira)" <ji...@apache.org> on 2021/08/20 20:34:00 UTC

[jira] [Created] (GUACAMOLE-1402) Expose client state enum values

Joel Berger created GUACAMOLE-1402:
--------------------------------------

             Summary: Expose client state enum values
                 Key: GUACAMOLE-1402
                 URL: https://issues.apache.org/jira/browse/GUACAMOLE-1402
             Project: Guacamole
          Issue Type: Improvement
          Components: guacamole-common-js
            Reporter: Joel Berger


In Client.js you have what is essentially an enum of state values ([https://github.com/apache/guacamole-client/blob/a54c78554f855bb5a0f49011a8f6e576a6bde164/guacamole-common-js/src/main/webapp/modules/Client.js#L35-L40]) and these are exposed to the user via the onstatechange callback, however the enum names are not exposed to the user, being function-scoped variables. Having access to these states by name would allow the user to write more self-documenting code and insulate from changes in the underlying state values. This practice is common in compiled languages.

Indeed you do so correctly in Tunnel.js where you have a very similar construct that IS properly exposed to the user ([https://github.com/apache/guacamole-client/blob/a54c78554f855bb5a0f49011a8f6e576a6bde164/guacamole-common-js/src/main/webapp/modules/Tunnel.js#L190-L224]).

Could the state values in Client.js please be similarly exposed?



--
This message was sent by Atlassian Jira
(v8.3.4#803005)