-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
Fix Docgen in static builds for Info #1725
Conversation
Can we find a way to restrict this to |
@Hypnosphi I think the We don't really have a framework for turning features on and off in Webpack without using a custom Webpack config. Sadly, we never enabled custom New issue created to track custom babel config: #1731 |
As far as I know, this logic lives inside UPD: yeah, here it is: https://github.com/facebook/prop-types/blob/master/index.js#L10 |
Actually yeah, I was thinking of how flow types are stripped out. I can't find any documentation on how to supply the That's what I'm doing already to unset the production flag. Webpack just feels like a black box to me. Any other suggestions? |
One possible solution is to add custom loader just for |
@Hypnosphi That feels really hacky. I don't think the benefits of avoiding a dev webpack flag outweigh the cost of maintaining a custom webpack plugin. |
That's exactly you now do for all the packages (via
It should be rather a loader than plugin, and it would be a one-liner:
I believe that using more performant versions of packages (as mush as we can) in what's supposed to be a production build outweighs maintaining one line of javascript a bit |
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.
Please limit the scope of dev flag to prop-types
package (see above) or remove it completely.
Please make al those changes optional (as you don't need it if you're not using info plugin)
e593687
to
2c42ec3
Compare
2c42ec3
to
c643aee
Compare
Removed the webpack dev environment. Definitely agree on the performance but I think making webpack settings optional is out of scope of this bug fix. Probably something like #1098 |
Well, now it's only babel, but maybe it won't hurt to have this plugin always Please address the unit tests failure |
how can I get the file-stub locally without modifying it manually?
|
382ca2b
to
c643aee
Compare
Codecov Report
@@ Coverage Diff @@
## release/3.3 #1725 +/- ##
============================================
Coverage 23.12% 23.12%
============================================
Files 253 253
Lines 5756 5756
Branches 694 689 -5
============================================
Hits 1331 1331
- Misses 3906 3934 +28
+ Partials 519 491 -28
Continue to review full report at Codecov.
|
@ndelangen @shilman any thoughts on this getting merged into master instead of 3.3? it's a small change to prod babel config and a new example app story. |
Gonna just merge it into |
Issue:
Fixes: #1661 #1141
PropTypes get removed during our build and Docgen never runs so the Prop Table in Info shows up empty and undefined.
What I did
How to test
run cra-kitchen-sink and check the 3 AddonInfo buttons.
Is this testable with jest or storyshots?
yes
Does this need a new example in the kitchen sink apps?
yes
Does this need an update to the documentation?
no
If your answer is yes to any of these, please make sure to include it in your PR.