-
Notifications
You must be signed in to change notification settings - Fork 311
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[TS] Generate imports rule when using a "ParamObject" from another file #4025
Comments
@MangelMaxime Can you point me to some examples on the import rules? Then i can have a look at it. |
A tricky thing here is the semantics of the attributes is being challenged. At this point, if #4007 has only been released in alpha the @MangelMaxime If you agree with that I can try to adapt your work in #4007 in this sense. |
Feel free to have a look, I mostly tried to fix the code gen but still don't know all the internal.
The current implementation tried to cover all the cases, and it kind of works. The best solution would be to generate real interface inheritance or JSDoc to propagate correctly but the union type does the jobs (just JSDoc is useless in this cases). |
@Freymaurer Should be fixed with 5.0.0-alpha.10 |
Awesome will test it tomorrow! 🚀 |
Seems like fable expects to find a type reflection information for my [<Pojo; AllowNullLiteral>]
type Term (?name: string, ?id: string, ?description: string, ?source: string, ?href: string, ?isObsolete: bool, ?data: obj) =
member val name: string option = name with get, set
member val id: string option = id with get, set
member val description: string option = description with get, set
member val source: string option = source with get, set
member val href: string option = href with get, set
member val isObsolete: bool option = isObsolete with get, set
member val data: obj option = data with get, set
This was triggered by using the pojo as field in a record type: type private TermSearchResult = {
Term: Term
IsDirectedSearchResult: bool
} producing the following reflection for the record type (note function TermSearchResult_$reflection(): TypeInfo {
return record_type("Swate.Components.TermSearchResult", [], TermSearchResult, () => [["Term", Term_$reflection()], ["IsDirectedSearchResult", bool_type]]);
} |
Indeed, reflection should ignore Pojos as it does with other erased types. I sent #4048 for it. |
Co-authored-by: Maxime Mangel <[email protected]>
@Freymaurer reported to me that we don't have
import
the type when consuming a "ParamObject" defined in another file which results in a TS compilation error.Related to the work done in #4007
The text was updated successfully, but these errors were encountered: