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
Alternatively, you can simply check the array length or ensure that a string is not "falsey".
Why?
The empty/notEmpty helpers were automatically being added to every compiled template. While they can be helpful, we feel it is better if the developer explicitly imports only the exact helpers that your code depends on for improved modularity. Also, when adding support for inline marko templates we found that these empty/notEmpty helpers could conflict with other JavaScript code since all static code/imports are added at the top of the JavaScript file.
The text was updated successfully, but these errors were encountered:
@briceburg I suppose one possibility would be to introduce a new option in marko.json to opt-in for the empty/notEmpty helpers, but I don't think it is a good idea to go there. Personally, I would just use <if(data.commits && data.commits.length)> instead of a helper. If you have any other thoughts or ideas please share.
The builtin
empty
/notEmpty
helpers will be removed in Marko v4 and will be deprecated in v3 (with console warning).If still needed, these helpers can still explicitly be imported:
Alternatively, you can simply check the array length or ensure that a string is not "falsey".
Why?
The
empty
/notEmpty
helpers were automatically being added to every compiled template. While they can be helpful, we feel it is better if the developer explicitly imports only the exact helpers that your code depends on for improved modularity. Also, when adding support for inline marko templates we found that theseempty
/notEmpty
helpers could conflict with other JavaScript code since all static code/imports are added at the top of the JavaScript file.The text was updated successfully, but these errors were encountered: