Conversation
CodSpeed Performance ReportMerging #5906 will create unknown performance changesComparing Summary
Footnotes
|
Contributor
There was a problem hiding this comment.
Greptile Overview
Summary
This PR exposes two new Vite configuration options through environment variables:
VITE_EXPERIMENTAL_HMR(defaults toTrue): enables Rolldown's experimental hot module replacementVITE_SOURCEMAP(defaults toFalse): controls sourcemap generation with support for boolean and string literal values (False,True,"inline","hidden")
The implementation includes:
- New Literal type interpretation logic in the environment variable system to support union types with mixed bool/string literals
- Updated Vite config template to output the experimental HMR and sourcemap settings
- Proper type hints and documentation throughout
Confidence Score: 5/5
- This PR is safe to merge with no issues found
- The changes are well-structured and properly implemented. The Literal type interpretation logic correctly handles all value types (string, bool, int). The template correctly converts Python values to JavaScript syntax. All changes are additive with sensible defaults that maintain backward compatibility.
- No files require special attention
Important Files Changed
File Analysis
| Filename | Score | Overview |
|---|---|---|
| reflex/compiler/templates.py | 5/5 | Added two new parameters to vite_config_template function (experimental_hmr, sourcemap) with proper type hints and documentation. Template correctly outputs JavaScript boolean and string values. |
| reflex/environment.py | 5/5 | Added Literal type interpretation support and two new environment variables (VITE_EXPERIMENTAL_HMR, VITE_SOURCEMAP). The Literal handler correctly processes string, bool, and int literal values. |
| reflex/utils/frontend_skeleton.py | 5/5 | Updated _compile_vite_config to pass the two new environment variables (experimental_hmr, sourcemap) to the vite_config_template function. |
Sequence Diagram
sequenceDiagram
participant User
participant EnvironmentVariables
participant frontend_skeleton
participant templates
participant ViteConfig
User->>EnvironmentVariables: Set VITE_EXPERIMENTAL_HMR (default: True)
User->>EnvironmentVariables: Set VITE_SOURCEMAP (default: False)
frontend_skeleton->>EnvironmentVariables: VITE_EXPERIMENTAL_HMR.get()
EnvironmentVariables-->>frontend_skeleton: bool value
frontend_skeleton->>EnvironmentVariables: VITE_SOURCEMAP.get()
EnvironmentVariables-->>frontend_skeleton: Literal[False, True, "inline", "hidden"]
frontend_skeleton->>templates: vite_config_template(experimental_hmr, sourcemap)
templates->>templates: Convert Python values to JS format
Note over templates: True/False → true/false<br/>"inline"/"hidden" → 'inline'/'hidden'
templates-->>ViteConfig: Generate vite.config.js content
ViteConfig-->>User: Apply experimental HMR and sourcemap settings
3 files reviewed, no comments
masenf
reviewed
Oct 22, 2025
Collaborator
masenf
left a comment
There was a problem hiding this comment.
experimental hmr seems to have trouble when rx.moment is added to an app
- create a blank app
- load it in the browser
- add
rx.moment()to theindexpage TypeError: Failed to fetch dynamically imported module: http://localhost:3000/node_modules/.vite/deps/react-moment.js?v=ff45da65
masenf
approved these changes
Oct 23, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.