Closed MangelMaxime closed 9 months ago
I don't know if this could be related but I added compiler directives in Thoth.Json to remove the code not supported by fable-standalone
https://github.com/thoth-org/Thoth.Json/commit/32c3fde07364ae6bb5a02853a1f4b1ef8468d639
@MangelMaxime Not sure exactly, could it be two different compiler versions being used? If not, have you tried using interfaces to eliminate name mangling of the exported APIs?
Also, just FYI, there is probably no need to pass the additional DLLs dependencies through the export metadata process, since they're most likely just bindings with little code. All the export does is to remove the code part in the DLL, which is probably very small anyway, so there may not be a lot of size savings there, so just use the original DLL as is (in addition to the binaries from fable-metadata
).
Hum 🤔
After several days I came back to this PR and it is now working.
If I remember correctly I had the same thing happen when upgrading Fable.React library.
- Day 1: Not working
- Day 2: Recompiling and working again
I suspect that there is a cache happening somewhere which either import the wrong version of the precompiled library or of the compiler. The good news is I can upgrade the libraries if I wait 1 day between the compilation and the test 😂
Will explore more ^^
Not sure if it's related, but my project only showed a blank screen (without errors) after updating Fable from v2.4.11. At the end updating Paket dependencies made it work, I suspect it was Fable.Elmish.Browser.
I just remember we indeed use a service-worker.js file which controls the cache.
We don't include in when in DEBUG mode but I suspect it is still active because nonetheless.
Hum, for your error @alfonsogarciacaro it happens to me to have the black loader screen infinite and reloading the page again fixed it. I don't have yet updated Elmish dependencies in this branch was stuck with Thoth.Json but I will update the rest of the dependencies later today as it seems I am unstuck for now.
Forget all I said I was on master branch locally... 🤦♂️
I need to re-check everything
Ooh, maybe I say well maybe I forgot to regenerate the metadata/update the Fable.Repl.Lib.dll since updating the dependencies version.
Which would explain why it was generating an "incorrect" JavaScript code.
Going back to upgrading more library and see if I am right ^^
@ncave I could need your help 🙏
I am trying to upgrade the dependencies used in the REPL and I am facing a problem.
I re-added a target which is generated the METADATA for the libraries specific to the REPL. I am still using 95% of the metadata coming from
fable-metadata
but because I am planning to add more I think it better to keep the specific one in the REPL directory for now. Especially, because we need to know which version of the library has been used in order to use the precompiled JavaScript etc.You can see it here
It is running your fork of fsharp located next to the repl folder. |Here are the instructions](https://github.com/fable-compiler/repl/pull/110/files#diff-d300a8c093f5d0ef8a62d44baf18ec2c) I followed to configure your repository.
I would say this is working because the code generated between my local version of the REPL and the online version is not the same.
F# code
Generated code from my local version
Generated code from my online version
For example, the local version is generating
import { FunctionComponent$$$Of$$Z5A158BBF
while online version generateimport { FunctionComponent$$$Of$$2F363EB5
.However, I am facing a problem when trying to use some code from Thoth.Json.
F# code
I get this error:
Indeed if I look at the generated code in
public\js\repl\lib\src\Decode.js
I seeexport function Auto$$$unsafeFromString$$Z5CB6BD
which is not the same name.Do you have an idea why this is happening? What can I do to explore the problem?