neulab/explainaboard_web

Example benchmark config gets incorrectly minified

Opened this issue · 1 comments

Ccing @neubig @pfliu-nlp

On our dev and prod server, the benchmark submit drawer shows an incorrectly minified benchmark config. The root cause is webpack (used by create react app) auto-minifies JS files by removing any whitespaces before serving to production. I didn't catch this bug as I've been developing locally...

I initially thought about switching to JSON, but then we must remove all comments as they are not allowed in JSON. There is also no easy way to exclude a file from minification without ejecting create-react-app (which is not recommended especially given we don't have a dedicated frontend team at the moment. Here are some reasons).

I'm thinking if it'd be better to fetch the config file from the CLI repo and parse it. This way it's guaranteed to be in a pretty format, and a bonus is we don't need to maintain two config files (one in web and one in CLI). Open to comments and suggestions!

Screen Shot 2022-12-22 at 1 38 28 AM

Thanks for creating this issue! I think what you proposed works. (You probably already thought about this) Another slightly simpler option is to store this file as a .txt or as a string in the code (we don't need raw-loader if we go with this). But we don't get syntax highlighting if we store it as plain text.