Skip to content

chore: upgrade from yarn 1 to 3 - #224

Closed
jawnsy wants to merge 4 commits into
mainfrom
jawnsy/switch-yarn3
Closed

jawnsy wants to merge 4 commits into
mainfrom
jawnsy/switch-yarn3

Conversation

@jawnsy

@jawnsy jawnsy commented Feb 9, 2022

Copy link
Copy Markdown

Switch from Yarn Classic (1.22) to Yarn Berry (3.1.1) in order
to speed up install and builds.

Jonathan Yu added 2 commits February 9, 2022 19:38
Switch from Yarn Classic (1.22) to Yarn Berry (3.1.1) in order
to speed up install and builds.
@codecov

codecov Bot commented Feb 9, 2022 •

Copy link
Copy Markdown

Codecov Report

Merging #224 (bb30589) into main (c44d036) will increase coverage by 0.13%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #224      +/-   ##
==========================================
+ Coverage   68.31%   68.44%   +0.13%     
==========================================
  Files         111      111              
  Lines        6003     6003              
  Branches       67       67              
==========================================
+ Hits         4101     4109       +8     
+ Misses       1512     1507       -5     
+ Partials      390      387       -3     
Flag Coverage Δ
unittest-go-macos-latest 66.47% <ø> (+0.20%) ⬆️
unittest-go-ubuntu-latest 67.62% <ø> (+0.11%) ⬆️
unittest-go-windows-latest 66.07% <ø> (+0.14%) ⬆️
unittest-js 64.76% <ø> (ø)
Impacted Files Coverage Δ
provisionerd/provisionerd.go 69.30% <0.00%> (-0.61%) ⬇️
peer/conn.go 80.00% <0.00%> (+0.25%) ⬆️
peerbroker/listen.go 84.80% <0.00%> (+2.39%) ⬆️
provisioner/echo/serve.go 50.52% <0.00%> (+3.15%) ⬆️
peerbroker/dial.go 80.95% <0.00%> (+4.76%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c44d036...bb30589. Read the comment docs.

@jawnsy jawnsy self-assigned this Feb 9, 2022
@jawnsy
jawnsy marked this pull request as ready for review February 9, 2022 20:38
@kylecarbs

Copy link
Copy Markdown
Member

How much does this improve build times?

@kylecarbs kylecarbs left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Seems fine to me, but I'd like @bryphe-coder to take a look!

Comment thread site/.gitignore
Comment on lines +1 to +5
/.yarn/*
!/.yarn/patches
!/.yarn/plugins
!/.yarn/releases
!/.yarn/sdks

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Will this affect the directories we need to cache in our workflow? ie

key: js-${{ runner.os }}-test-${{ hashFiles('**/yarn.lock') }}

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

yea it would. I think it'd be much faster with Plug 'n Play mode, but I couldn't get that working

Comment thread site/package.json
@@ -1,5 +1,6 @@
{
"name": "coder-v2",
"packageManager": "yarn@3.1.1",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for investigating this!

@bryphe-coder

bryphe-coder commented Feb 9, 2022 •

Copy link
Copy Markdown
Contributor

No-op yarn install (running yarn install when dependencies are already available)

➤ YN0000: └ Completed in 0s 928ms
➤ YN0000: Done with warnings in 2s 236ms

vs the 0.78s previously, unfortunately. Seems consistently over 2s, so more than double the time previously.

With yarn 3 + pnp:

➤ YN0000: Done with warnings in 1s 678ms

@bryphe-coder

bryphe-coder commented Feb 9, 2022 •

Copy link
Copy Markdown
Contributor

Running yarn install in a fresh repo (after git clean -dxf) yields the following results:

yarn 3:

...
➤ YN0000: Done with warnings in 21s 668ms

yarn 1:

...
[4/4] Building fresh packages...
Done in 18.98s.

The fresh-install seems comparable but yarn 3 is still surprisingly a little slower.

With PnP enabled + yarn 3:

➤ YN0000: Done with warnings in 9s 680ms

@bryphe-coder

Copy link
Copy Markdown
Contributor

@jawnsy - do you think the benefits of yarn 3 outweigh the additional time for fresh install / no-op install? I'm more concerned about the no-op install because that will be hit in the development flow.

From my testing locally - it seems like yarn 3 is (surprisingly) slower in both those cases 😦

Wondering if we should hold off on this until we can investigate the PnP issue and get the perf benefit?

@bryphe-coder bryphe-coder left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Just curious on your thoughts re: perf @jawnsy - did you see different results when you tested?

@jawnsy

jawnsy commented Feb 9, 2022

Copy link
Copy Markdown
Author

@bryphe-coder and I are going to check this out on Monday for testing Monday to see if we can get PnP working, otherwise I'll just close this :)

@jawnsy

jawnsy commented Feb 14, 2022

Copy link
Copy Markdown
Author

After some investigation, it doesn't seem to be a material performance improvement for us, so it's not worth doing at this time

@jawnsy jawnsy closed this Feb 14, 2022
@jawnsy
jawnsy deleted the jawnsy/switch-yarn3 branch February 14, 2022 21:41
@jawnsy jawnsy removed their assignment Mar 12, 2022
nickvigilante added a commit that referenced this pull request Oct 21, 2026
#30873)

## Summary

An axe sweep of every page on https://coder.com/beta-docs
(coder/docs-engine#224) found two content-side problems. Nine
screenshots have alt text identical to the italic caption right after
them, so screen readers read the same words twice (axe
`image-redundant-alt`). Four hand-written tables have an empty top-left
header cell, which leaves their row-label column without a name (axe
`empty-table-header`). This fixes both. These are content fixes on
`main` only; earlier release lines keep the old text.

## Findings

| Rule | Pages | Cause | Fixed where |
| --- | --- | --- | --- |
| image-redundant-alt | 4 | Alt text repeats the caption | This PR |
| empty-table-header | 4 hand-written | Empty corner header cell | This
PR |
| empty-table-header | 105 CLI reference pages, `audit-logs.md` |
Generated tables with empty headers | Not here: needs a generator change
|
| empty-table-header | `admin/networking/port-forwarding.md` | Spanning
corner cells in a raw HTML matrix | Not here: needs a rework of that
table |
| heading-order | `remote-desktops.md` | `<div class="tab">` typo |
Separate PR |
| link-name, scrollable-region-focusable, aria-valid-attr-value, label |
many | Engine | coder/docs-engine #220, #217, #224 |

## Fix

Each of the nine screenshots gets alt text that describes what it shows
(for example, "Preset dropdown with Ruby Development added between Full
Stack and Web Development"), and keeps its caption. The corner cells
become "Permission" (Groups and roles), "Component" (air-gapped
comparison), "Scenario" (scale-testing workloads) and "Input" (workspace
tags). Tables were re-padded with `markdown-table-formatter`.

## QA

1. Open each production page below. Expected: the screenshots and tables
look the same as before, except the four tables now show a word in their
top-left header cell.
2. In Chrome DevTools (Elements) or Firefox's Inspector, select a
screenshot on the Add a language page. Expected: its `alt` differs from
the italic caption under it.

## Pages to compare

| What to check | Production | Preview |
| --- | --- | --- |
| Screenshot alt text vs caption |
https://coder.com/beta-docs/@main/get-started/customize-your-template/add-a-language/
| This PR's GitHub preview:
https://github.com/coder/coder/blob/vigilante/docs-a11y-fixes/docs/get-started/customize-your-template/add-a-language.md
|
| Roles table corner cell |
https://coder.com/beta-docs/@main/admin/users/groups-roles/ |
https://github.com/coder/coder/blob/vigilante/docs-a11y-fixes/docs/admin/users/groups-roles.md
|
| Scale-testing table corner cell |
https://coder.com/beta-docs/@main/install/validate/scale-testing/ |
https://github.com/coder/coder/blob/vigilante/docs-a11y-fixes/docs/install/validate/scale-testing.md
|

## Testing

`markdownlint-cli2` and `markdown-table-formatter` over the eight
changed files: 0 errors. Re-running the sweep after merge should drop
`image-redundant-alt` and the four tables' `empty-table-header` findings
from `@main`.

## Upstream

No: these are Coder content fixes, not Fumadocs bugs.

Linear: [DOCS-1303](https://linear.app/coder/issue/DOCS-1303)

---

🤖 Built with AI assistance.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants