From bce975833894d2774a20301ebaf4e40e3ac730f8 Mon Sep 17 00:00:00 2001 From: the-djmaze <> Date: Wed, 23 Oct 2024 00:52:01 +0200 Subject: [PATCH] Fix Knockout binding non-Observable notice --- vendors/knockout/build/output/knockout-latest.debug.js | 2 +- vendors/knockout/build/output/knockout-latest.js | 2 +- vendors/knockout/src/binding/expressionRewriting.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/vendors/knockout/build/output/knockout-latest.debug.js b/vendors/knockout/build/output/knockout-latest.debug.js index 6474ed3cf..0a8a199e3 100644 --- a/vendors/knockout/build/output/knockout-latest.debug.js +++ b/vendors/knockout/build/output/knockout-latest.debug.js @@ -1450,7 +1450,7 @@ ko.expressionRewriting = (() => { // it is !== existing value on that writable observable writeValueToProperty: (element, property, allBindings, key, value, checkIfDifferent) => { if (!property || !ko.isObservable(property)) { - console.error(`"${key}" should be observable in ${element.outerHTML.replace(/>.+/,'>')}`); + console.log(`"${key}" should contain observable in ${element.outerHTML.replace(/>.+/,'>')}`); // ko.dataFor(element).key = value; allBindings.get('$data')[key] = value; } else if (ko.isWriteableObservable(property) && (!checkIfDifferent || property.peek() !== value)) { diff --git a/vendors/knockout/build/output/knockout-latest.js b/vendors/knockout/build/output/knockout-latest.js index 0c4514ba3..cec856c34 100644 --- a/vendors/knockout/build/output/knockout-latest.js +++ b/vendors/knockout/build/output/knockout-latest.js @@ -28,7 +28,7 @@ null,d.G=0,b.T()&&b.Ea();else{var e=[];c.g.K(d.v,(g,l)=>e[l.fa]=g);e.forEach((g, c.o);c.isComputed=a=>"function"==typeof a&&a[N]===K[N];c.xb=a=>{if("function"===typeof a)return c.o(a,{pure:!0});a={...a,pure:!0};return c.o(a)};c.C={M:a=>{switch(a.nodeName){case "OPTION":return!0===a.__ko__hasDomDataOptionValue__?c.g.l.get(a,c.i.options.Wa):a.value;case "SELECT":return 0<=a.selectedIndex?c.C.M(a.options[a.selectedIndex]):void 0;default:return a.value}},Fa:(a,b)=>{switch(a.nodeName){case "OPTION":"string"===typeof b?(c.g.l.set(a,c.i.options.Wa,void 0),delete a.__ko__hasDomDataOptionValue__, a.value=b):(c.g.l.set(a,c.i.options.Wa,b),a.__ko__hasDomDataOptionValue__=!0,a.value="number"===typeof b?b:"");break;case "SELECT":for(var d=-1,e=""===(b??""),g=a.options.length,l;g--;)if(l=c.C.M(a.options[g]),l==b||""===l&&e){d=g;break}if(0<=d||e&&1{var a=RegExp("\"(?:\\\\.|[^\"])*\"|'(?:\\\\.|[^'])*'|`(?:\\\\.|[^`])*`|/\\*(?:[^*]|\\*+[^*/])*\\*+/|//.*\n|/(?:\\\\.|[^/])+/w*|[^\\s:,/][^,\"'`{}()/:[\\]]*[^\\s,\"'`{}()/:[\\]]|[^\\s]", "g"),b=/[\])"'A-Za-z0-9_$]+$/,d={"in":1,"return":1,"typeof":1};return{Yb:e=>{e=c.g.Bb(e);123===e.charCodeAt(0)&&(e=e.slice(1,-1));e+="\n,";var g=[],l=e.match(a),f=[],h=0;if(1=h){n&&f.length&&g.push("'"+n+"':()=>("+f.join("")+")");var n=h=0;f=[];continue}}else if(58===p){if(!h&&!n&&1===f.length){n=f.pop();continue}}else if(47===p&&1$data");return g.join(",")},cc:(e,g)=>-1l.key==g),Ga:(e,g,l,f,h,k)=>{g&&c.W(g)?!c.vb(g)||k&&g.L()===h||g(h):(console.error(`"${f}" should be observable in ${e.outerHTML.replace(/>.+/,">")}`),l.get("$data")[f]= +l[k-1].match(b))&&!d[p[0]]&&(e=e.slice(e.indexOf(m)+1),l=e.match(a),k=-1,m="/"):40===p||123===p||91===p?++h:41===p||125===p||93===p?--h:n||f.length||34!==p&&39!==p||(m=m.slice(1,-1));f.push(m)}if(0$data");return g.join(",")},cc:(e,g)=>-1l.key==g),Ga:(e,g,l,f,h,k)=>{g&&c.W(g)?!c.vb(g)||k&&g.L()===h||g(h):(console.log(`"${f}" should contain observable in ${e.outerHTML.replace(/>.+/,">")}`),l.get("$data")[f]= h)}}})();(()=>{function a(f){return 8==f.nodeType&&e.test(f.nodeValue)}function b(f){return 8==f.nodeType&&g.test(f.nodeValue)}function d(f,h){for(var k=f,m=1,p=[];k=k.nextSibling;){if(b(k)&&(c.g.l.set(k,l,!0),!--m))return p;p.push(k);a(k)&&++m}if(!h)throw Error("Cannot find closing comment tag to match: "+f.nodeValue);return null}var e=/^\s*ko(?:\s+([\s\S]+))?\s*$/,g=/^\s*\/ko\s*$/,l="__ko_matchedEndComment__";c.m={aa:{},childNodes:f=>a(f)?d(f):f.childNodes,ja:f=>{a(f)?(f=d(f))&&[...f].forEach(h=> c.removeNode(h)):c.g.Qa(f)},pa:(f,h)=>{a(f)?(c.m.ja(f),f.after(...h)):c.g.pa(f,h)},prepend:(f,h)=>{a(f)?f.nextSibling.before(h):f.prepend(h)},Ub:(f,h,k)=>{k?k.after(h):c.m.prepend(f,h)},firstChild:f=>{if(a(f))return f=f.nextSibling,!f||b(f)?null:f;let h=f.firstChild;if(h&&b(h))throw Error("Found invalid end comment, as the first child of "+f);return h},nextSibling:f=>{if(a(f)){var h=d(f,void 0);f=h?(h.length?h[h.length-1]:f).nextSibling:null}if((h=f.nextSibling)&&b(h)){if(b(h)&&!c.g.l.get(h,l))throw Error("Found end comment without a matching opening comment, as child of "+ f);return null}return h},Qb:a,ac:f=>(f=f.nodeValue.match(e))?f[1]:null}})();const S=new Map;c.ob=new class{Xb(a){switch(a.nodeType){case 1:return null!=a.getAttribute("data-bind");case 8:return c.m.Qb(a)}return!1}Ob(a,b){a:{switch(a.nodeType){case 1:a=a.getAttribute("data-bind");break a;case 8:a=c.m.ac(a);break a}a=null}if(a)try{let e=S.get(a);if(!e){var d="$context = new Proxy( $context, { has: () => true, get: (target, key) => target[key] || target['$data'][key] } );with($context){return{"+ diff --git a/vendors/knockout/src/binding/expressionRewriting.js b/vendors/knockout/src/binding/expressionRewriting.js index 8c4761983..9cbc1753d 100644 --- a/vendors/knockout/src/binding/expressionRewriting.js +++ b/vendors/knockout/src/binding/expressionRewriting.js @@ -134,7 +134,7 @@ ko.expressionRewriting = (() => { // it is !== existing value on that writable observable writeValueToProperty: (element, property, allBindings, key, value, checkIfDifferent) => { if (!property || !ko.isObservable(property)) { - console.error(`"${key}" should be observable in ${element.outerHTML.replace(/>.+/,'>')}`); + console.log(`"${key}" should contain observable in ${element.outerHTML.replace(/>.+/,'>')}`); // ko.dataFor(element).key = value; allBindings.get('$data')[key] = value; } else if (ko.isWriteableObservable(property) && (!checkIfDifferent || property.peek() !== value)) {