[browser][coreCLR] Skeleton for JavaScript host #119683
Draft
+5,201
−13
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Skeleton for JavaScript host
The goal on this PR is to establish directory structure and naming.
All new
*.js
files areartifacts\obj
artifacts\obj\native\<RID>\System.JavaScript\
next tolibSystem.JavaScript.a
New files
src\native\corehost\browser\
libBrowserHost.js
- implementsexternal_assembly_probe
callbackbrowserhost.cpp
- creates coreCLR instanceTRUSTED_PLATFORM_ASSEMBLIES
as env var for the PoC, to be improved.index.html
- target web pagemain.mjs
- this is demo of the NodeJS usage.dotnet.boot.js
- list of assets to download. This going to be generated by MSBuild of the WASM SDK later. It's 100% compatible with Mono/Blazorsrc\native\libs\Common\JavaScript
src\native\libs\System.JavaScript\
libSystem.JavaScript.js
- JS part of the librarylibSystem.JavaScript.extpost.js
- ES6 exports helpersCMakeLists.txt
,entrypoints.c
- native part of the library. C exports for P/Invoke.src\native\libs\System.Runtime.InteropServices.JavaScript\
libSystem.Runtime.InteropServices.JavaScript.js
- JS part of the libraryCMakeLists.txt
,entrypoints.c
- native part of the library. C exports for P/Invoke.src\native\libs\System.JavaScript.Loader\
dotnet.js
file in the final product.src\native\libs\System.JavaScript.Runtime\
dotnet.runtime.js
file in the final product.src\native\libs\
package.json
,package-lock.json
,.npmrc
- npm package definition and dependencies.eslintrc.cjs
,.eslintrc.cjs
- JS code stylerollup.config.js
- JS bundler and build script for TypeScripttsconfig.json
- typescript configurationQ & A
System.JavaScript.Loader
not part ofcorehost\browser
folder ?src\native
doesn't seem great choice.src\native\libs\JavaScript
?System.Security.Cryptography.Native.Android
.System.JavaScript.Runtime
folder intoSystem.Runtime.InteropServices.JavaScript
folder ?.js
files and one.a
filesrc\mono\browser\runtime
, are we going to reuse them ?Main()
needs to yield to browser event loop and marshalTask
/Promise
. Synchronousmain
is not very useful in JS.Fixes #119685
Contributes to #113067