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

fix(devcontainer): improve dev environment setup and fix HMR #5949

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

the-vampiire
Copy link

Pull Request Template

⚠️ Before Submitting a PR, Please Review:

  • Please ensure that you have thoroughly read and understood the Contributing Docs before submitting your Pull Request.

⚠️ Documentation Updates Notice:

  • Kindly note that documentation updates are managed in this repository: librechat.ai

Summary

fixes #3156 and overall improves devex.

Improve Dev Container Configuration and Development Experience

Changes Made

  • Added proper port forwarding (3080, 3090) in devcontainer.json
  • Fixed Meilisearch environment variable handling in dev container
  • Removed hardcoded MEILI_MASTER_KEY in favor of .env file
  • Configured Vite for proper hot module reloading in containers
  • Added Bun feature to devcontainer for improved Node.js performance
    • this is not required but was an improvement in devex. massive increase in dep installation using bun, and there was already a bun lock. current docs indicate using npm ci

Problem Solved

Previously, the development environment had several issues:

  • Inconsistent environment variable handling between dev and production
  • Hot Module Reloading (HMR) wasn't working properly in containers
  • Missing port forwarding configurations
  • Manual setup steps required for new developers

Impact

These changes improve the development experience when using VS Code Dev Containers by:

  • Making environment variable handling consistent with production
  • Fixing hot reload functionality in containers
  • Ensuring proper port forwarding for both API and frontend
  • Simplifying the setup process for new developers

Additional Notes

This change only affects the local development environment and has no impact on production.

Change Type

Please delete any irrelevant options.

  • Bug fix (non-breaking change which fixes an issue)
  • This change requires a documentation update
    • up to maintainer

possibly it is worth updating the docs on contribution to indicate that the devcontainer is the preferred setup. given the language of the current docs i leave this to the maintainer to decide.

Testing

Please describe your test process and include instructions so that we can reproduce your test. If there are any important variables for your testing configuration, list them here.

these changes only affect the dev environment (devcontainer and vite)

Test Configuration:

Checklist

Please delete any irrelevant options.

  • My code adheres to this project's style guidelines
  • I have performed a self-review of my own code
  • My changes do not introduce new warnings
  • A pull request for updating the documentation has been submitted.
    • up to maintainer

- Add proper port forwarding in devcontainer.json (3080, 3090)
- Fix Meilisearch environment variable handling in dev container
- Remove hardcoded MEILI_MASTER_KEY in favor of .env file
- Configure Vite for proper hot module reloading in containers
- Add Bun feature to devcontainer for better Node.js performance

These changes improve the development experience when using VS Code Dev Containers by:
- Making environment variable handling consistent with production
- Fixing hot reload functionality in containers
- Ensuring proper port forwarding for both API and frontend
- Simplifying the setup process for new developers

No production changes - only affects local development environment.
@rubentalstra rubentalstra added 🧹 chore Routine maintenance tasks 🔧 fix Bug fixes and code patches and removed 🧹 chore Routine maintenance tasks labels Feb 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔧 fix Bug fixes and code patches
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants