-
Notifications
You must be signed in to change notification settings - Fork 69
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
Minified bundle used for production causes arrows not to display as pretty curves #24
Comments
Oh, oops. If you want me to go faster, you may provide a minimal example 😊 |
@pierpo thankyou!! I will try to get one together |
Experiencing exactly the same issue here... I should mention, the render happens on client not on server. I'll have a closer look tomorrow as well... Thank you so much for this utility btw, its really great (other than this bug) 😄 |
I managed to fix this by cloning the repo @ master and building the lib/react-archer.js file on my own (and then including that one to my codebase instead of the package import). After finding that this works, I decided to prettify & diff the two files (one that comes from npm and the one I built myself):
So, it seems to me that these are actually changes from recent (merged) commits that fixed this issue but havent been published to npm yet? |
@zgec @AlisonWonderlandApps Just published a new version. Feel free to reopen if it doesn't work 😊 Thanks again for the issue and pointing out the problem! |
Thankyou @pierpo !! I'm really impressed by your dedication to this library and your responsiveness to issues as well! Great job! 👍 🥇 |
@AlisonWonderlandApps Thanks for the kind words 😊 |
I am actually still running into this issue - the arrows work fine in dev mode and then once minified with Highlighted box on the left is the target object. Thanks! |
Hey @geoff-va, I can take a look at this but I don't have any immediate guesses. Seems very odd at first glance |
I agree - I'm pretty new to React so am not clear on what black magic may be occurring when everything gets minified. I wonder if it has to do with render timing in someway? really odd for sure. I appreciate you looking into this, though! |
We generate different Dev
Prod
The cubic bezier section |
Long story short @geoff-va, I believe that this is an evil Terser function inlining bug. The code in SvgArrow was getting optimized to pass 0 to most of the arguments in Issue in Terser: |
The workaround is to disable function inlining in UglifyJS or Terser. This works in our production app. Webpack with Terser example code: optimization: {
...baseConfig.optimization,
minimizer: [
new TerserPlugin({
cache: true,
parallel: true,
terserOptions: {
compress: {
inline: false,
},
},
}),
],
}, |
@jfo84 - Amazing detective work man! This does sound like what I was seeing. I remember seeing C0 instead of like C600 for some of the curve descriptions. I really appreciate you digging into this man! Kudos to you! |
@jfo84 I'm using create-react-app, and packaging with docker. I continue to have this issue in prod... not sure how I would go about implementing a workaround here |
@AlisonWonderlandApps Are you on v1.0.2? If that doesn't fix it, then you'll have to eject your Webpack config and manually apply the minimizer change above |
For anyone interested, I used react-app-rewired to override this problem without ejecting my app:
Then in package.json file change the scripts object to:
Then create a config.overrides.js file in root directory and put the following in it:
|
Thank you so much @jfo84 for investigating successfully this hard problem! Closing this since it's not an issue related to |
Next.js 9
|
Solution proposed by @AlisonWonderlandApps works but it completely removes @lishine's solution works with react-app-rewired and disables only
|
Minified bundle used for production causes arrows not to display as pretty curves
These arrows look great when in dev mode. But once I build a prod (using npm build) to go to production, the arrows lose their curve and therefore look straight & warped :(
The text was updated successfully, but these errors were encountered: