Replies: 6 comments
-
Resource values? Literal fields? |
Beta Was this translation helpful? Give feedback.
-
@Happypig375 Do you offer Generation of literals as a part of build process? Any known solutions libraries for this? |
Beta Was this translation helpful? Give feedback.
-
I mean, if the assembly |
Beta Was this translation helpful? Give feedback.
-
@Happypig375 Sorry, I do not get the idea. The assembly should be there before compilation starts. It should be either another project in the same solution, or nuget package - literally a binary artefact which exists before F# compiler starts. |
Beta Was this translation helpful? Give feedback.
-
@voroninp I think this may be what you are looking for: https://github.com/Tarmil/FSharp.Data.LiteralProviders |
Beta Was this translation helpful? Give feedback.
-
@NatElkins Yes, this is very useful, thanks a lot! Tough I think this approach is not perfect as it pollutes a bit the code with the stuff which does not strictly belong to the place where type is defined. And is it really a responsibility of the code to decide where literals are coming from? I'd delegate this decision to 3d party. I should not care about the source so far it can make compiler happy. |
Beta Was this translation helpful? Give feedback.
-
Is your feature request related to a problem? Please describe.
Due to the nature of type providers all their static parameters must be literals. It's fine until you want to implement CI/CD pipeline and then you need to configure type providers dynamically regarding build process. Each type provider solves this issue individually. Some let you define the path to local file which will be tried as a fallback, if resource is not available at given url.
Describe the solution you'd like
It would be very nice if F# compiler could query existing assembly for the values of static parameters.
And then assembly
TypeProviderValues.dll
which would adhere to some known strict protocol could return values for all required and optional parameters.For example this assembly could use environment variables, or some json files or any other sources for populating parameters.
Beta Was this translation helpful? Give feedback.
All reactions