From 89ab7385d24dc44cd920979023e00c99e4268657 Mon Sep 17 00:00:00 2001 From: Tim van der Lippe Date: Sat, 31 Mar 2018 15:57:16 +0200 Subject: [PATCH] Add note about performance vs correctness --- lib/mixins/property-effects.html | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lib/mixins/property-effects.html b/lib/mixins/property-effects.html index 0feb7c9e41..d5c60613e2 100644 --- a/lib/mixins/property-effects.html +++ b/lib/mixins/property-effects.html @@ -2629,6 +2629,17 @@ * - Inline computed method (supports negation): * `[[compute(a, 'literal', b)]]`, `[[!compute(a, 'literal', b)]]` * + * The default implementation uses a regular expression for best + * performance. However, the regular expression uses a white-list of + * allowed characters in a data-binding, which causes problems for + * data-bindings that do use characters not in this white-list. + * + * Instead of updating the white-list with all allowed characters, + * there is a StrictBindingParser (see lib/mixins/strict-binding-parser) + * that uses a state machine instead. This state machine is able to handle + * all characters. However, it is slightly less performant, therefore we + * extracted it into a separate optional mixin. + * * @param {string} text Text to parse from attribute or textContent * @param {Object} templateInfo Current template metadata * @return {Array} Array of binding part metadata