Load Javascript file from EmbeddedResource in WasmBrowser? #99746
-
If I have a WASM project(WASM Browser tempalte from wasm-expiremental workload) referencing another class library project or nuget package that will be compiled into the WASM project,. Is there a way for the class library project to emit its javascript declarations it depends on, or for ImportAsync to reference an embedded file? Currently I use Uno's invokeJS passing the entire embedded script content to emit the declarations that my JSImport's depend on: |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 12 replies
-
Have you considered using "Razor classlib"? It doesn't have to contain any razor files, but it works well with the WebAssembly SDK. |
Beta Was this translation helpful? Give feedback.
-
I had read on it, and wasn't sure how specific it was. I will try that
thanks.
…On Thu, Mar 14, 2024, 7:52 AM Marek Fišera ***@***.***> wrote:
Have you considered using "Razor classlib"? It doesn't have to contain any
razor files, but it works well with the WebAssembly SDK.
—
Reply to this email directly, view it on GitHub
<#99746 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AXFH3LDIC7AQ5ISYWVH4U3TYYGFQNAVCNFSM6AAAAABEVORFC2VHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM4DOOBVGI2TC>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
I searched from the solution root and there were no publish folders(I checked specifically the location you mention in your issue as well). Clicking Publish in the profile UI doesn't do anything other than output this to built output:
I tried running dotnet publish command from nuget console(intending to turn on verbose output) referencing the publish profile name, there was definitely more activity, and I saw the publish folders get created(created an empty publish folder in correct location, and populated another publish folder in the "wrong" location consistent with your issue.). I deleted publish folders, and retried the Publish button in UI, still nothing happened. Ran command again and it works. So seems somehow specific to the UI. I have a workaround at least. I also notice the oddity that Target runtime is initially set to Portable in publish profile UI, which matches your screen shot in linked issue, but if I click edit it changes to browser-wasm, and there is no portable option in that drop down. Doesn't have any impact on whether it works or not though. Do you observe this UI oddity as well?
It is sufficient, thanks. |
Beta Was this translation helpful? Give feedback.
Have you considered using "Razor classlib"? It doesn't have to contain any razor files, but it works well with the WebAssembly SDK.