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

Workaround of Closure Compiler problem #90

Conversation

maciej-ka
Copy link
Contributor

Related to styled-components/styled-components#1409

This is a workaround for a weird behavior of Closure Compiler, which is failing to minify Styled Components.

I don't know why this small move of variable helps. This PR is a result of experiments with commenting out fragments and trying different changes that have no effect on the logic of Stylis. Hopefully, Closure Compiler devs will figure out the root problem.

@maciej-ka maciej-ka force-pushed the walkaround-for-closure-compiler-problem branch from 341b995 to ed9318b Compare January 10, 2018 16:46
@thysultan
Copy link
Owner

Can you open an issue with Closure Compiler so they know about this problem. It would be preferable to land a patch there.

@maciej-ka
Copy link
Contributor Author

The issue is already there: google/closure-compiler-js#23.

@thysultan
Copy link
Owner

I'm hesitant to introduce this workaround. The best course of action would be to open a new issue specific to this problem with Closure Compiler.

A minimal repro might entail some small module using stylis, and see if the above still registers as a workaround – this might help narrow down where the problem is in GCC.

@wardpeet
Copy link

@maciej-ka any idea why this fixes it? If so I could have a look at closure compiler source and poke some people about it.

@maciej-ka
Copy link
Contributor Author

No idea why this fix is working.

I don't plan to spend more time on this. It took hours to blindly guess this fix and extracting minimal repro from seven hundred lines parser function makes my corporate work look interesting.

It's hard to say that and I don't mean to be rude. I hope honest statement is better here than giving an impression that progress is on the way.

@thysultan
Copy link
Owner

@maciej-ka Are you able to create a reproduction of the issue with only stylis as a dependency?

@thysultan thysultan closed this Jun 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants