You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This PR was merged into the 2.x branch.
Discussion
----------
Rebuild js dist files
| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | no
| Tickets | N/A
| License | MIT
Tried to update my project deps to use 2-x.dev of LiveComponent, but now that renderer returns HTML instead of JSON, it fails, because the LiveController still uses JSON.
This rebuilds dist files from #226, #245, #247 changes.
Commits
-------
6906cc6 Rebuild js dist files
Copy file name to clipboardExpand all lines: src/LiveComponent/assets/dist/live_controller.js
+42-28Lines changed: 42 additions & 28 deletions
Original file line number
Diff line number
Diff line change
@@ -963,7 +963,7 @@ function setDeepData(data, propertyPath, value) {
963
963
constfinalKey=parts[parts.length-1];
964
964
if(typeofcurrentLevelData!=='object'){
965
965
constlastPart=parts.pop();
966
-
thrownewError(`Cannot set data-model="${propertyPath}". They parent "${parts.join(',')}" data does not appear to be an object (it's "${currentLevelData}"). Did you forget to add exposed={"${lastPart}"} to its LiveProp?`);
966
+
thrownewError(`Cannot set data-model="${propertyPath}". The parent "${parts.join('.')}" data does not appear to be an object (it's "${currentLevelData}"). Did you forget to add exposed={"${lastPart}"} to its LiveProp?`);
967
967
}
968
968
if(currentLevelData[finalKey]===undefined){
969
969
constlastPart=parts.pop();
@@ -1014,6 +1014,26 @@ function haveRenderedValuesChanged(originalDataJson, currentDataJson, newDataJso
@@ -1112,23 +1132,12 @@ class default_1 extends Controller {
1112
1132
this._makeRequest(null);
1113
1133
}
1114
1134
_getValueFromElement(element){
1115
-
constvalue=element.dataset.value||element.value;
1116
-
if(!value){
1117
-
constclonedElement=(element.cloneNode());
1118
-
if(!(clonedElementinstanceofHTMLElement)){
1119
-
thrownewError('cloneNode() produced incorrect type');
1120
-
}
1121
-
thrownewError(`The update() method could not be called for "${clonedElement.outerHTML}": the element must either have a "data-value" or "value" attribute set.`);
thrownewError('cloneNode() produced incorrect type');
1131
-
}
1140
+
constclonedElement=cloneHTMLElement(element);
1132
1141
thrownewError(`The update() method could not be called for "${clonedElement.outerHTML}": the element must either have a "data-model" or "name" attribute set to the model name.`);
0 commit comments