Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[wasm] bump devDependencies to rollup 3 and TypeScript 4.9 #78726

Merged
merged 7 commits into from
Nov 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 49 additions & 15 deletions src/mono/wasm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ Add `~/.jsvu` to your `PATH`:

* Install node/npm from https://nodejs.org/en/ and add its npm and nodejs directories to the `PATH` environment variable

* * Install jsvu with npm:
* Install jsvu with npm:

`npm install jsvu -g`

Expand Down Expand Up @@ -135,7 +135,7 @@ Exceptions thrown after the runtime starts get symbolicating from js itself. Exc

If you need to symbolicate some traces manually, then you need the corresponding `dotnet.js.symbols` file. Then:

```
```console
src/mono/wasm/symbolicator$ dotnet run /path/to/dotnet.js.symbols /path/to/file/with/traces
```

Expand All @@ -155,7 +155,7 @@ To run a test with `FooBar` in the name:

Additional arguments for `dotnet test` can be passed via `MSBUILD_ARGS` or `TEST_ARGS`. For example `MSBUILD_ARGS="/p:WasmDebugLevel=5"`. Though only one of `TEST_ARGS`, or `TEST_FILTER` can be used at a time.

- Chrome can be installed for testing by setting `InstallChromeForDebuggerTests=true` when building the tests.
Chrome can be installed for testing by setting `InstallChromeForDebuggerTests=true` when building the tests.

## Run samples

Expand Down Expand Up @@ -189,13 +189,15 @@ To test changes in the templates, use `dotnet new install --force src/mono/wasm/

Example use of the `wasmconsole` template:

> dotnet new wasmconsole
> dotnet publish
> cd bin/Debug/net7.0/browser-wasm/AppBundle
> node main.mjs
mono_wasm_runtime_ready fe00e07a-5519-4dfe-b35a-f867dbaf2e28
Hello World!
Args:
```console
> dotnet new wasmconsole
> dotnet publish
> cd bin/Debug/net7.0/browser-wasm/AppBundle
> node main.mjs
mono_wasm_runtime_ready fe00e07a-5519-4dfe-b35a-f867dbaf2e28
Hello World!
Args:
```

## Upgrading Emscripten

Expand All @@ -210,23 +212,56 @@ Bumping Emscripten version involves these steps:
* update packages in the workload manifest https://github.com/dotnet/runtime/blob/main/src/mono/nuget/Microsoft.NET.Workload.Mono.Toolchain.Manifest/WorkloadManifest.json.in

## Upgrading NPM packages

Two things to keep in mind:

1. We use the Azure DevOps NPM registry (configured in `src/mono/wasm/runtime/.npmrc`). When
updating `package.json`, you will need to be logged in (see instructions for Windows and
mac/Linux, below) in order for the registry to populate with the correct package versions.
Otherwise, CI builds will fail.

2. Currently the Emscripten SDK uses NPM version 6 which creates `package-lock.json` files in the
"v1" format. When updating NPM packages, it is important to use this older version of NPM (for
example by using the `emsdk_env.sh` script to set the right environment variables) or by using the
`--lockfile-format=1` option with more recent versions of NPM.

### Windows

The steps below will download the `vsts-npm-auth` tool from https://dev.azure.com/dnceng/public/_artifacts/feed/dotnet-public-npm/connect/npm

In folder `src\mono\wasm\runtime\`

```sh
rm -rf node_modules
rm package-lock.json
npm install -g vsts-npm-aut`
npm install -g vsts-npm-auth`
vsts-npm-auth -config .npmrc
npm npm cache clean --force
npm cache clean --force
npm outdated
npm update
npm update --lockfile-version=1
```

### mac/Linux

Go to https://dev.azure.com/dnceng/public/_artifacts/feed/dotnet-public-npm/connect/npm and log in and click on the "Other" tab.
Follow the instructions to set up your `~/.npmrc` with a personal authentication token.

In folder `src/mono/wasm/runtime/`

```sh
rm -rf node_modules
rm package-lock.json
npm cache clean --force
npm outdated
npm update --lockfile-version=1
```

## Code style

* Is enforced via [eslint](https://eslint.org/) and rules are in `./.eslintrc.js`
* You could check the style by running `npm run lint` in `src/mono/wasm/runtime` directory
* You can install [plugin into your VS Code](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint) to show you the errors as you type


## Builds on CI

* For PRs, tests are generally triggered based on path changes. But if you have a change which would not trigger the relevant builds, then you can run `runtime-wasm` pipeline manually to run all of them. Comment `/azp run runtime-wasm` on the PR.
Expand All @@ -251,7 +286,6 @@ npm update
| Debugger tests | linux+windows: only-pc |
| Runtime tests | linux+windows: only-pc |


### Run manually with `/azp run ..`

* `runtime-wasm*` pipelines are triggered manually, and they only run the jobs that would not run on any default pipelines based on path changes.
Expand Down
4 changes: 2 additions & 2 deletions src/mono/wasm/runtime/http.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,9 @@ export async function http_wasm_get_streamed_response_bytes(res: ResponseExtensi
interface ResponseExtension extends Response {
__buffer?: ArrayBuffer
__reader?: ReadableStreamDefaultReader<Uint8Array>
__chunk?: ReadableStreamDefaultReadResult<Uint8Array>
__chunk?: ReadableStreamReadResult<Uint8Array>
__source_offset: number
__abort_controller: AbortController
__headerNames: string[];
__headerValues: string[];
}
}
Loading