core icon indicating copy to clipboard operation
core copied to clipboard

Allow more ways to get an argument value for `InlineControl`

Open Jand42 opened this issue 8 years ago • 1 comments

For example client <@ myClientSideFunction myServerSideModuleValue @> fails with argument #1 is not a literal or local variable.

Workaround is to add a let myLocalValue = myServerSideModuleValue in the same scope. and use that in the quotation.

Improvement: add more recognizers to get argument values, if it is a static property get or method call, execute it to get the value. Optionally: if it has arguments itself, or is not static, use recursion to try to evaluate the quotation.

Similarly for C# version consuming Linq.Expressions.

Jand42 avatar Jul 28 '17 12:07 Jand42

There has been a related enhancement: pre-compiling any quotation literal passed to ClientSide/client that is not a single static method call, see #853.

Accessing server-side module values still require the value to be brought into local scope, as only that is recognized as a captured value needing serialization.

Jand42 avatar Jan 09 '18 11:01 Jand42