-
Notifications
You must be signed in to change notification settings - Fork 47k
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
Remove cache-invalidating code/hack #10615
Comments
I'm not too familiar with the backstory, but I'm curious if we can eliminate this now that #7178 has merged. |
I found that LAST_BUILD was actually a variable we passed into process.env when building it through webpack. Removing it solved my cacheing issue at least, but I think removing the hack would mitigate such future bugs. |
Ah... interesting. This is because of: if(
typeof process !== 'undefined' &&
process.env &&
process.env.NODE_ENV === 'test'
) In these places: Looks like your This shouldn't be a problem in React 16, since the stack renderer is going away. In any case, I think htis code path should be stripped away by Uglify. Could you confirm for me if this is showing up in your production build? |
Yes, we were using a DefinePlugin with process.env things inside. |
Thanks for reporting! This is fixed in master (basically that file won't be shipped at all in React 16). You can already try React 16 beta if you'd like. I don't think we will be making further changes to this in 15. |
Do you want to request a feature or report a bug?
Bug
What is the current behavior?
In the output code after building there is a hack in the code which includes the time of compilation, which causes the whole file to be modified, which when code-splitting is bad for caching.
Relevant output code (see LAST_BUILD):
If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem via https://jsfiddle.net or similar (template: https://jsfiddle.net/ebsrpraL/).
Build project with react and react-dom in development or production, check diff between two supposedly identical builds.
What is the expected behavior?
The two builds outputs should be identical if no modifications have been made.
Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?
15.6.1
The text was updated successfully, but these errors were encountered: