monarch-initiative / monarch-legacy

Monarch web application and API
BSD 3-Clause "New" or "Revised" License
42 stars 37 forks source link

Clear out the cruft in api.js #975

Open cmungall opened 8 years ago

cmungall commented 8 years ago

There are vast swathes of api.js that are unused. Anything that calls anything that uses federation_services_url can go

caveat: landing pages still have a dependency. @kshefchek had the idea of just checking in the json cache for these as a temporary solution.

jmcmurry commented 8 years ago

@kshefchek any update? What exactly would be needed to close this?

kshefchek commented 8 years ago

I've taken the approach of commenting out portions and then deleting if all seems fine. In the literature pages PR I commented a good chunk of the api.js code, and at this point it's probably safe to delete it. That said there's still a bit more than can be cleaned up on top of this.

cmungall commented 8 years ago

Yes, delete commented out code. This is good practice anyway, we have memory in git.

I'm not sure how easy it is to see a call tree in javascript, but fetchDataFromResource must die, and along with it any code that calls it.

Similarly, any method name with ontoquest in it.

Note the landing pages no longer have a dependency, so this should be much easier

We can also kill anything for ringo

Although this will not affect functionality, it's important for understanding our own codebase and moving forward with future refactors.

I don't think it should take long

cmungall commented 8 years ago

I'll do this

cmungall commented 8 years ago

@kshefchek is generateHistogram used? It has a bunch of dependencies to federation

cmungall commented 8 years ago

I believe these are no longer used:

web.wrapRouteGet(app, '/gene/:id/:section.:fmt?', '/gene/{id}/{section}.{fmt?}', ['id', 'section', 'fmt'], fetchFeatureSection);
web.wrapRouteGet(app, '/variant/:id/:section.:fmt?', '/variant/{id}/{section}.{fmt?}', ['id', 'section', 'fmt'], fetchFeatureSection);
web.wrapRouteGet(app, '/genotype/:id/:section.:fmt?', '/genotype/{id}/{section}.{fmt?}', ['id', 'section', 'fmt'], fetchFeatureSection);
web.wrapRouteGet(app, '/model/:id/:section.:fmt?', '/model/{id}/{section}.{fmt?}', ['id', 'section', 'fmt'], fetchFeatureSection);

I will get these on the next pass

kshefchek commented 8 years ago

@cmungall no it has been replaced, feel free to remove.