-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
[don't merge] Closure compiler #1409
Conversation
Well that sucks, thanks for trying! Maybe @gaearon also ran into this when switching to Closure Compiler in React? |
No, we didn’t run into these issues. Note we’re using a slightly older fork (see our Yarn lockfile). But the issue seems older than that (we had to fork for a different reason). Have you tried using the same exact options that we use? |
Same result with https://github.com/facebook/react/blob/master/scripts/rollup/build.js#L62 and permutations of these options (including My machine can build current master of React. I used version "1.0.6" of rollup plugin both in this PR and React master. |
Any chance you're accidentally processing unnecessary code? e.g. maybe it imports React itself by mistake. |
Build is passing when Which is when import, stylis const and return statement are removed from |
Huh, interesting! /cc @thysultan any ideas what's up with that? |
Looking at Stylis source, problem is present when any of
The lines that, if commented out, will allow Closure compiler to pass, are: |
Note sure, could be a bug with the JavaScript version of closure compiler since stylis works with both the basic and advanced mode of the Java version. @maciej-ka What do you mean by |
@thysultan, when building Styled Components with Stylis, it fails with error: This error is gone when Stylis import or few lines of Stylis code are commented out. They are listed in comment above. Trouble is happening in selector isolation mode. The irony is that this part of Stylis source is never used by Styled Components, because it's disabled by a setting (If this can be any help: with |
Closure compiler build will pass also if just this one line is commented out https://github.com/thysultan/stylis.js/blob/master/stylis.js#L469 |
Solid solving of this Closure Compiler issue is beyond my powers. But here is a little change in Stylis that has no impact on its logic and for a mysterious reason, it makes the build pass. thysultan/stylis#90 @thysultan |
Can you file a new issue against GCC with a reproducing minimal case? |
Minimal failing example is my dream here for some time. Maybe it will be possible to distill it from Stylis workaround. Another dream is to debug closure compiler but I have no idea how to even start that. |
@maciej-ka thanks for taking this one, wanted to start on it last week but saw you already took this one. 🎉 |
I don't plan to spend more time on extracting minimal repro from seven hundred parser Stylis function. I tried. My idea was to cut the code in binary search way, but it seems parts need each other to break closure compiler. I'm sending my ❤️ to anyone who would like to give this ticket some time. |
Just ran into this myself. Pretty bummed I have to choose between styled-components or GCC. :( |
@thysultan any chance to merge this temporary fix? I understand it's from your perspective a strange and unnecessary change in code, but it:
It's not uncommon to see such walkarounds in open source projects |
@maciej-ka any news on this PR? I'm open to landing it but has been inactive for a while. |
Closing due to inactivity and the codebase changing a lot for v4. Feel free to reimplement and open a new PR if there's interest |
#1360
Waits for:
JavaScript heap out of memory
and I never saw the result of this uglifier replace.