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
Marko has always had a special data variable that referenced the input object to the template. Calling it data has lead to various inconsistencies. UI components have an onInput(input) method. In this case, the input argument refers to what becomes the data variable. Obviously the first parameter to onInput() can be named whatever, but input is a better fit. For better clarity and more consistency throughout we want to switch from data to input (while still maintaining backwards compatibility).
For the first phase we will rename the data parameter to input for the compiled template's render() function and add a local variable named data that references the new input variable (var data = input;).
As a follow up we will do static code analysis to only add the var data = input; line if the template references the old data variable (we will also add a deprecation warning when we find that a compiled template references the old data variable)).
We are also exploring the option of automatically persisting the input object passed to the UI component as part of the widget instance so that it is automatically available during a rerender (currently only state is persisted). If we make this change then the input would be available as this.input on the widget instance and it would also be serialized from the server to the browser.
The text was updated successfully, but these errors were encountered:
Marko has always had a special
data
variable that referenced the input object to the template. Calling itdata
has lead to various inconsistencies. UI components have anonInput(input)
method. In this case, theinput
argument refers to what becomes thedata
variable. Obviously the first parameter toonInput()
can be named whatever, butinput
is a better fit. For better clarity and more consistency throughout we want to switch fromdata
toinput
(while still maintaining backwards compatibility).For the first phase we will rename the
data
parameter toinput
for the compiled template'srender()
function and add a local variable nameddata
that references the newinput
variable (var data = input;
).As a follow up we will do static code analysis to only add the
var data = input;
line if the template references the olddata
variable (we will also add a deprecation warning when we find that a compiled template references the olddata
variable)).We are also exploring the option of automatically persisting the
input
object passed to the UI component as part of the widget instance so that it is automatically available during a rerender (currently onlystate
is persisted). If we make this change then theinput
would be available asthis.input
on the widget instance and it would also be serialized from the server to the browser.The text was updated successfully, but these errors were encountered: