I was thinking about the architecture on the client side. First I thought, okay I can bundle this and that to reduce requests to the server.
But I found out that there's a lot of logic I need seperated. So for now I splitted up the socket events in two scripts. The script for the visitor and another script for the artist.
And for the template to know which scripts to load, I give it an array of the scripts and then I loop through them at the end of the body.
For additional attribute options on the script tags I can make objects in the array instead of the names of the scripts. That's more elegant, but not really the main goal here. So I can tackle that when I have time left over, which is not gonna happen.
I was thinking about the architecture on the client side. First I thought, okay I can bundle this and that to reduce requests to the server.
But I found out that there's a lot of logic I need seperated. So for now I splitted up the socket events in two scripts. The script for the visitor and another script for the artist.
And for the template to know which scripts to load, I give it an array of the scripts and then I loop through them at the end of the body.
For additional attribute options on the script tags I can make objects in the array instead of the names of the scripts. That's more elegant, but not really the main goal here. So I can tackle that when I have time left over, which is not gonna happen.