Skip to content
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

Hover Container dependence on child.type breaks behavior when minified #29

Open
X-sam opened this issue Jan 10, 2019 · 6 comments
Open

Comments

@X-sam
Copy link

X-sam commented Jan 10, 2019

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.

@cht8687
Copy link
Owner

cht8687 commented Jan 29, 2019

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

@stevemao
Copy link

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

@X-sam
Copy link
Author

X-sam commented Jan 29, 2019

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,
        },
      },

@stevemao
Copy link

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

@cht8687
Copy link
Owner

cht8687 commented Apr 23, 2019

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

@illiteratewriter
Copy link
Collaborator

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants