maqetta/maqetta — Issue #1075: Children should always be an array (don't also support string value)
Author: jhpedemonte
Created: 2011-10-12 16:22:24+00:00
State: open
Labels: Feature, Priority Med, Runtime

See 470ba852a5d94a73b59a2c5b6f6d6590c760468c.

`Context.createWidget()` assumes that the `children` property can be either an **array** or **string** (in the case of setting the innerHTML value).

@childsb points out that in the code it would be best to just always assume an **array**, to make the code simpler.

What do we do with the metadata definition. Two options:

1. Continue supporting **string** value (for the innerHTML value of the widget) and an **array** for everything else.

```javascript
"children": "FooBar"
```
2. Support only an **array** value (to keep inline with every other use of "children"), but introduce a special type for **innerHTML**:

```javascript
"children": [
"type": "innerHTML",
"properties": {
"value": "FooBar"
}
]
```

Personally, I prefer (1). With proper documentation of the metadata structure, I don't think this will be a problem for users.

@JonFerraiolo