Changes between Version 7 and Version 8 of WebInspectorCodingStyleGuide


Ignore:
Timestamp:
Feb 4, 2014 10:56:29 AM (9 years ago)
Author:
BJ Burg
Comment:

nit about model/view layering, and when to spell out identifier

Legend:

Unmodified
Added
Removed
Modified
  • WebInspectorCodingStyleGuide

    v7 v8  
    1919* Consider using [http://people.mozilla.org/~jorendorff/es6-draft.html#sec-keyed-collection `Map` and `Set` collections] instead of plain objects.
    2020* Consider using `rgb()` over hex colors in CSS
    21 * Firewall the protocol inside the Manager classes. JSON objects received from the protocol are called "payload" in the code. The payload is usually deconstructed at the Managers level and passes down as smart objects inheriting from `WebInspector.Object`.
     21* Firewall the protocol inside the Manager classes. JSON objects received from the protocol are called "payload" in the code. The payload is usually deconstructed at the Managers level and passes down as smart objects inheriting from `WebInspector.Object`.
     22* Avoid accessing *View classes from *Manager or *Object classes. This is a layering violation that prevents writing tests for models.
     23* Avoid storing DOM elements in *Manager or *Object classes. (see above.)
     24* Spell out `identifier` instead of `id` if not doing so would result in a name ending with capitalized `Id`. For example, just `this.id` is fine, but `this.breakpointId` should be `this.breakpointIdentifier`.
    2225
    2326The new Inspector object classes should have the following format: