alexwl / haskell-code-explorer

Web application for exploring and understanding Haskell codebases
MIT License
509 stars 20 forks source link

Enhancement: Static site generation #22

Open langston-barrett opened 5 years ago

langston-barrett commented 5 years ago

I'd love to index a package set and host the results on e.g. Github's static site feature. Is that at all realistic? I see that the app/ folder contains quite a bit of server code, so this might be out of reach.

alexwl commented 5 years ago

Most features of HCE (cross-package 'go to definition', 'find references', identifier search,...) rely on server-side logic, so currently it's not possible to deploy the app as a collection of static files.

The server (app/Server.hs) responds to HTTP requests from the JS app. There are 11 HTTP endpoints: https://github.com/alexwl/haskell-code-explorer/blob/d65f02107a6adce4b45ba9b8ecebf78571612a65/javascript/app/utils/api-urls.js#L18-L50 3 endpoints are "static": the server simply sends a file. 8 endpoints are "dynamic": the server needs to do multiple lookups in an in-memory data structures and to paginate the results if needed.

In principle, it's possible to create a version of HCE without features that require server-side logic, but I'm not sure if such a limited version will be useful.