~/talk

Refactoring Components

slides:none on file

Decides whether to refactor by showing concrete steps: write characterization tests that record current behavior (date input as Date/string/number, negative and zero cases), replace moment.js → date-fns format, catch that date-fns throws for nonsense strings and wrap it to return "invalid date", and discover a bug where zero becomes empty string which gets filed rather than silently changed. For JSX, use snapshot tests for large components, then extract a repeated label into a NumberInput component, add focused unit tests, and change product types with confidence.

AI-written summary · about

  1. 0:00Start
  2. 1:50What Is Refactoring
  3. 2:14Renaming Variables
  4. 2:51Factoring Out Repeated Code
  5. 3:40Benefits
  6. 4:23Cost of Refactoring
  7. 4:45Risks Associated with Refactoring
  8. 5:45Internet Explorer
  9. 9:02Determine the Current Behavior
  10. 9:19Write Tests To Determine the Current Behavior
  11. 10:55Writing a Test
  12. 13:25Strings
  13. 13:53Invalid Date String
  14. 23:50Snapshot Tests
  15. 30:25Demo
  16. 31:15The Farm Shop
  17. 31:56New Requirements
  18. 33:54Characterization Tests
  19. 34:07Test the Product Components
  20. 38:01Update to Product inside a Test Was Not Wrapped in Act
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.