javascript tracing, debugging, profiling made simple with spy-js

22
#dddbne @ArtemGovorov @JetBrains spy-js

Upload: artem-govorov

Post on 22-Nov-2014

2.393 views

Category:

Technology


1 download

DESCRIPTION

The presentation is about spy-js, a small tool with an interesting story. It started as a hobby project, then grew up to something I was going to make a product from, ended up acquired by one of the world's leading providers of developer tools (JetBrains) and now is in process of being integrated into the company's JavaScript IDE (WebStorm). And all that just in a few months. The tool is for JavaScript developers and allows to make tracing, debugging and profiling the language code easier. It's worth mentioning, that spy-js is not a replacement for browser development tools, it rather provides an alternative approach to accomplish common development tasks, allows to tackle these tasks from a bit different angle. Moreover, because of the technology it uses, there's no specific browser lock-in, the tool works on any platform/device/browser.

TRANSCRIPT

Page 1: JavaScript tracing, debugging, profiling made simple with spy-js

#dddbne

@ArtemGovorov

@JetBrains

spy-js

Page 2: JavaScript tracing, debugging, profiling made simple with spy-js
Page 3: JavaScript tracing, debugging, profiling made simple with spy-js

the philosophy of JavaScript (to the extent that it has any philosophy) is that you should not be able to observe what is going on

piece of wisdom

Page 4: JavaScript tracing, debugging, profiling made simple with spy-js

demo

Page 5: JavaScript tracing, debugging, profiling made simple with spy-js

in a nutshelljavascript developer opens a web page via smart proxy !the proxy injects some special code into each script of the page !the script code executes and sends runtime data back to the proxy !IDE gets notified when new event data is available and can request full call stack

typical JS dev

Page 6: JavaScript tracing, debugging, profiling made simple with spy-js

Local

virtually no configuration required,

but more fragile

!

System

OS/browser configuration required,

but more reliable

proxy

Page 7: JavaScript tracing, debugging, profiling made simple with spy-js

instrumentor

code + regular expression =

syntax tree

Page 8: JavaScript tracing, debugging, profiling made simple with spy-js

instrumentorcode parsing

AST traversing

AST modification

code generation

prettifying

parallel processing

Page 9: JavaScript tracing, debugging, profiling made simple with spy-js

quiz #1Wrapping any loop statement into a block can not

break the loop code, true or false?

Page 10: JavaScript tracing, debugging, profiling made simple with spy-js

quiz #1Wrapping any loop statement into a block can not

break the loop code, true or false?

Page 11: JavaScript tracing, debugging, profiling made simple with spy-js

tracer

simple fast

cross-browser

Page 12: JavaScript tracing, debugging, profiling made simple with spy-js

tracer

fast, simple, cross-browser

Page 13: JavaScript tracing, debugging, profiling made simple with spy-js

tracer

app code

app code

event queueobjects dumper

timer

app code

back-end

Page 14: JavaScript tracing, debugging, profiling made simple with spy-js

quiz #2Each function expression or function declaration in

JavaScript must have “function” keyword, true or

false?

Page 15: JavaScript tracing, debugging, profiling made simple with spy-js

quiz #2Each function expression or function declaration in

JavaScript must have “function” keyword, true or

false?

Page 16: JavaScript tracing, debugging, profiling made simple with spy-js

back-end and UI

events tree

stack tree

code

processing and persisting trace !serving UI and tracer requests !infrastructure (sessions, proxy and instrumentor hosting)

Page 17: JavaScript tracing, debugging, profiling made simple with spy-js

quiz #3this is how spy-js works: my web page is parsed into some tree using horse.js framework and then the awesome cat on the unicorn sends my data to the WebStorm

Page 18: JavaScript tracing, debugging, profiling made simple with spy-js

quiz #3this is how spy-js works: my web page is parsed into some tree using horse.js framework and then the awesome cat on the unicorn sends my data to the WebStorm

NO

Page 19: JavaScript tracing, debugging, profiling made simple with spy-js

quiz #3

javascript developer executes some scenario on the

page (or runs tests) and the tracer sends collected

runtime data to the back-end

the back-end proxy modifies requested javascript

files using instrumentor

the instrumentor changes the page code to collect

runtime data and injects tracer code

javascript developer opens web page via proxy

YES

Page 20: JavaScript tracing, debugging, profiling made simple with spy-js

future

nodejs, packaged javascript apps

!

collected runtime information analysis and presentation

!

advanced proxying

!

extensible instrumentation/code injection

Page 21: JavaScript tracing, debugging, profiling made simple with spy-js

whenWebStorm 8 EAP starts Jan 2014

!

visit spy-js.com to get a web UI based version today

Page 22: JavaScript tracing, debugging, profiling made simple with spy-js

questions