Appears to be a dumb question, but how do you deploy/use the output from an Elements/Oxygene/WebAssembly project. Delphi/TMSWebCore produces a .js file which runs when moved to the web server. I cannot get the output from WebAssembly to do anything.
There are 4 files involved in Wasm:
- Index.html : This one can/should be changed of course, but it’s what uses and loads the Wasm.
- wasm/Module41.js: this one is per project (named after your project); this contains code to interact with the wasm for project.
- wasm/Module41.wasm: The actual wasm module
Essentially you can rename/move them all, except that if you do, when instantiating the module you need to pass the name of the wasm file with it:
Thanks, logged as bugs://83262 — to document this better
Thanks. I have tried 3 different browsers and 3 different web servers and half a dozen examples of web assemby, including output from Elements and examples from Mozilla, but I have not yet managed to get a single bit to run in a web page. It should not be this difficult. I will perhaps look at webassembly again in a year or two, but for now I will stick with Delphi/TMS.
I’m sorry to hear that. What kind of errors are you getting? I assume the Elements-based project works ok for you when run from the IDE in the debugger, when Elements does the setup?
Do note that WebAssembly will only work on in the browser for pages accessed via http(s), not for local files (Dom;'t ask me why, but thats the browser’s doing). So that might be (part of) the problem…
Let’s work together to get the working for you!