Closed Skillzore closed 3 years ago
As you can imagine, transpiling Java to TypeScript requires some tiny adaptations in the generated code. JSweet tries to stick to the original code as much as it can. The commitment consists in providing a fairly readable TS code, in order to reuse it if needed & as close as possible to the original code.
That being said, the transpiled TS code does not seem to be valid with strict mode indeed. Generated TypeScript code is transpiled (hence validated) with a recent version of tsc, but without strict option. I suggest you disable the TS strict option, if that's something you can do. Otherwise, please open an issue on the JSweet repository, to add strict mode support to JSweet, but it would require quite a lot of work.
Please tell me if this answers your question, and close the issue if so.
Hello @Skillzore Did you find time to try this out? I guess given the time of the year that you are probably in holidays :) Please keep us updated on how it's going on.
Happy new year, bye
Hello @Skillzore Do you have any news on this please?
Bye bye
Hi @lgrignon! Yes, I have been on a long holiday vacation. Furthermore, I was trying out JSweet as a PoC for possibly transpiling our existing backend java validations into our new react frontend, to use as client validation. Sadly I got stuck on this issue and the time for the PoC is now over. I would imagine that disabling the TS strict option would solve the problem, but I won't be able to confirm it. Thanks for your help!
Thanks for the feedback @Skillzore Just out of curiosity, could you please tell me which tool did you finally choose?
Now that my app is finally trying to run the jSweet code, it contains an error. I get this error when trying to compile my frontend:
The corresponding java constructor looks like this:
Is it the fact that the variable is final that causes the undefined check which results in the issue? Why would you do this at all? That code isn't present in java.