Eruda 2.0 Released: mobile-side debugging tool

Eruda mobile end debugging tool after the 1.5.4 release have much time up to six months suspended updated later this year to re-invest energy development, mainly for the console before being criticized more optimized performance, but also on tools the overall appearance made some adjustments, and now finally the successful launch of version 2.0. So, the new version did before with respect to which updates it?

Support Helper

Chrome Devtools in the console panel execution code can use some of the console have the [helpers] (https://developers.google.com/web/tools/chrome-devtools/console/utilities), such as the common $ selection function , copy copy, $ 0 refers to the selected element and so on. Eruda also supports a part of the method, including copy, $, $$, $ x, clear, dir, table, keys, and the element access $ 0- $ 4.

console.group support

Eruda earlier version has support for most of the console object methods, but there are few supports the method can not be used. In addition to profile, profileEnd other methods can not be achieved, the new version of Eruda basically supports all methods of console objects, including grouping function. At the same time, table, some problems exist in the early realization of print styles are also corrected one by one. The complete list of currently supported console as follows: log, error, info, warn, dir, time / timeLog / timeEnd, clear, count / countReset, assert, table, group / groupCollapsed / groupEnd

Asynchronous rendering

Older versions of Eruda when you execute console.log synchronized to render the results page, which can lead to program execution Caton. For example, the implementation of `for (let i = 0; i <1000; i ++) console.log (i)` the code, you'll find it time-consuming when using eruda quite serious. Use the new Eruda, simply open the asynchronous rendering (enabled by default) basically does not affect the execution speed of the code, will not let the jammed page can not be used. Of course, after executing the code, you will see step by step printed out on the log tool.

Memory Optimization

Each log because of the storage of the raw html string, the old version when printing a large log can cause memory soared the page crash. dom node after the new log information is saved only rendering, memory usage reduced by more than 50 percent compared to before.

Rendering optimization

Logs print for a long time will form a long list, because too many dom object will become very card when scrolling. Here the use of a common long list of optimization techniques, rendering only the visible area of ​​the log, which greatly optimizes the performance of rolling in a long list of actual print 10000 log memory usage and fluency are within the acceptable range.

theme

To make Chrome developers closer to the experience of the use of debugging tools, the new version uses the appearance of color and DevTools similar, also offers a dark theme (optional in the settings panel). Not only that, Eruda also joined the more classic color theme, such as Monokai, you can adjust the appearance according to their preferences.

Eruda since the 2016 release version 1.0, has been more than three years, the future will continue to update and maintain, are welcome to use.

PS: If you have questions or suggestions, can go to the warehouse  issue page feedback :)

Guess you like

Origin www.oschina.net/news/112670/eruda-2-0-released