TL;DR: in the upcoming weeks and months, I plan to upgrade the scripts generated to "use strict" and to make use of ECMAScript 2015 and later syntax.

---

I've been making changes to ruby2js in the past week or so to support features added to Javascript since 2009. All browsers from IE 10 on support "use strict", and the major browsers (Chrome, Edge, Firefox, and Safari) support ES2017.

Enabling these changes is as simple as "require 'ruby2js/strict'" and/or "require 'ruby2js/es2017'". I don't plan on adding those statements until after I have run some tests. I also don't plan on changing the board agenda tool until after this month's meeting. Should we need to revert the changes (either temporarily or permanently), all we will have to do is change back to "require 'ruby2js'".

In my opinion, all whimsy tools (particularly the one that run under passenger) should be upgraded to "use strict". As I believe that it is unlikely that the secretary workbench will be used with IE 11, I believe that it is safe to update that tool to ES2017.

Some links outlining the changes:

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Strict_mode

https://babeljs.io/learn-es2015/

---

Early explorations with the board agenda tool have identified some problematic code; things that work, but aren't quite right. As an example, it seems that with the current code, 'color' is a computed property (more specifically a 'getter') that use used to determine the color of the top and bottom banners. Despite not having a setter, the code does assign this value, which without either having strict on or using ES2015 classes will overwrite the getter.

Having JavaScript enforce the desired semantics will result in more maintainable code.

- Sam Ruby

Reply via email to