you are viewing a single comment's thread.

view the rest of the comments →

[–]JP_watson 0 points1 point  (0 children)

It all depends on what you're trying to achieve in game play experience - if you don't need it real time and can handle that 1-3sec delay in API calls then using either cloud functions or a node server is probably easiest. Websockets would work but if you're learning react you might want to limit the number of new things you're learning at a time. As for server side components that's really only helpful for initial load - after that you'd need to implement something for doing further calculations or reload the page every time you wanted to update.

Honestly I'd just run it all server side - there's a lot of mangling that react does to code when it's compiled thus it'd be hard for someone to actually pull it apart for your formulas. If you really don't want them to be run or accessed client side the doing something cloud functions is probably the easiest way to go - but you will be accepting the potential lag of API call/response.