Netflix / x-element

A dead simple starting point for custom elements.
Apache License 2.0
28 stars 12 forks source link

Computed property DSL should support multi-line strings #24

Closed klebba closed 5 years ago

klebba commented 5 years ago

Is this case easy to support?

static get properties() {
  return {
    foo: {
      type: Object,
      computed: `computeFoo(
        barHasAReallyLongName,
        baz,
        fizz,
        buzz,
      )`,
    },
  };
}
theengineear commented 5 years ago

@klebba I'm not sure I like supporting that trailing comma. Mind if we skip that bit? I.e., this looks like broken code to me foo(a,b,c,).

theengineear commented 5 years ago

Or, were you thinking you wanted to support only a trailing comma if it's multiline?

theengineear commented 5 years ago

Ah... I guess it's valid... so why not. Sorry for the noise, trailing commas it is 👍. It reduces the code anyhow.

Actually, interestingly enough, it's more complicated (by two characters) since you can't have duplicated, intermediate commas foo(a,,,,,b)!