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

feat: use npm run dev-server in docker-compose #31876

Merged
merged 7 commits into from
Jan 16, 2025
Merged

Conversation

mistercrunch
Copy link
Member

This configures docker to serve the interactive/dynamic webpack server at localhost:9000, and configures it to connect to the backend serve in another container at port 8088. It offers the convenience to auto-webpack and auto-refresh the pages as code is altered/saved.

This configures docker to serve the interactive/dynamic webpack server at `localhost:9000`, and configures it to connect to the backend serve in another container at port 8088. It offers the convenience to auto-webpack and auto-refresh the pages as code is altered/saved.
@dosubot dosubot bot added change:frontend Requires changing the frontend install:docker Installation - docker container labels Jan 15, 2025
if (parsedArgs.env) {
return yargs(parsedArgs.env).argv;
envArgs = yargs(parsedArgs.env).argv;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yargs was getting in the way of using normal env vars here

Copy link

@korbit-ai korbit-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review by Korbit AI

Korbit automatically attempts to detect when you fix issues in new commits.
Category Issue Fix Detected
Performance Avoid unnecessary spreading of process.env. ▹ view
Functionality Dev Server Proxy Config Not Applied ▹ view

Need a new review? Comment /korbit-review on this PR and I'll review your latest changes.

Korbit Guide: Usage and Customization

Interacting with Korbit

  • You can manually ask Korbit to review your PR using the /korbit-review command in a comment at the root of your PR.
  • You can ask Korbit to generate a new PR description using the /korbit-generate-pr-description command in any comment on your PR.
  • Too many Korbit comments? I can resolve all my comment threads if you use the /korbit-resolve command in any comment on your PR.
  • Chat with Korbit on issues we post by tagging @korbit-ai in your reply.
  • Help train Korbit to improve your reviews by giving a 👍 or 👎 on the comments Korbit posts.

Customizing Korbit

  • Check out our docs on how you can make Korbit work best for you and your team.
  • Customize Korbit for your organization through the Korbit Console.

Feedback and Support

Comment on lines 528 to 536
setupMiddlewares: (middlewares, devServer) => {
// load proxy config when manifest updates
const { afterEmit } = getCompilerHooks(devServer.compiler);
afterEmit.tap('ManifestPlugin', manifest => {
proxyConfig = getProxyConfig(manifest);
});

return middlewares; // Make sure to return the middlewares
},

This comment was marked as resolved.

}
return {};
return { ...process.env, ...envArgs };
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Avoid unnecessary spreading of process.env. category Performance

Tell me more

In the parsedEnvArg function, there is an unnecessary spread of the process.env object. Since process.env is already a global object accessible within the function scope, spreading it into a new object is redundant and wastes memory. To optimize this, consider accessing process.env directly instead of spreading it. Change the return statement to: return { ...envArgs, ...process.env };. This will prioritize variables passed via --env while still allowing access to process.env variables, without the overhead of an extra object spread.

Chat with Korbit by mentioning @korbit-ai, and give a 👍 or 👎 to help Korbit improve your reviews.

@pull-request-size pull-request-size bot added size/M and removed size/S labels Jan 16, 2025
@pull-request-size pull-request-size bot added size/S and removed size/M labels Jan 16, 2025
if (isDevMode) {
config.devServer = {
onBeforeSetupMiddleware(devServer) {
setupMiddleware: (middlewares, devServer) => {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

onBeforeSetupMiddleware had a deprecation warning:
Screenshot 2025-01-15 at 2 41 34 PM

fixed it using a claude-provided solution, looked legit

@pull-request-size pull-request-size bot added size/M and removed size/S labels Jan 16, 2025
@mistercrunch mistercrunch merged commit ab60456 into master Jan 16, 2025
47 checks passed
@mistercrunch mistercrunch deleted the dev-server branch January 16, 2025 02:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
change:frontend Requires changing the frontend install:docker Installation - docker container size/M
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants