Auto publish and Using helper functions

hi everyone,
I was looking for best coding practices one should follow in meteor (Blaze as front end).
can someone share a link.

Also i need to ask, if using helper function is a good practice or calling a helper too many times causes some problem.
Auto publish - I never removed auto publish from my main project. Is it going to cause some trouble in future ? for now it works smooth.

Thanks in advance to those who are going to make any effort.

You could start with the Blaze Guide.

Generally speaking, helpers work well and don’t cause problems. However, due to the way reactivity is handled by Blaze, it’s possible (easy) to cause unnecessary re-renders - especially if you use iron router. There are techniques you can adopt to minimise those re-renders.

It’s usually considered bad practice to leave autopublish in your app. However, if you are publishing small amounts of data and all clients are supposed to get to see all that data, then you may be okay. It’s a risky strategy though, since you may add some code meant to be secure and visible only to some clients. If you forget about autopublish, that’s a big security hole. Also, it’s easier to tackle “real” publications if you start with autopublish removed. A bigger job if you remove it late in the project.

1 Like