Skip to content

Commit 89cfbfd

Browse files
authored
[wasm] bump devDependencies to rollup 3 and TypeScript 4.9 (#78726)
* Bump dev dependencies Typescript 4.9 rollup 2.79.1 (can't bump to rollup 3 until rollup-plugin-consts 1.1.1 is published to raise it's upper bound rollup dependency) * bump to rollup 3 replace untmainained rollup-plugin-terser with @rollup/plugin-terser replace rollup-plugin-consts with a shim @rollup/plugin-virtual. They do the same thing, but consts is more opinionated about how it names its modules * Commit new package-lock.json * Create package-lock.json using npm v6 (from Emscripten) And use the dnceng npm registry * update README with more details about upgrading NPM packages * Make markdownlint happy
1 parent f463fe7 commit 89cfbfd

File tree

5 files changed

+352
-259
lines changed

5 files changed

+352
-259
lines changed

src/mono/wasm/README.md

Lines changed: 49 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ Add `~/.jsvu` to your `PATH`:
7171

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

74-
* * Install jsvu with npm:
74+
* Install jsvu with npm:
7575

7676
`npm install jsvu -g`
7777

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

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

138-
```
138+
```console
139139
src/mono/wasm/symbolicator$ dotnet run /path/to/dotnet.js.symbols /path/to/file/with/traces
140140
```
141141

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

156156
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.
157157

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

160160
## Run samples
161161

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

190190
Example use of the `wasmconsole` template:
191191

192-
> dotnet new wasmconsole
193-
> dotnet publish
194-
> cd bin/Debug/net7.0/browser-wasm/AppBundle
195-
> node main.mjs
196-
mono_wasm_runtime_ready fe00e07a-5519-4dfe-b35a-f867dbaf2e28
197-
Hello World!
198-
Args:
192+
```console
193+
> dotnet new wasmconsole
194+
> dotnet publish
195+
> cd bin/Debug/net7.0/browser-wasm/AppBundle
196+
> node main.mjs
197+
mono_wasm_runtime_ready fe00e07a-5519-4dfe-b35a-f867dbaf2e28
198+
Hello World!
199+
Args:
200+
```
199201

200202
## Upgrading Emscripten
201203

@@ -210,23 +212,56 @@ Bumping Emscripten version involves these steps:
210212
* 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
211213

212214
## Upgrading NPM packages
215+
216+
Two things to keep in mind:
217+
218+
1. We use the Azure DevOps NPM registry (configured in `src/mono/wasm/runtime/.npmrc`). When
219+
updating `package.json`, you will need to be logged in (see instructions for Windows and
220+
mac/Linux, below) in order for the registry to populate with the correct package versions.
221+
Otherwise, CI builds will fail.
222+
223+
2. Currently the Emscripten SDK uses NPM version 6 which creates `package-lock.json` files in the
224+
"v1" format. When updating NPM packages, it is important to use this older version of NPM (for
225+
example by using the `emsdk_env.sh` script to set the right environment variables) or by using the
226+
`--lockfile-format=1` option with more recent versions of NPM.
227+
228+
### Windows
229+
230+
The steps below will download the `vsts-npm-auth` tool from https://dev.azure.com/dnceng/public/_artifacts/feed/dotnet-public-npm/connect/npm
231+
213232
In folder `src\mono\wasm\runtime\`
233+
214234
```sh
215235
rm -rf node_modules
216236
rm package-lock.json
217-
npm install -g vsts-npm-aut`
237+
npm install -g vsts-npm-auth`
218238
vsts-npm-auth -config .npmrc
219-
npm npm cache clean --force
239+
npm cache clean --force
220240
npm outdated
221-
npm update
241+
npm update --lockfile-version=1
242+
```
243+
244+
### mac/Linux
245+
246+
Go to https://dev.azure.com/dnceng/public/_artifacts/feed/dotnet-public-npm/connect/npm and log in and click on the "Other" tab.
247+
Follow the instructions to set up your `~/.npmrc` with a personal authentication token.
248+
249+
In folder `src/mono/wasm/runtime/`
250+
251+
```sh
252+
rm -rf node_modules
253+
rm package-lock.json
254+
npm cache clean --force
255+
npm outdated
256+
npm update --lockfile-version=1
222257
```
223258

224259
## Code style
260+
225261
* Is enforced via [eslint](https://eslint.org/) and rules are in `./.eslintrc.js`
226262
* You could check the style by running `npm run lint` in `src/mono/wasm/runtime` directory
227263
* 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
228264

229-
230265
## Builds on CI
231266

232267
* 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.
@@ -251,7 +286,6 @@ npm update
251286
| Debugger tests | linux+windows: only-pc |
252287
| Runtime tests | linux+windows: only-pc |
253288

254-
255289
### Run manually with `/azp run ..`
256290

257291
* `runtime-wasm*` pipelines are triggered manually, and they only run the jobs that would not run on any default pipelines based on path changes.

src/mono/wasm/runtime/http.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,9 +142,9 @@ export async function http_wasm_get_streamed_response_bytes(res: ResponseExtensi
142142
interface ResponseExtension extends Response {
143143
__buffer?: ArrayBuffer
144144
__reader?: ReadableStreamDefaultReader<Uint8Array>
145-
__chunk?: ReadableStreamDefaultReadResult<Uint8Array>
145+
__chunk?: ReadableStreamReadResult<Uint8Array>
146146
__source_offset: number
147147
__abort_controller: AbortController
148148
__headerNames: string[];
149149
__headerValues: string[];
150-
}
150+
}

0 commit comments

Comments
 (0)