Skip to content

[Web Inspector] Port Web Inspector Style Guide from Trac#147

Merged
burg merged 1 commit intoWebKit:mainfrom
burg:eng/bburg/wi-style-guide-full
Apr 2, 2026
Merged

[Web Inspector] Port Web Inspector Style Guide from Trac#147
burg merged 1 commit intoWebKit:mainfrom
burg:eng/bburg/wi-style-guide-full

Conversation

@burg
Copy link
Copy Markdown
Contributor

@burg burg commented Apr 1, 2026

The Web Inspector coding style guide lived on trac.webkit.org (now defunct) and was completely inaccessible to new contributors. Port and modernize it into docs/Deep Dive/Web Inspector/StyleGuide.md.

Covers:

  • Formatting (indentation, strings, braces, trailing commas, semicolons)
  • Variable declarations (let vs const -- WI uses let-by-default)
  • Naming conventions (classes, properties, event handlers, localization)
  • Class structure and member ordering with section comments
  • Architecture (Manager/Model/View separation, protocol firewall)
  • View lifecycle (initialLayout, layout, attached/detached)
  • Event system (declaring, dispatching, listening, one-shot, await)
  • Collections and iteration patterns
  • Arrow function conventions
  • Async patterns and promise gotchas
  • Assertions
  • CSS conventions (z-index, theming, class names)

The guide is structured with a Quick Reference of the most common review issues at the top, and detailed sections below. Rules were validated against the current codebase -- outdated Trac rules were dropped or updated.

Resolves #144

Copy link
Copy Markdown
Member

@dcrousso dcrousso left a comment

Choose a reason for hiding this comment

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

awesome! 🤩

Port and modernize the Web Inspector coding style guide. Covers
formatting (braces, semicolons, trailing commas), variable declarations
(let-by-default, const for true constants), naming conventions (WI
namespace, spelling out words, _handle prefix), class structure
(section ordering, inline getters, abstract methods), architecture
(protocol firewall, view lifecycle, directory layout), the WI.Object
event system (declaring, listening, dispatching, one-shot/async),
collections, arrow functions, async patterns with promise gotchas,
assertions, and CSS conventions (z-index, theming, class names).

Reviewed by Devin Rousso and Qianlang Chen.
@burg burg force-pushed the eng/bburg/wi-style-guide-full branch from f4ea197 to cb3b802 Compare April 2, 2026 18:15
@burg
Copy link
Copy Markdown
Contributor Author

burg commented Apr 2, 2026

Accepted all suggestions, thanks folks!!

@burg burg merged commit d66e2b9 into WebKit:main Apr 2, 2026
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.

[Web Inspector] Port Web Inspector Style Guide from Trac

3 participants