language-server icon indicating copy to clipboard operation
language-server copied to clipboard

Dynamic tag `Marko.Body<[{ foo: bar }]>` is inconsistent between params and args

Open LuLaValva opened this issue 1 year ago • 1 comments

@marko/[email protected]

Details

The following should be equivalent:

<${input.renderBody} foo=bar />
<${input.renderBody}({ foo: bar }) />

But they aren't. It looks like Marko.Body<{ foo: bar }> expects Directives & { value: [{ foo: bar; }]; }, which may have been carried over from when the syntax for dynamic tag params was going to be <${input.renderBody}=[{ foo: bar}] />. This should probably be updated.

Steps to Reproduce

Example template:

export interface Input {
  renderBody: Marko.Body<[{ foo: string }]>;
}

<${input.renderBody} foo="bar" />
<${input.renderBody}({ foo: "bar" }) />

LuLaValva avatar Jul 09 '24 22:07 LuLaValva

This was fixed by #262 but it caused a regression and the fix was reverted in #286. Will require some more thought.

DylanPiercey avatar Oct 24 '24 01:10 DylanPiercey