Highlights from this week
Here’s some of the more interesting things I learned or worked on.
Caching prettier runs
One of the most interesting findings was caching prettier runs.
This is important in MDN content because there are 14,000 pages that we regularly need to format.
Although we’re not formatting the whole repo locally very often, with pre-commit hooks running on changed files, there’s a lot of linting happening during development.
Running prettier -w
v prettier -w --cache
on 14,000 files comes out at this:
# without a cache
prettier --write . 98.97s user 10.11s system 126% cpu 1:26.14 total
# with a cache
prettier --write --cache . 14.82s user 7.73s system 129% cpu 17.396 total
SVG section reorganization
We’re reorganizing the site (information) architecture to be uniform across all sections at the moment. That means per top-level technology category, we’re organizing the docs by reference, guides, tutorials, and how-tos. The tidied-up SVG section looks like this now:
web/svg
├── guides
│ ├── applying_svg_effects_to_html_content
│ ├── content_type
│ ├── index.md
│ ├── linking
│ ├── namespaces_crash_course
│ ├── scripting
│ ├── svg_animation_with_smil
│ ├── svg_as_an_image
│ ├── svg_filters
│ └── svg_in_html
├── index.md
├── reference
│ ├── attribute
│ ├── element
│ └── index.md
└── tutorials
├── index.md
└── svg_from_scratch
User agent sniffing
I made a larger rewrite of the UA sniffing guide. There was a lot of outdated information in there, and I hope it’s a lot better now in terms of clarity and accuracy. I think it’s a pretty good document now, which modernizes the guidance while preserving some hints about better alternatives.
See the results here: Browser detection using the user agent string (UA sniffing)
Summary
I worked on 20 total PRs, broken down as 6 created & 14 reviewed in 3 repositories.
Most active day was 2025-03-18 with 14 total PRs.
Top repos:
- mdn/content: 17
- mdn/translated-content: 2
- mdn/express-locallibrary-tutorial: 1
Pull requests
This is what I got up to on the week ending 21st March 2025:
2025-03-18:
- Reviewed: ci(auto-cleanup-bot): link from PR to workflow (mdn/content)
- Created: feat: Add some more docs to mdnsidebar (mdn/content)
- Reviewed: ci: pass data betwen steps via GITHUB_OUTPUT (mdn/translated-content)
- Reviewed: feat(http): Add Prefer, Preferrence-Applied headers (mdn/content)
- Reviewed: ci: pass data between steps via GITHUB_OUTPUT (mdn/content)
- Created: fix(css): small tidy following examples move (mdn/content)
- Reviewed: fix: auto-cleanup by bot (mdn/content)
- Reviewed: ci(system-file-changes): pass if author/actor is an admin (mdn/content)
- Reviewed: feat: use Lefthook for pre-commit checks (mdn/content)
- Reviewed: fix(writing guidelines): Mention recommended sources for lorem ipsum (mdn/content)
- Reviewed: Book detail - stop escaping already escaped title/summary (mdn/express-locallibrary-tutorial)
- Created: fix(http): Clarify content length in 204 responses (mdn/content)
- Reviewed: Organize SVG into Tutorials, Guides, and Reference (mdn/content)
- Reviewed: updated @scope in experimental features (mdn/content)
2025-03-19:
- Created: feat(css): Link to learning doc about text direction (mdn/content)
2025-03-20:
- Created: feat(http): Rewrite the UA detection doc (mdn/content)
- Created: feat: cache Prettier writes (mdn/content)
- Reviewed: feat: Add Lefthook for precommit hooks (mdn/translated-content)
- Reviewed: fix(writing guidelines): Mention recommended sources for lorem ipsum (mdn/content)
2025-03-21:
- Reviewed: feat(http): Rewrite the UA detection doc (mdn/content)
See also
Published: