Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify/avoid config object #64

Closed
marcusoffesson opened this issue Jun 16, 2017 · 6 comments
Closed

Simplify/avoid config object #64

marcusoffesson opened this issue Jun 16, 2017 · 6 comments
Assignees
Milestone

Comments

@marcusoffesson
Copy link
Contributor

Over time, the config object has become bloated and we would like to simplify it in version 2.

Preferably, the "connect"-methods should have a single URL parameter and no config object at all. This might be hard (impossible?) to achieve, given that it should be possible to register listeners, etc. before a connection is established. Ideas and comments are welcome!

@peol
Copy link
Contributor

peol commented Jun 21, 2017

We should also investigate the possibility of having enigma.create() synchronous, and allow the user to bind the events they today have to use config.listeners for. See #87

@peol peol self-assigned this Jun 27, 2017
@peol
Copy link
Contributor

peol commented Jun 27, 2017

Proposed configuration in 2.0:

| Property         | Type     | Optional   | Default   | Description |
|------------------|----------|------------|-----------|-------------|
| `schema`         | Object   | No         |           | Object containing the specification for the Qix API. Originates from an Engine build and is bound to a specific version of Engine. |
| `url`            | String   | No         |           | String containing a proper websocket URL to an Engine.
| `createSocket`   | Function | In browser |           | A function to use when instantiating the WebSocket, mandatory for NodeJS. |
| `mixins`         | Array    | Yes        | `[]`      | Mixins to extend/augment the Engine API (see more on [Using mixins](mixins.md)).
| `delta`          | Boolean  | Yes        | `true`    | If set to `false`, will disable the use of the bandwidth-reducing delta protocol. |
| `suspendOnClose` | Boolean  | Yes        | `false`   | Set to `true` if the session should be suspended instead of closed when websocket is closed. See [Session](session.md) for details. |
| `Promise`        | Promise  | Yes        | `Promise` | ES6-compatible Promise library. |

These configuration properties are removed:

@mindspank
Copy link
Contributor

I can understand the reasoning behind removing config.appId but it was quite convenient to avoid having to call openDoc yourself. Perhaps a middle-ground approach could work, supplying a app id in the config and connect() returns both the global handle and the app handle but without making assumptions around urls and how you want to handle your websocket connections.

@marcusoffesson
Copy link
Contributor Author

Hi @mindspank!

You make a good point and I understand the benefit of having the config.appId property. On the other hand, the simplicity of the config object outweighs convenience of not having to call openDoc().

We are considering to add support for session mixins (not in scope for v2). The connect() method could then be overridden to also handle the openDoc() call.

@marcusoffesson
Copy link
Contributor Author

marcusoffesson commented Jul 5, 2017

Done here: #110

@mindspank
Copy link
Contributor

Is it simplifying though? The benefit of having enigma performing the openDoc was that it abstracted away the need to learn session sharing and session scoping within QIX.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants