Skip to content

regression in build for templates with embedded custom elements #438

@wkeese

Description

@wkeese

Templates with embedded widgets no longer work correctly in a built layer. For a template like below, where <my-embedded-widget> has a property called foo:

<template requires=acme/MyEmbeddedWidget>
    <my-embedded-widget foo=bar>
    ...

... the generated code is calling setAttribute():

define("delite/handlebars!acme/MyCompoundWidget.html", [ "acme/MyEmbeddedWidget" ], function() {
    return function anonymous(document, register) {
        var c1 = register.createElement("my-embedded-widget");
        c1.setAttribute("foo", "bar");

But, it should be setting the property directly:

c1.foo = "bar";

(Note that this wouldn't be a critical issue if we had attribute reflection as mentioned in #33. But we don't. And even if we did, it would still be somewhat of a performance issue.)

This is a regression from #432.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions