This post is a follow-up discussion of brief Twitter thread between @deltakosh, @meulta, @pierlag and @davrous where I asked into the reasoning behind building Vorlon.js.
<img src="/images/posts/vorlonjs/vorlonjs.jpg" />
Preface: This is quite an opinionated post, and everything here is said without have had a chat with the team, and is purely based upon the observations Iâve made since the announcement and by following the project. I might be completely wrong in my criticism.
<!--more-->
Iâve been following the vorlon.js project for a while now, and recently Iâve started to notice a big amount of work being put into building a âDOM Explorerâ and other parts of âDevTools-like front-endâ, which trigger this tweet:
<figure> <blockquote class=âtwitter-tweetâ lang=âenâ><p lang=âenâ dir=âltrâ><a href=âhttps://twitter.com/deltakoshâ>@deltakosh</a> <a href=âhttps://twitter.com/meultaâ>@meulta</a> <a href=âhttps://twitter.com/pierlagâ>@pierlag</a> Why make <a href=âhttps://twitter.com/VorlonJSâ>@vorlonjs</a>'s own DOM Explorer over Firefox or Chrome DevTools? We already have it :)</p>â Kenneth Auchenberg (@auchenberg) <a href=âhttps://twitter.com/auchenberg/status/613558197350064129â>June 24, 2015</a></blockquote> </figure>
To me, this particular front-end work seems completely unnecessary as a front-end for this kinda of functionality already exists â and has for years.
Iâve been reading the announcement blog-post of vorlon.js a few few times to wrap my mind around the purpose of the project, and I get that the point of the project is a âAn open source, extensible, platform-agnostic tool for remotely debugging and testing your JavaScript.â, but I simply donât understand why the team has chosen an approach that includes to re-invent (as in re-implement) much of the logic, our community have spent years on building and perfecting.
Vorlon.js doesnât bring anything new to the table
Vorlon.js is built on node.js and is using socket.io to manage itâs connections to the browsers and the front-end is simply communicating to the central (local) server that provides an aggregated view of the browser information.
This architecture isnât new.
This is exactly how the built-in browser DevTools are working in modern browser like Chrome, Firefox and Safari. The front-end is a simply client of a remote debugging server hosted by the browser.
However thereâs a difference, and thatâs the built-in DevTools doesnât have a notion of other browsers. But this functionality was explored by Patrick Mueller in the Weinre project. Weinre enabled users to use Safari Web Inspector with other browsers, via a much similar architecture to vorlon.js, as itâs also relied upon a script injection technique to emulate the Webkit remote debugging protocol.
Today the Weinre project is kinda dead, but recently we have also seen commercial solutions like GhostLab which is using a similar approach, to enable Chrome DevTools to be connected to multiple browsers. In my view GhostLab is the new and modern flavour of Weinre.
However vorlon.js adds one new thing to the table, and thatâs plugins, that allows developers to write âextensionsâ in order to inject custom functionality. But this extension layer could easily have been built on top of the existing tooling and protocols, instead of re-inventing everything again.
In the perspective of Weinre and GhostLab, vorlon.js simply looks to be yet one-of-the-many Microsoft-variants of tools thatâs already exists.
Re-implementing a front-end that already exists
My first specific criticism of the vorlon.js is that the team currently is re-implementing much of the functionality that already exists inside tools like Chrome DevTools and Firefox DevTools. These projects are both open-source, and hundreds of people has over the last many years, spent I-dont-know-how-many man-hours on tweaking both the UI and the functionality of their âDOM Exploresâ and âNetworking inspectorsâ
So I simply donât understand, why you would completely disregard whatâs already out there (and workâs pretty damn well), and start rolling your own home-grown front-end.
When taking a look at the current state of the home-rolled front-end in vorlon.js itâs sub-pair with existing tools. Itâs even sub-pair with Firebug that was super-seeded by ânativeâ DevTools years ago. From this point it will take the vorlon.js team considerable time to âcatch-upâ with even basic functionality like script debugging and editing, which is functionality that most developers, these days take for granted.
As I write this, the team is busy re-implementing the JavaScript console, Resources tab and many other things.
For absolutely no reason.
Even Weinre and GhostLab realized that re-implementing the front-end would be massiv task, and probably also a waste of resources, so from the beginning GhostLab is simply re-using Chrome DevTools inside their app, and Weinre is using Safariâs WebInspector. Wise decisions.
The fundamental problem is the viewport sandbox and itâs limitations
This leads me to my second criticism and thatâs the basic assumption vorlon.js and similar solutions like Weinre are built upon: They rely on instrumentation of the running application inside the âviewport sandboxâ using dynamic script injection.
Let me explain why this is fundamental problem by showing you this illustration:
When running inside the âviewport sandboxâ along with the application itself, the debugger/tool is limited by the number of APIâs available, and as we speak there isnât many debugging-focused APIâs available for one reason: Security.
Getting access to the memory heap and other internal parts of the runtime wonât be secure with the security model we have on the web.
This means that debugging tools running inside this sandbox has to rely on dynamic code instrumentation that injects observers and other logic in order to âextractâ the interesting information from the runtime. This is a lot of work, and by design, we wonât be able to extract much of the âinterestingâ information thatsâ needed for Profilers, Network monitors, Emulators, etc.
This is the reason why Weinre and GhostLab hasnât been able to provide more advanced features that the DOM and Styling related features of todayâs DevTools.
This constraint also exists for vorlon.js, and thatâs why vorlon.js from the very beginning wonât be able to provide whatâs required of a modern remote debugging tool. Itâs access to information is simply too limited.
This is also why modern DevTools arenât relaying on dynamic script injection, but instead is using the remote debugging protocols. These are built into every modern browser, and arenât limited by the âviewport sandboxâ. They provides a much more advanced set of APIâs for specifically created debugging and most importantly provided and maintained by the browser vendors.
What should be the focus of vorlon.js
Remote Debugging protocols already exists, and is wildly used by the browsersâs DevTools and other tools such as Adobe Brackets. Thereâs a proven need for why these protocols and APIâs canât be exposed inside the viewport, and why these are exposed as a separate interface to the browsers.
If the goal is to build a tool to âremotely debugging and testing your JavaScriptâ the focus should be where the problem is: How to build a system using the existing APIâs and protocols that works cross browser and runtimes.
The focus shouldnât be re-implementing a front-end that already exists, and spending time re-implementing debugging-APIâs that the browser-vendors already provides in their remote debugging protocols.
This is why I find another Microsoft project much more intersting, and thatâs the IE Diagnostics Adapter from the IE F12 tools team, who has spent the time building an adaptor that makes it possible to use existing tools like Chrome DevTools and Adobe Brackets with IE. Thatâs true innovation, and focus where it needs to be.
We as a community, should get out of the not-invented-here-syndrome, and focus on how we can re-use the logic and tools thatâs already been built by our wonderful community.
If vorlon.js for example had used the existing Chrome Remote Debugging protocol instead of inventing itâs own socket.io-based thing, and embraced RemoteDebug, tools like Microsoftâs own Visual Studio would work for script debugging (I might be wrong here), and the team wouldnât have to re-invent the front-end for Console, as Chrome DevTools would work out of the box. That would have given vorlon.js a much better starting point, than starting with nothing.
So to put it on an edge, vorlon.js seems to be yet-another Microsoft project thatâs driven by the not-invented-here-syndrome, and thatâs a shame.
I sincerely think we can do better. We should focus on real innovation instead of re-inventing wheels.
We desperately a better web development workflow, so letâs built it by keeping our focus on solving the real problems.
Thatâs it for now.
/k