Closed dillonforrest closed 7 years ago
Yeah, Pokémon Showdown was my first major project, so I really didn't have a good idea of best practices when I started.
Well, in the most recent overhaul of the client, I rewrote the uglier parts of sim.js
and split it into client.js
, client-mainmenu.js
, client-battle.js
, and client-chat.js
, which was nice since the old sim.js
used to be the worst code in the entire repository (in addition to having a mildly non-indicative name).
That leaves battle.js
as the main file left to be refactored, which I'll probably get to in due time.
I'm open to RequireJS, but I'm not sure if it's the hard part about breaking up large files... the hard part is refactoring, so they can be broken up, isn't it?
In general I guess I'm used to moderately large files: the client-battle.js
at 33 KB is a pretty normal size for me; I wouldn't split it up further. I've seen projects that have a lot of much smaller files and it's always pretty annoying to figure out which code is in which file.
Not that I'm opposed to refactoring into more smaller files if that's what's best practice nowadays, but I guess first I'd like to know, how small are we talking? Which files would you split up, and how would you split them up?
Browserify isn't compatible with the version of NWjs we're using on the desktop client, as I just learned... :/
We can manually fix it, but ick.
This hasn't been done in over a year, so I'm guessing this is dead. Any major client overhaul should probably be done with a TypeScript refactor, anyway.
Hey guys! I'm new here. Love this battle simulator so much!! :)
I realized that the javascript files are really massive. I'm interested in submitting a pull request to implement RequireJS. I'm wondering, are you guys openminded to that? Have you guys discussed this before?