Next: , Previous: , Up: Hacking   [Contents][Index]

10.2 Libraries Used

Liza does not use many libraries. The primary reason for this was that few libraries useful to Liza existed during its initial development—Node.js and its community was still very young. With that said, care should be taken to ensure that libraries are added only after a careful analysis of its costs and benefits, as they add volatility to the whole system and may also introduce security vulnerabilities outside of our control. They further introduce maintenance obligations for keeping up with newer versions of those libraries and addressing backwards-compatibility concerns.

10.2.1 System Libraries

Liza was originally developed using JavaScript (first ECMAScript 3, and then ECMAScript 5). JavaScript does not natively support the classical object-oriented model familiar to users of more traditional classical object-oriented languages like Java, C++, C#, and PHP. Liza is built using GNU ease.js, which provides those familiar features. The primary language used by developers in the office that created Liza is PHP, which motivated the creation of ease.js to ease the burden of entry.

Consequently, Liza is written in a classical object-oriented style rather than using prototypes. The class keyword introduced in ECMAScript  is largely syntatic sugar around the prototype model and does not address the primary concerns of ease.js, nor does it provide traits.

The project is now migrating toward TypeScript, so new code should not use ease.js unless required and an effort should be made to move existing code away from ease.js. For more information on this migration, see See TypeScript Migration.

10.2.2 Testing Libraries

Mocha is used as the test runner for JavaScript unit tests. Chai is the assertion library. This differs from PHP development where a single system (PHPUnit) encompasses both of these needs.

Chai offers a few different styles of assertions (“should”, “expect”, and “assert”); Liza uses “expect”.

A library to aid in mocking TypeScript classes needs to be researched.

10.2.3 UI Libraries

jQuery was used in the past, but has been largely purged from the system (and continues to be removed) due to strong performance issues. Further, now that browser APIs have stabalized and Liza no longer needs to support as far back as Internet Explorer 6, the standard DOM APIs are more than sufficient.

Liza instead provides its own UI and DOM abstractions (src/ui) that have been optimized for Liza’s needs.

There are modern frameworks that may overlap with the type of UI operations that Liza performs, as well as certain DOM optimizations that it performs; however, it is unlikely that such frameworks (e.g. React, Angular, Meteor) will ever be integrated, as the cost of doing so exceeds the marginal benefit.

Next: , Previous: , Up: Hacking   [Contents][Index]