-
Notifications
You must be signed in to change notification settings - Fork 55
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
Remove ITypeResolver to support Fable 4 #313
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -43,8 +43,8 @@ module Remoting = | |
{ options with CustomResponseSerialization = Some serializer } | ||
|
||
type Remoting() = | ||
static member buildProxy<'t>(options: RemoteBuilderOptions, [<Inject>] ?resolver: ITypeResolver<'t>) : 't = | ||
let resolvedType = resolver.Value.ResolveType() | ||
/// For internal library use only. | ||
static member buildProxy(options: RemoteBuilderOptions, resolvedType: Type) = | ||
let schemaType = createTypeInfo resolvedType | ||
match schemaType with | ||
| TypeInfo.Record getFields -> | ||
|
@@ -98,3 +98,5 @@ type Remoting() = | |
| _ -> | ||
failwithf "Cannot build proxy. Exepected type %s to be a valid protocol definition which is a record of functions" resolvedType.FullName | ||
|
||
static member inline buildProxy<'t>(options: RemoteBuilderOptions) : 't = | ||
Remoting.buildProxy(options, typeof<'t>) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've extracted the body of the function so that the rest of the code is not unnecessarily inlined and duplicated when using multiple remoting endpoints. Because of the inlining the extracted method has to be public too, but it should not cause any problems. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looks good, though in this case I don't believe inlining has much benefit so we can remove the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this be made
private
?