-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
ref: Make react_config available in context #81654
Conversation
This patch refactors a 10-year-old hack where we used a template tag to produce the initial data JSON, making the contents of that blob unavailable to any Django template. With this, all views extending from base gets a `react_config` context object so we can do things like sniffing user's language or theme preferences if available and modify the HTML output based on that. Related #81611
@scttcper - if this works, we should be able to do something like |
Codecov ReportAll modified and coverable lines are covered by tests ✅ ✅ All tests successful. No failed tests found. Additional details and impacted files@@ Coverage Diff @@
## master #81654 +/- ##
==========================================
+ Coverage 80.35% 80.46% +0.10%
==========================================
Files 7253 7252 -1
Lines 320569 321989 +1420
Branches 20859 20811 -48
==========================================
+ Hits 257600 259082 +1482
+ Misses 62574 62507 -67
- Partials 395 400 +5 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good.
This patch refactors a 10-year-old hack where we used a template tag to produce the initial data JSON, making the contents of that blob unavailable to any Django template. With this, all views extending from base gets a `react_config` context object so we can do things like sniffing user's language or theme preferences if available and modify the HTML output based on that. Related #81611
Follow up to #81654 and should fix getsentry/self-hosted#3473
Follow up to #81654 and should fix getsentry/self-hosted#3473
This patch refactors a 10-year-old hack where we used a template tag to produce the initial data JSON, making the contents of that blob unavailable to any Django template. With this, all views extending from base gets a
react_config
context object so we can do things like sniffing user's language or theme preferences if available and modify the HTML output based on that.Related #81611