Hello everyone,
i have two questions about how to minimise names of variables, classes, fncs as short as possible?
- For example I have:
final class Cart {
public var cartContent:CartContent;
public var shipping:Shipping;
public var payment:Payment;
// selectors
private var cartQtySelector = 'js-cartQuantity';
private function updateCartElem():Void
{
var cartQtyElems:HTMLCollection = document.getElementsByClassName(cartQtySelector);
if(cartQtyElems != null) {
...
}
}
Variable cartContent is using in whole app in haxe and thats fine but on the output and the mostly in JS target I would generate this variable for example “c” only and keep it as shortly as it can be this way. The same for shipping as “s” and payment as “p” only. Is this possible also for classes, fnc?
I found metadata @:native() but i dont think its for internal classes variables and function but rather for external only.
Or the macro is the only way but i don’t feel confident this way
I dont know what the exact name of this way
- is possible in JS output to replace variable
cartQtySelector
in all places in code with his string ‘js-cartQuantity’? I would like to remove couple of variables to achieve more optimise code without those defined variables.
Thank you so much !