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

Conversation

lambdageek
Copy link
Member

@lambdageek lambdageek commented Nov 22, 2022

  1. rollup-plugin-consts hasn't released a version that works with rollup 3. But @rollup/plugin-virtual can do everything that we need from consts.
  2. rollup-plugin-terser is unmaintained and has been superseded by @rollup/plugin-terser
  3. TypeScript 4.9 got rid of a type used by http.ts, but fortunately there's a straightforward replacement for what we need.
  4. fast-glob changed how it exports the sync API

Fixes #78708

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)
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
@lambdageek
Copy link
Member Author

/azp run runtime-wasm

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@lambdageek
Copy link
Member Author

 npm ERR! code E401
  npm ERR! Unable to authenticate, your authentication token seems to be invalid.
  npm ERR! To correct this please trying logging in again with:
  npm ERR!     npm login
  
  npm ERR! A complete log of this run can be found in:
  npm ERR!     /home/cloudtest_azpcontainer/.npm/_logs/2022-11-22T20_45_44_497Z-debug.log

What does this mean? It seems related to src/mono/wasm/runtime/.npmrc. similar to what was happening with #71393. Any ideas how that issue was resolved? @radical @steveisok

@pavelsavara
Copy link
Member

pavelsavara commented Nov 23, 2022

What does this mean?

I think it means that some of the NPM packages you use are not in the corporate NPM repository. I think we need to ask first-responders to add the package. Or maybe if we know how to log-in we could do it ourselves.

@maraf do you know how ?

@pavelsavara
Copy link
Member

"lockfileVersion": 2, please use nodejs version in the emsdk to create the lock file v 1.

@pavelsavara
Copy link
Member

Just visual sanity check: take the minified dotnet.js, prettify it with some tool and run diff to previous version.
Since emsdk has it's own closure compiler on top of our terser, there may be (new) problems.

@maraf
Copy link
Member

maraf commented Nov 23, 2022

@maraf Marek Fisera FTE do you know how ?

No idea

@lambdageek
Copy link
Member Author

lambdageek commented Nov 23, 2022

"lockfileVersion": 2, please use nodejs version in the emsdk to create the lock file v 1.

I did the upgrade using npm from emsdk. Is there some trick to make it generate a v1 lockfile?

Update: looks like there's a --lockfile-version option for npm

@lambdageek
Copy link
Member Author

lambdageek commented Nov 23, 2022

Ok I see.

Apparently the workflow has to be something like this (based on #71393 (comment)):

  1. Run source .../emsdk_env.sh so that the EMSDK version of node and npm are used
  2. Run npm cache clean -force
  3. Go to https://dev.azure.com/dnceng/public/_artifacts/feed/dotnet-public-npm/connect/npm and setup authentication to the azdo npm registry - on linux/mac login and look at the "Other" tab for instructions on modifying your ~/.npmrc
  4. Edit the package.json to bump the versions
  5. run npm install --lockfile-version=1

@lambdageek
Copy link
Member Author

"lockfileVersion": 2, please use nodejs version in the emsdk to create the lock file v 1.

oh I see what happened - my make provision-wasm was fine, but at some point I must have upgraded npm in the emscripten sdk.

@lambdageek
Copy link
Member Author

Hmm... rollup potentially doesn't like npm v6. I suspect it doesn't matter for us, but maybe the warning will trip something up on CI

npm WARN notsup Unsupported engine for rollup@3.4.0: wanted: {"node":">=14.18.0","npm":">=8.0.0"} (current: {"node":"14.18.2","npm":"6.14.15"})
npm WARN notsup Not compatible with your version of node/npm: rollup@3.4.0

@lambdageek
Copy link
Member Author

Comparing runtime.es6.iffe.js from this PR and main after running through VS Code "prettier" extension, the only differences I see are the choice of some of the minified variable names (new terser seems to like _ more than d and W more than P)

@radical
Copy link
Member

radical commented Nov 23, 2022

..

  1. Run source .../emsdk_env.sh so that the EMSDK version of node and npm are used
  2. Run npm cache clean -force
  3. Go to https://dev.azure.com/dnceng/public/_artifacts/feed/dotnet-public-npm/connect/npm and setup authentication to the azdo npm registry - on linux/mac login and look at the "Other" tab for instructions on modifying your ~/.npmrc
  4. Edit the package.json to bump the versions
  5. run npm install --lockfile-version=1

Can this be added to src/mono/wasm/README.md? this and the thing about using specific npm version.

@lambdageek
Copy link
Member Author

Can this be added to src/mono/wasm/README.md? this and the thing about using specific npm version.

done

Copy link
Member

@pavelsavara pavelsavara left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

many thanks!

@lambdageek lambdageek merged commit 89cfbfd into dotnet:main Nov 24, 2022
@ghost ghost locked as resolved and limited conversation to collaborators Dec 24, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[wasm] consider bumping devDependencies
4 participants