Handlebars AST attribute representation: (array of elements)
In scope of this PR we matching attributes to hbs semantics, where it's represented as array of key-value pairs, instead of record. It gives us more flexibility in syntaxes and reduce potential fail-cases because attribute name is explicitly string.
And getting rid of An object literal cannot have multiple properties with the same name typescript error.
- export declare function applyAttributes(element: Element, attrs: Record<string, AttrValue>): void;
+ export declare function applyAttributes(element: Element, attrs: Array<[string, AttrValue]>): void;
Handlebars AST attribute representation: (array of elements)
In scope of this PR we matching attributes to hbs semantics, where it's represented as array of key-value pairs, instead of record. It gives us more flexibility in syntaxes and reduce potential fail-cases because attribute name is explicitly string.
And getting rid of
An object literal cannot have multiple properties with the same name
typescript error.Resolves: https://github.com/typed-ember/glint/issues/693
Note, we not getting DX worse, because template-lint has rule to warn about duplicated attributes: https://github.com/ember-template-lint/ember-template-lint/blob/master/docs/rule/no-duplicate-attributes.md
Sidenote:
It seems we could have autocomoplete/attibutes validation if replace
With
ts playground