Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable airport load without bundling #88

Closed
2 tasks
n8rzz opened this issue Nov 13, 2016 · 2 comments
Closed
2 tasks

Enable airport load without bundling #88

n8rzz opened this issue Nov 13, 2016 · 2 comments
Milestone

Comments

@n8rzz
Copy link
Owner

n8rzz commented Nov 13, 2016

see: zlsa#719

contributors should be able to add airports without needing npm and re-bundling.

  • move airportLoadList.js to assets/airports and format to be json
  • update AirportController to load this file as part of instantiation or one of the init methods
@erikquinn
Copy link
Collaborator

@n8rzz What if we just moved the icao, level, and name that are in the load list, and moved them to the individual airport files? Because if we removed the list, and somehow just told the sim to load all airports within the assets/airports folder, then it'd be like a two birds with one stone type simplification.

@n8rzz
Copy link
Owner Author

n8rzz commented Nov 14, 2016

I agree it would be good to have those three properties in each airport json, I'm not sure that doing that would be the best solution.

I would like to avoid loading all files in a directory willy nilly and rather like the idea of having a list of files to load. Although it may seem cumbersome, it provides an explicit definition of things to load. That way we won't accidentally load something that doesn't belong (if that were ever to happen). It also gives us a way to loop through each airport and create a minimal instance before we have the full data set, i.e. we are loading only what we need when we need it.

I was speaking with a colleague today about doing this outside the bundle and I think we came up with a solution. It's not that pretty, but I think it will work. I'll basically move the airportLoadList.js into the assets folder and make it available on the window object. I'm not a fan of adding things to the window, but I think in this case it makes sense. This also keeps us out of evaluating folder contents which can get expensive and unsafe and allows for contributors to add to the list and not have to worry about re-bundling.

I think it will work but I haven't tried it yet. So we shall see.

@n8rzz n8rzz added the WIP label Nov 15, 2016
@n8rzz n8rzz mentioned this issue Nov 15, 2016
@n8rzz n8rzz closed this as completed Nov 16, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants