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

Research alternative ways to configure the frontend application #456

Closed
lunkwill42 opened this issue Nov 14, 2022 · 2 comments · Fixed by #536
Closed

Research alternative ways to configure the frontend application #456

lunkwill42 opened this issue Nov 14, 2022 · 2 comments · Fixed by #536
Assignees
Labels
design discussion Requires developer feedback/discussion before implementation

Comments

@lunkwill42
Copy link
Member

The frontend application configuration is defined in config.tsx - and the values are provided as environment variables at build time.

If we have a goal to provide a Docker image with the Argus frontend in it, this still needs to build everything from scratch at deployment time, since all the configuration is statically compiled into the resulting JavaScript files. This makes every deployment situation "fat" and time-consuming.

I think it's desirable for frontend deployments to be as lightweight as possible. Can we find ways to generate a static file with JavaScript or JSON-based configuration from the run-time environment, without involving the entire npm build framework, and have the React application load this file at runtime?

Surely this situation is not unique in the world - so it's likely someone else has made useful solutions we can learn fro.

@podliashanyk
Copy link
Contributor

[WIP]

This comment contains consolidated info after the research and is not yet finished.

Config file changes:

  • dotenv option
  • js/json option
  • /public folder option

Docker build optimization:

Consider tools:

@lunkwill42
Copy link
Member Author

* dotenv option

I would assume dotenv isn't much different from today's solution: It grabs variables from the environment as npm runs - this environment isn't available when the resulting JS code runs in the browser.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
design discussion Requires developer feedback/discussion before implementation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants