-
Notifications
You must be signed in to change notification settings - Fork 31
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
Enabling redux devtools in production #465
Conversation
This reverts commit 16999ad.
I spoke with @lorang92 and @altinnadmin about this, and we decided against the 7mb source map this time around. Having it checked into the git repo for cdn, hosted on github spaces, etc, would quickly balloon into much more disk usage than just 7mb. We also considered:
TL;DR: Skipping source maps for now |
@@ -22,7 +22,7 @@ export const setupStore = (preloadedState?: PreloadedState<RootState>) => { | |||
|
|||
const innerStore = configureStore({ | |||
reducer: reducers, | |||
devTools: isDev, | |||
devTools: true, |
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.
Just a note: this defaults to true
, so strictly not needed config. But better to be explicit I guess!
Neat 🥇
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.
Oh, didn't know that! But yeah, I don't mind that being explicit.
Kudos, SonarCloud Quality Gate passed!
|
How expensive are those sourcemaps really? They won't be downloaded unless people open devtools. With the current state of react frontend crashing for every error in the json files, it would really help to speed up our debugging process to figure out what is wrong. |
@ivarne I agree they would be useful, especially for more experienced developers, but as of now they might be problematic to add to the CDN. As the CDN is backed by a git repo, every new file needs to be checked into git, grows the history, and might affect our ability to serve the CDN at all (github static pages have storage limitations). I'm hoping for this to easier in the future, possibly after moving the CDN to azure. Right now, the risks outweighs the benefits, IMO. |
Description
This change enables redux devtools in the production build, which brings with a few hundred bytes extra code,
as well as a 7.1mbaltinn-app-frontend.js.map
and a 556kbaltinn-app-frontend.css.map
to be published on altinncdn.no.Adding these to the production build gives us a few advantages when debugging and reproducing strange bugs:
Thrown exceptions in our own code will include references to the actual source files, lines and code that caused the error (instead of line 1, column 489984)Related Issue(s)
Verification
[ ] Relevant automated test added (if you find this hard, leave it and we'll help out)Documentation