~/talk

Don’t (re)write code. Let AST do it

Talkat RS Conf 2019 · 2019-08-09..08-11· [react]
links:none on file
slides:none on file

Conference-scale React codebase with ~100 front-end developers and ~3,000 requests/sec uses AST transformations to auto-insert unique data- attributes on root JSX elements, generating stable CSS selectors and page-object helpers so QA avoids manual IDs. Implementation uses Babel parsing, traversal and codegen to find root JSX, add one attribute per component instance, and emit selector resolver functions; an open-source helper Reselector ties component identity to selectors. Claims: automation works across third‑party libs, speeds refactors, reduces brittle XPath/class tests.

AI-written summary · about

  1. 0:00Introduction
  2. 1:59Legacy migration at Yandex Market
  3. 4:52React components and UI testing problems
  4. 8:47Data attributes best solution
  5. 11:16What is an AST
  6. 13:48Why AST is useful
  7. 16:22AST usage examples
  8. 19:58AST examples and Babel API
  9. 22:54Traversing AST with Babel Traverse
  10. 26:31Modifying AST nodes
  11. 28:20Generating code from AST
  12. 30:10Adding data attributes to React
  13. 31:58Simplifying UI tests with data attributes
  14. 33:02Conclusion and future recommendations
~/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.