react-hover icon indicating copy to clipboard operation
react-hover copied to clipboard

Hover Container dependence on child.type breaks behavior when minified

Open X-sam opened this issue 7 years ago • 6 comments

https://github.com/cht8687/react-hover/blob/master/src/ReactHover.js#L45 if child.type is manipulated by uglify or other minifier, hover behavior fails.

X-sam avatar Jan 10 '19 16:01 X-sam

@stevemao @shineli1984 Any ideas of how to tackle this problem?

cht8687 avatar Jan 29 '19 05:01 cht8687

minifier will only change variable names, not object field name. Can you supply any example when it fails?

stevemao avatar Jan 29 '19 07:01 stevemao

Default create-react-app uglify settings are sufficient to reproduce

      uglifyOptions: {
        parse: {
          ecma: 8,
        },
        compress: {
          ecma: 5,
          warnings: false,
          comparisons: false,
        },
        mangle: {
          safari10: true,
        },
        output: {
          ecma: 5,
          comments: false,
          ascii_only: true,
        },
      },

X-sam avatar Jan 29 '19 15:01 X-sam

I may have miss understood your problem. What exactly is the problem? Stating details of what's expected and what's reality should help.

stevemao avatar Jan 30 '19 03:01 stevemao

@Sam-son This issue seems valid, we need think about a way to preserve the type not being minified.

cht8687 avatar Apr 23 '19 04:04 cht8687

@cht8687 I don't think minify is supposed to do that to files in node_modules, so I don't think this is a real issue.

illiteratewriter avatar Jun 05 '21 18:06 illiteratewriter