phetsims / build-a-nucleus

"Build a Nucleus" is an educational simulation in HTML5, by PhET Interactive Simulations.
GNU General Public License v3.0
0 stars 5 forks source link

Self Code Review #112

Closed zepumph closed 1 year ago

zepumph commented 1 year ago

PhET Code-Review Checklist (a.k.a "CRC")

GitHub Issues

The following standard GitHub issues should exist. If these issues are missing, or have not been completed, pause code review until the issues have been created and addressed by the responsible dev.

Build and Run Checks

If any of these items fail, pause code review.

Memory Leaks

Performance

Usability

Internationalization

  "material.water": {
    "value": "Water"
  },
  "material.wood": {
    "value": "Wood"
  },
  "shape.block": {
    "value": "Block"
  },
  "shape.cone": {
    "value": "Cone"
  },

Nested substructure is not yet fully supported.

Repository Structure

Coding Conventions

TypeScript Conventions

Math Libraries

IE11

Organization, Readability, and Maintainability

Accessibility

This section may be omitted if the sim has not been instrumented with accessibility features. Accessibility includes various features, not all are always include. Ignore sections that do not apply.

General

Alternative Input

Interactive Description

~Interactive Description~ ``` - [ ] Run the entire built sim HTML file through an [HTML validator](https://validator.w3.org/nu/#textarea), does the HTML pass? - [ ] If applicable, are good design patterns used for interactive description, see [interactive-description-technical-guide.md](https://github.com/phetsims/phet-info/blob/master/doc/interactive-description-technical-guide.md) - [ ] Does resetting the simulation also reset the entire PDOM? - [ ] Is `Node.pdomOrder` used appropriately to maintain visual and PDOM layout balance? - [ ] Make sure accessibility strings aren't being adjusted with ascii specific javascript methods like `toUpperCase()`. Remember that one day these strings will be translatable - [ ] Make sure for accessibility strings that all end of sentence periods do not have a leading space before it. Some screen readers will read these as "dot." This can occur often when a clause is conditionally added. ```
~PhET-IO~ ``` ## **PhET-iO** This section may be omitted if the sim has not been instrumented for PhET-iO, but is likely good to glance at no matter. - [ ] Does instrumentation follow the conventions described in [PhET-iO Instrumentation Guide](https://github.com/phetsims/phet-io/blob/master/doc/phet-io-instrumentation-technical-guide.md)? This could be an extensive bullet. At the very least, be sure to know what amount of instrumentation this sim supports. Describing this further goes beyond the scope of this document. - [ ] PhET-iO instantiates different objects and wires up listeners that are not present in the PhET-branded simulation. It needs to be tested separately for memory leaks. To help isolate the nature of the memory leak, this test should be run separately from the PhET brand memory leak test. Test with a colorized Data Stream, and Studio (easily accessed from phetmarks). Compare to testing results done by the responsible developer and previous releases. - [ ] Make sure unused `PhetioObject` instances are disposed, which unregisters their tandems. - [ ] Make sure JOIST `dt` values are used instead of `Date.now()` or other Date functions. Perhaps try `phet.joist.elapsedTime`. Though this has already been mentioned, it is necessary for reproducible playback via input events and deserves a comment in this PhET-iO section. - [ ] Are random numbers using `DOT/dotRandom` as an imported module (not a global), and all doing so after modules are declared (non-statically)? For example, the following methods (and perhaps others) should not be used: `Math.random`, `_.shuffle`, `_.sample`, `_.random`. This also deserves re-iteration due to its effect on record/playback for PhET-iO. - [ ] Like JSON, keys for `undefined` values are omitted when serializing objects across frames. Consider this when determining whether `toStateObject` should use `null` or `undefined` values. - [ ] PhET prefers to use the term "position" to refer to the physical (x,y) position of objects. This applies to both brands, but is more important for the PhET-iO API. See https://github.com/phetsims/phet-info/issues/126 - [ ] Are your IOType state methods violating the API of the core type by accessing private fields? - [ ] When defining a boolean Property to indicate whether something is enabled, use `AXON/EnabledProperty`. This should be done in both the model and the view. If you're using a DerivedProperty, skip this item. - [ ] Do not use translated strings in `phetioDocumentaton` - it changes the PhET-iO API! ```
Luisav1 commented 1 year ago

Everything left will be taken care of in side issues. Closing.