This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-03-22
Channels
- # beginners (42)
- # boot (73)
- # cider (17)
- # clara (1)
- # cljs-dev (47)
- # cljsrn (9)
- # clojars (4)
- # clojure (241)
- # clojure-italy (11)
- # clojure-norway (5)
- # clojure-russia (93)
- # clojure-spec (28)
- # clojure-uk (32)
- # clojurescript (170)
- # core-async (20)
- # cursive (62)
- # data-science (2)
- # datomic (47)
- # dirac (4)
- # events (1)
- # funcool (12)
- # gsoc (1)
- # hoplon (59)
- # immutant (8)
- # lambdaisland (4)
- # luminus (3)
- # lumo (11)
- # off-topic (13)
- # om (81)
- # onyx (1)
- # pedestal (47)
- # planck (30)
- # re-frame (2)
- # reactive (1)
- # reagent (2)
- # ring-swagger (15)
- # rum (1)
- # slack-help (5)
- # specter (5)
- # testing (5)
- # uncomplicate (8)
- # untangled (16)
- # vim (71)
- # yada (16)
I thinks it is a google closure problem, just tried the following:
java -jar ~/bin/closure-compiler-v20170218.jar --module_resolution NODE --js src/libs/npm_stuff.js --js_output_file test.js --process_common_js_modules true
src/libs/npm_stuff.js:1: WARNING - Failed to load module "styled-components"
var Styled = require('styled-components');
^
src/libs/npm_stuff.js:1: WARNING - Failed to load module "styled-components"
var Styled = require('styled-components');
^
0 error(s), 2 warning(s)
This is a different error because it does not traverse node_modules ofcourse.. 😅
@mitchelkuijpers I'm giving a talk on ClojureWest about compiling node modules specifically going through the low level details of how it works.. Do you mind if I use the bug you've found as an example of why this is useful?
@spinningtopsofdoom that sounds like it’s gonna be an interesting talk 👍
Hopefully BTW I'm including you in my thanks for you post on Parameterizing ClojureScript Builds
😊 — were you giving a talk at bobconf in january btw?
Here's my BobKonf talk https://www.youtube.com/watch?v=Mep2ub5o44M&list=PLHvf3gk-RdgU8CUcxpFA-aq1nTeJ0njhF&index=4
Someone sent me a pic from that talk because you mentioned my porting of collection check to CLJS there… 🙂 Seeing it I pinged @U066UJ2KE again and it got merged… finally 😄
That's great now I don't have to have the extra hoop of locally installing your port of collection check 👍
@spinningtopsofdoom FWIW I recently tried using some module stuff too but ran into an issue with things being used before they got defined: https://github.com/martinklepsch/weekly-log has a repro and instructions. Did you stumble into anything like that during the research for your talk?
I haven't run into that yet. I can take a look when I get off of work. I've gotten my presentation in it's final format so I have time to look into all the fun edge cases with compiling node modules
I guess it would make sense to run through Closure without CLJS and see if the issue is still there but didn’t quite know how to do that until I saw Mitchel’s snippet above…
@spinningtopsofdoom No problem at all
@mitchelkuijpers ofc that's not gonna work
You need to include the entire paths
@martinklepsch did you try running that with Closure from master?
And this PR applied: https://github.com/google/closure-compiler/pull/2350
@anmonteiro Yeah i found that out, this was the first time playing with the google closure compiler
@anmonteiro yes tried with Chad’s branch
@mitchelkuijpers the interestig thing is that it works if you require supports-color
directly
Did not rebase it against master first I think though
So will need to look into that
@martinklepsch hrm might be better to try that first
Oh really? maybe it has something todo with the umd wrapping stuff or something..
But that is definitely interesting
@martinklepsch https://github.com/ChadKillingsworth/closure-compiler/commit/9e9f1abd86a594b27e10bbf723505ee517e192cc.patch
Apply that patch on current master with git am < /path/to/patch
and build again
If it still doesn't work make sure to ping me so I look into it on the weekend!
I cherry picked 9e9f1ab
into current master and rebuilt Closure. Same issue 😕 @anmonteiro
OK I’ll look into it soon!
<rant> people excited by a 1 KB drop in React, but most don’t acknowledge what Closure can do for them https://twitter.com/kentcdodds/status/844542288877539328 </rant>
This seems like the perfect reason for threading, since I'm not sure if I'm being sarcastic or serious. Is this legitimate excitement over 1kb improvement? Is there any possible way this can actually make a relevant difference to anything that actually should be using react?
well, read the rest of the thread and you’ll see they’re serious
has to parse less 20% JS
sure, but 20% of a small thing is even smaller, just like 20% of 0 is 0 🙂
I think they are doing such weird things in the JS community. They create mini libs like left-pad and then they bundle it with a bundler which adds god knows how many bytes and now they are focussing on making this smaller again...
There's an edit on the original comment (https://github.com/facebook/react/pull/9232#issuecomment-288398071), it's more like a 2% drop in real use. My guess is that it was the 20% that made them excited much more than the 1kb, which makes it seem a lot more of a rational thing to me - at least I hope that's the case at least!
And then they say GCC is not really important because 99% of their community don't use it and now they seem to work on creating GCC
Facebook is working on getting react ro compile with GCC for the new fiber build system
Oh nice
Yep @anmonteiro pointed this out to me https://github.com/facebook/react/issues/7925
I feel sorry for future new JS devs if they have to walk into a combination of GCC and all the JS build tools though...