Monday, March 6, 2017

Release 0.1.7

This new release secures the class mechanism and improves project tools.

New version

Here comes the new version:

Improved $super keyword

When writing the article My own super implementation I found several issues that were immediately fixed.

Better tooling

The following tools were modified:

  • It is now possible to remove unused files from the sources page
  • Each file modification triggers one pass of tests (it takes less than 1 second to execute). This way, I know as soon as possible if something goes wrong
  • fs middleware is secured to limit access to the project files only. It now supports the DELETE verb
  • The watch and serve tasks are monitoring the sources.json file modifications to update the list of linted files. This way, it is no more required to restart the grunt task.

More flavors for browser testing

Selenium was upgraded to version 3 and the detection has been fixed to make it more reliable.

On top of Selenium, a command line execution wrapper combined with a caching service (to store & grab the results) allows testing of non-automated browsers (such as Safari on Windows). Once the tests are done, the command line is killed.

Automated release

Releasing a version has never been so easy, a script using github-api module to call the GitHub API implements the following steps:

  • Check version number
  • Update package.json (if needed)
  • Check GitHub milestones to identify the milestone details and check that all issues are closed
  • Update README.md
  • Grunt make
  • Copy tmp/plato/report.history. to build/ (grunt copy:releasePlatoHistory)
  • commit & push
  • Create a new release on GitHub
  • Copy build/tests.js into test/host/legacy/{version}.js
  • commit & push

However, once last step was forgotten: closing the milestone. An incident is created.

Lessons learned

Documenting features makes them better

I will task the risk of repeating myself here but the article about super made me realize several mistakes in the implementation of the $super equivalent. Furthermore, taking the time to explore the ECMAScript super keyword gave me a better understanding of the feature.

In general, it is valuable to step back from the code and document the intent behind a feature.

Better Selenium detection

One of the reasons why I wanted to remove Selenium was the buggy detection. Indeed, there are some failures which are not encapsulated properly in a Promise. As a result, the whole process fails when it happens.

After digging on the web, I found this excellent thread on NodeJS Exception handling. It allowed me to handle those unmanaged exceptions the proper way and it secured the detection.

Next release

The next release will introduce the interface concept.

No comments:

Post a Comment