Skip to content

Conversation

@pavelsavara
Copy link
Member

@pavelsavara pavelsavara commented Sep 21, 2021

Goals

Introduce typescript and break up the code to multiple, better encapsulated modules.

  • use EMSDK nodejs for the build
  • use rollup.js to produce ES6 IFFE because emscripten doesn't know how to consume ES6 modules on input.
  • the ts output file runtime.iffe.js is compiled with emcc and AOT as --pre-js
  • package.json references explicit versions of dev-time only dependencies. They are not necessary on link time.
  • dependencies are resolved with npm ci in CI pipeline to make sure we get exactly same version as in lock file.
  • we also run npm audit in CI so that we are sure we don't have new security issue in the CI.
  • we have small rollup plugin which checks sha256 hash of the output and doesn't overwrite it if it's the same. So that incremental build/link is not broken.
  • ignore_pdb_load_errors is now Module.config option

Non-goals

  • just library_mono.js , the rest will be in follow up PRs
  • functional changes
  • later: lint, renames, more cleanup
  • API change toward embedders like Blazor
  • sourcemaps

@pavelsavara pavelsavara added the arch-wasm WebAssembly architecture label Sep 21, 2021
@pavelsavara pavelsavara added this to the 7.0.0 milestone Sep 21, 2021
@pavelsavara pavelsavara requested review from kg and lewing September 21, 2021 03:19
@ghost
Copy link

ghost commented Sep 21, 2021

Tagging subscribers to 'arch-wasm': @lewing
See info in area-owners.md if you want to be subscribed.

Issue Details

null

Author: pavelsavara
Assignees: -
Labels:

arch-wasm

Milestone: 7.0.0

@ghost
Copy link

ghost commented Sep 21, 2021

I couldn't figure out the best area label to add to this PR. If you have write-permissions please help me learn by adding exactly one area label.

@am11
Copy link
Member

am11 commented Sep 24, 2021

Would this make it possible to make WasmEnableES6 default to true with this change?

<WasmEnableES6 Condition="'$(WasmEnableES6)' == ''">false</WasmEnableES6>

WasmEnableES6 results in importable ES6 module for dotnet in deno environment. It's also compatible in browser (since WASM and ES6 are mutually supported everywhere).

@pavelsavara
Copy link
Member Author

pavelsavara commented Sep 25, 2021

Would this make it possible to make WasmEnableES6 default to true with this change?

<WasmEnableES6 Condition="'$(WasmEnableES6)' == ''">false</WasmEnableES6>

WasmEnableES6 results in importable ES6 module for dotnet in deno environment. It's also compatible in browser (since WASM and ES6 are mutually supported everywhere).

I would love to, but I need to work thru all the consequences. Our unit test infrastructure and also the way how external projects like ASP.NET/Blazor consume us. So most likely it would not be in this PR.

But it's on my wish list too.

- use nodeJs from EMSDK
- use rollup.js for packing code as ES6 IFFE for emcc consumption
- incremental build Co-authored-by: Radek Doulik <[email protected]>
- types Co-authored-by: Daniel Genkin <[email protected]>
@pavelsavara
Copy link
Member Author

OSX failure is unrelated timeout.

@pavelsavara pavelsavara marked this pull request as ready for review September 25, 2021 16:11
@pavelsavara pavelsavara requested review from kg and radical September 25, 2021 16:11
@pavelsavara
Copy link
Member Author

@radical I introduced new file to AOT inputs. I don't know how it would impact VS/workloads. We will probably remove or rename all the other .js files too in next PR. Would something break in the meantime ?

@radical
Copy link
Member

radical commented Sep 25, 2021

cc @Thays to try this with the debugger tests.

@pavelsavara pavelsavara merged commit ca2cb03 into dotnet:main Sep 27, 2021
@pavelsavara pavelsavara changed the title [draft][wasm] introduce typescript modules [wasm] introduce typescript modules Sep 27, 2021
@ghost ghost locked as resolved and limited conversation to collaborators Nov 3, 2021
@pavelsavara pavelsavara deleted the wasm_ts4 branch January 4, 2022 13:04
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

arch-wasm WebAssembly architecture

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants