zlsa / atc

https://openscope.co/
342 stars 107 forks source link

Code quality and tooling [Enhancement] #678

Closed n8rzz closed 7 years ago

n8rzz commented 8 years ago

Is there any need/desire from the developers here for more tooling?

Things that are lacking in the repo that I think might be beneficial:

Immediately implementable


Is there any reason a custom module loader is being used? Was that part architected before module loading was even a thing?

I think at the very least there should be some code quality tooling like jshint/eslint and especially an editorconfig file.

Bundling should be a close to the top as well. For those that don't know what bundling is, bundling provides a way to package all the css and all the js into one tidy file. That translates into faster load times for the end user, but that also means that developers don't have to worry loading order for each script, thats all handled by the bundler. As far as the current code base is concerned, that would mean ripping out the current module loader and replacing it with something like Browserify. At a quick glance that looks like it would probably be a fair amount of work. I think, though, that the gains would would be well worth the pain of a conversion.

I think making a transition to ES2015, or es6/es7 as it's sometimes referred to, should definitely be on the radar (pun very much intended) too. ES2015 brings a lot of fun new toys to javascript and makes it much more fun to write javascript. Not mention making the code much easier to reason about. The downside is that it does require some tooling, though it's not that hard to implement and if something like browserify were implemented first, making the switch to es2015 would be much easier.


Most of the changes above involve big changes in folder and file structure that could have big impacts on other developers and the work that they may be doing. But, again, I think there are some substantial gains to be had here.

I'd be curious to see what interest, if any, exists for any of the above. Or maybe there is something else that I didn't list above that some of you would like to see implemented?

eliuuk commented 8 years ago

Bundling should be a close to the top as well. For those that don't know what bundling is, bundling provides a way to package all the css and all the js into one tidy file. That translates into faster load times for the end user, but that also means that developers don't have to worry loading order for each script, thats all handled by the bundler. As far as the current code base is concerned, that would mean ripping out the current module loader and replacing it with something like Browserify. At a quick glance that looks like it would probably be a fair amount of work. I think, though, that the gains would would be well worth the pain of a conversion.

I'm not someone who works with js or css, so apologies if my opinion doesn't work! Bundling is something that I'm not completely hooked on with. This is because the .js files in the scripts folder have thousands of lines. For a content creator, scrolling through thousands of lines just to add an airport to be loaded would be slightly annoying. But, if this is something that's crucial, then it's up to you!

n8rzz commented 8 years ago

Sorry, I should have been clearer on that:

All the files would remain as they are. Its like what is already happening with the css files only this would be with the js files. That would allow index.html to have only one line for css imports and one line for js imports (vendor files included).

Something like this:

screen shot 2016-09-07 at 12 40 57 pm

would look more like this:

screen shot 2016-09-07 at 12 45 41 pm

Smaller files, and less of them, mean faster response times by the browser and less lag. The actual source files would remain the same.

Does that make sense?

eliuuk commented 8 years ago

Thanks, that makes perfect sense. I'm sure many with slower internet would appreciate this!

erikquinn commented 8 years ago

@n8rzz YES YES AND YES. lol In particular I would echo the need for es2015 support! These would all be great things. At least for me, I think the feeling of pressure to implement various playability improvements has meant back-end changes like these have been neglected. But adding them in would make the former much easier to do as well. I see you've started some work already; whatever you can do in regards to these types of improvements is greatly appreciated!

erikquinn commented 7 years ago

Seems like just yesterday... I almost feel bad closing this in my cleanup here... :smile: