Discourse core 正在切换到 pnpm 进行 JS 包管理

The speed improvements are most noticeable from a ‘cold start’. e.g. in our GitHub actions CI, yarn would take 90s+, while pnpm completes in about 15s.

That might be because we haven’t bumped the base image since making this change. So, on stable, the yarn dependencies are already installed. Wheras for tests-passed, the yarn dependencies have to be thrown away before doing a pnpm install from scratch.

So, the situation will improve for tests-passed after the next base image bump.

6 个赞

We’re not using Docker… :grimacing:

So this is a problem in our custom environment.
I’m going to dig into this and see what goes wrong.

4 个赞

I’m getting errors about the pnpm versions. I’m nudged to run pnpm self-update to run the latest version of pnpm, so I’m running 10.3.0 now. But then it seems the theme skeleton or other components expect a specific pnpm version? E.g:

1 个赞

Yeah the lockfile format changed in 10.0, and it’s not yet supported by GitHub’s dependabot, so we’ve pinned core and all themes/plugins to 9.x.

In theory it’s supposed to auto-switch back to 9.x… but it seems it isn’t working for everyone :cry:

If you do pnpm self-update 9 does that get things working again?

4 个赞

Oh yes, that works! :sunglasses:

3 个赞