Skip to content

Include default metas for char_set and viewport#5500

Merged
adhami3310 merged 5 commits into
mainfrom
masenf/include-meta-unless-overridden
Jun 26, 2025
Merged

Include default metas for char_set and viewport#5500
adhami3310 merged 5 commits into
mainfrom
masenf/include-meta-unless-overridden

Conversation

@masenf
Copy link
Copy Markdown
Collaborator

@masenf masenf commented Jun 26, 2025

If the user does not override the char_set or viewport metas with their own, then include these as defaults.

Fixes the annoying hydration error that appears when remix sends its dumb "Hey developer  👋" message on the console, which happened when the app didn't specify utf-8 as its char_set (which would happen if the app used any custom head_components)

masenf added 2 commits June 25, 2025 18:32
If the user does not override the char_set or viewport metas with their own,
then include these as defaults.
Copy link
Copy Markdown
Contributor

@greptile-apps greptile-apps Bot left a comment

Choose a reason for hiding this comment

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

PR Summary

Modified document root creation logic to automatically include default meta tags for character set and viewport unless explicitly overridden by user-defined head components.

  • Updated reflex/compiler/utils.py to conditionally include char_set="utf-8" and viewport meta tags as defaults
  • Fixes hydration errors caused by Remix's developer greeting when UTF-8 charset isn't explicitly specified
  • Maintains backward compatibility while improving flexibility for custom head component configurations

1 file reviewed, no comments
Edit PR Review Bot Settings | Greptile

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented Jun 26, 2025

CodSpeed Performance Report

Merging #5500 will not alter performance

Comparing masenf/include-meta-unless-overridden (b0db493) with main (00091a9)

Summary

✅ 8 untouched benchmarks

adhami3310
adhami3310 previously approved these changes Jun 26, 2025
Comment thread reflex/compiler/utils.py Outdated
@adhami3310 adhami3310 dismissed their stale review June 26, 2025 02:48

there's a bug :(

@adhami3310 adhami3310 merged commit 52d8b76 into main Jun 26, 2025
40 of 41 checks passed
@adhami3310 adhami3310 deleted the masenf/include-meta-unless-overridden branch June 26, 2025 03:24
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

Successfully merging this pull request may close these issues.

2 participants