neulab / explainaboard_web

MIT License
8 stars 2 forks source link

Example benchmark config gets incorrectly minified #575

Open OscarWang114 opened 1 year ago

OscarWang114 commented 1 year ago

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
lyuyangh commented 1 year ago

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.