correct-apricot
correct-apricot•2y ago

Do you have some best practices for

Do you have some best practices for developing big actors 🤔 I have done a lot of refactoring but I am missing some guidance on this for my actors
3 Replies
subsequent-cyan
subsequent-cyan•2y ago
I think thats a great question and would call for a nice answer, maybe @Lukas Krivka can assign someone?
Lukas Krivka
Lukas Krivka•2y ago
I wouldn't say there is any secret sauce for actors, just general coding best practices. We use the TypeScript templates and try to keep files up to approx 200 lines of code in main.ts, have only input and definition of the crawler then have routes with the code logic in the handler per route and then utils or extractors as separate file. Each file or function should do stuff on similar level of abstraction (main flow vs business logic vs parsing vs utility function)
rival-black
rival-black•2y ago
Thanks I will try to implement this. I have done a huge refactor of the trustpilot actor I maintain so I am trying to develop more maintainable now since it has become quite the monster

Did you find this page helpful?