V8, Advanced JavaScript, and the Next Performance Frontier [video]
youtube.com
youtube.com
Instead of using JSX files, choo uses ES6 tagged template literals. As a result the code doesn't need a compilation step at all. But you can still actually compile the templates if you want for better performance + a smaller JS bundle in production.
Its great stuff. I'm a huge fan.
UX is one of three hundred things programmers have to weigh when making decisions for a business or project.
My claim is that for the user's benefit it may be better to choose a library that sacrifices some benchmark performance metrics like "Time to update the text of every 10th row for 10000 rows with 5 warmup iterations." in favor of startup time and memory. These are the exact same tradeoffs that Seth Thompson mentioned in the video, they can't just be dismissed wholesale.
My question is: how many real apps should make this tradeoff for the smaller library?
I would guess "many more than make it now." Developers are wooed by the columns with a lot of pretty green (myself included) and end up making their app worse because they're optimizing for the wrong thing.
A web site is normally a public-facing collection of HTML and JS where the JS is primarily decorative and the site is primarily page-oriented. Navigation is done via physical pages using the normal browser mechanisms such as links.
A web application is normally a software service that more resembles a desktop application due to its "load once and let the JS take control" architecture. Navigation is normally not done via physical pages, but rather via hash navigation that navigates within areas of the application, as opposed to physical pages. And, you'll see a lot more application-oriented UI techniques like modal dialogs and more elaborate controls (treeviews, listviews, etc).
There are, of course, applications that straddle the line between the two, but it's still helpful to make these distinctions because:
Web sites should optimize for load time first. Otherwise, you're going to have visitors bounce.
Web applications are different, and while they need to keep the load time down, they will most often be already in the browser cache. So, the performance shifts towards focusing more on the actual run-time performance of the application, and that is where issues with raw DOM manipulation may become problematic without something like a virtual DOM or some sort of property caching.
That said, I quite like hyperscript, especially in this form: https://github.com/ohanhi/hyperscript-helpers
> h1(`oh hai ${name}`)
is harder to read than
> html`<h1>oh hai ${name}</h1>`
for some people, but even then your editor can understand that that is a function, can tell you when you've mistyped it, can autocomplete it for you, and can give you hints on what arguments it takes (since it has TypeScript definitions).
And as a bonus for me, I also find the former easier to read than the latter, but that might just be getting used to it :)
> <j1>oh hai {name}</h1>
your editor will complain :)
I love Choo too, but it's 4k gzipped compared to React 43k gzipped (incl ReactDOM). I think you were comparing gzipped Choo to non-gzipped React.
It seems that after introducing a built-in chrome protocol debugger node-inspector was abandoned and now I can't figure out how to use the built-in debugger with babel-node.
And FWIW, my written guide here captures the basics that Seth covered in the video: https://medium.com/@paul_irish/debugging-node-js-nightlies-w...
When I'm writing server-side code and popping `debugger;` into my unit test, I really don't want to go to open up a chrone window and use my mouse to fiddle with the sizes of the panes to make debugging in chrome work. It looks like this protocol could eliminate the problem of waiting for the connection to come through (it drops a lot of the time when you do it within unit tests), which is great.
If I wanted to get started adding this to node.js, does anyone have any suggestions for where I would start? Presumably by first getting a solid mental model of V8's internals, but has anyone else worked on debuggers that could give me some pointers?
https://github.com/babel/babel-preset-env with our `"node": "current"` option can help with this.
https://v8project.blogspot.com/2017/05/launching-ignition-an...
with a (really) brief mention of Orinoco:
https://v8project.blogspot.com/2016/04/jank-busters-part-two...
and Node + Chrome DevTools:
https://medium.com/@paul_irish/debugging-node-js-nightlies-w...
Octane benchmark retired because it benchmarks peak performance and doesn't account for other factors (e.g. startup time, memory usage). Speedometer2 coming to browserbench.org soon, benchmarks a much wider range of real-world frameworks.