dotnet-websharper / core

WebSharper - Full-stack, functional, reactive web apps and microservices in F# and C#
https://websharper.com
Apache License 2.0
589 stars 52 forks source link

Expand Generator API #1373

Closed Jand42 closed 6 months ago

Jand42 commented 6 months ago

Add new fields Expression and CompiledMember to the input record of Generate method, that passes in the expression if any (if the member annotated with [<Generate>] also have [<JavaScript>], or [<Inline>], there will be an expression, otherwise Undefined), and the compiled form of the current member, as deduced from attributes like [<Name>] etc.

Add new output case GeneratorCompiledMemberChange of CompiledMember * GeneratorResult that can signal that the generator makes a change to the CompiledMember information (which determines where the current member will live in JS code).

These are non-breaking API changes.