http://localhost/json/reply/e instead of POCO name.
I am mostly missing something. But couldn't figure it out. It would be great if someone can point me into right direction.
We're going to need a lot more info on exactly what the issue is and what you're referring to. What did you minify, how? and what code is no longer working?
Thanks for quick reply. I'm using service stack client library with Fable-Elmish .
It is working great in dev mode. Without any issues. Means I don't have to provide URL. Library is figuring out.
But currently whole no URL option broke for me in minified code.
Fable-ElMish: it is wrapper around react and redux to provide elm architecture in F#. Fable transpile to ES6 and then bable transpile to current java script. And all magic happens using web pack.
This description isn't helpful, please provide the exact source code that's causing the issue, including the libraries you're using as well as the DTOs. i.e. provide all relevant info in order to be able to reproduce the issue.
Sure. Will share the details by tomorrow.
Thanks replying again.
Here is the project to reproduce the issue. You can follow read me to run it in dev mode.
Then for Todo in dev mode URL coming as
http://sometodourl/json/reply/ToDoByUser . Now if you run command
So, you can run any local server for public folder (I am using node
http-server). It will run everything but while hitting server it is coming as
PS: sometodourl I put as dummy url. As I am just testing for generated url while hitting network.
PS: This was the demo I was talking about a little back. Years back in early days of Servicestack you introduce the concept of message passing for communication with server for dot net. Now, every latest java-script architecture like Elm, Fable-Elmish is using it. They force server framework to think in message passing and as servicestack is already having concept it; it fits right into it. Even here I just copy -pasted DTOs and they are used directly as model. I don't have to translate it anyway. And thanks for seeing the future way back in past.
ok so it looks like you're trying to use F# DTOs in your Fable project than compile that to JS.
But you can't minify the F# DTOs because they won't preserve the Type Name which is needed in order to construct the url so your options are:
- Extract the F# DTOs into separate .js file which you configure to not get minified
- Use TypeScript DTOs (transpiled to js) instead which are safe to Minify
- Add a
member this.getTypeName() = "TheDtoName" to your F# DTOs which the ServiceStack JsonServiceClient will use instead.
Last option of adding
Have a look. https://github.com/kunjee17/fable-elmish-react/blob/master/src/Lib/Todo.Import.fs#L34 this line actually did the magic. Thanks man...
I've just ran into this issue after getting our minified production build for React. Our project is JS / JSX, and we use the TypeScript DTO's transpiled to js and minified, but receive all the same errors. @mythz was there something else we have to do to make this work?
The generated TypeScript DTOs should survive minimisation, please provide a stand alone repro of what doesn’t work.
For anyone stumbling upon this, your dtos MUST inherit from some type of IReturn (IReturnVoid, IReturn<>, QueryDb<>, etc...).
Otherwise the getTypeName() isn't generated in your dtos.ts.
Also most of the typed Service Client APIs (in all languages) require it.
Yeah ServiceStack made me a little lazy and I was enjoying some of the type-freedom with returning objects 🤣. I learned my lesson though.