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

Example benchmark config gets incorrectly minified #575

Open
OscarWang114 opened this issue Dec 22, 2022 · 1 comment
Open

Example benchmark config gets incorrectly minified #575

OscarWang114 opened this issue Dec 22, 2022 · 1 comment
Assignees

Comments

@OscarWang114
Copy link
Collaborator

OscarWang114 commented Dec 22, 2022

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

@OscarWang114 OscarWang114 self-assigned this Dec 22, 2022
@lyuyangh
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants