Simplify expressions
Do simplification based on the ast tree rather than the textual representation. I'd like to provide a simplify() function that will convert:
validate: true => remove write: false => remove read: false => remove
as well as simple expression simplifications:
true || exp => true false || exp => exp true && exp => exp false && exp => false !(a == b) => a != b !(a != b) => a == b !(a < b) => a >= b (etc) !!a => a == true
The latter can arise from trivial conditional rules, or when trivial base rules are combined with more complex validation expression in derived Types.
worth a look https://github.com/firebase/blaze_compiler/blob/master/src/optimizer.ts
Just as small optimisation, string rules expressions "true" and "false" could be converted to boolean.
e.g.
{".write": "true"} => {".write": true}
Also - parent() and child() references are sometime generated non-optimally. That was something Blaze also optimized.