figwheel-main

figwheel-main http://figwheel.org
mikejcusack 2021-03-05T10:37:38.011Z

Just wanted to report here that if you test out the current CLJS master it has goog.log changes, which break Figwheel Main. At the beginning it's complaining about the wrong number of arguments passed. It successfully compiled my app, including with the new npm require syntax, but when trying to recompile for hot load it hangs. And the behavior is the same without the new syntax.

👀 1
raspasov 2021-03-05T11:03:34.011200Z

Yes… relevant discussion here https://clojurians.slack.com/archives/C07UQ678E/p1614931049047500

mikejcusack 2021-03-05T12:58:39.011600Z

Well that's not a fix at all since the sole purpose of the new commit is to upgrade Closure. I forked the Figwheel repos and am messing with it. So far I have the log function calls fixed and now on the logger.setLevel error. I'm confused because the code is using ' at the end of vars and I've never seen that before (only single quote at the front).

raspasov 2021-03-05T13:10:57.012100Z

@mike.j.cusack single quote at the end usually is just part of the var name

raspasov 2021-03-05T13:12:01.012300Z

I typically use it/read it like “some var PRIME” (it’s some math notation thing, I believe)

mikejcusack 2021-03-05T13:12:35.012500Z

I'm confused because if you type foo' in a repl it fails

raspasov 2021-03-05T13:12:36.012700Z

Usually means that there’s some previous version of that var, typically called just “logger”, that was modified by the application of a function

raspasov 2021-03-05T13:13:09.012900Z

(let [y 1.223
      y' (int y)]
  y')

raspasov 2021-03-05T13:14:11.013100Z

In this case it’s just the logger’ local, nothing special about it

mikejcusack 2021-03-05T13:14:21.013300Z

Oh, ok. Never seen that before

mikejcusack 2021-03-05T13:14:37.013500Z

But in any case, the issue is they changed it. https://github.com/google/closure-library/blob/54b59276d091d411556ce845dda9d1a4947f1e4d/closure/goog/log/log.js#L891

raspasov 2021-03-05T13:14:59.013800Z

Notice that init-log-level! “builds” logger and “transforms” it into logger’

mikejcusack 2021-03-05T13:15:05.014Z

So should be (glog/setLevel logger' lvl)

raspasov 2021-03-05T13:16:46.014400Z

Yes…

mikejcusack 2021-03-05T13:18:27.014600Z

I fixed them

👍 1
mikejcusack 2021-03-05T13:19:28.014900Z

:figwheel {:extra-deps {com.bhauman/figwheel-core {:git/url "<https://github.com/MikeJCusack/figwheel-core>"
                                                   :sha "fb1aa3ea465e1b34aaa0b07065b7b0bca2c931c5"}
                        com.bhauman/figwheel-main {:git/url "<https://github.com/MikeJCusack/figwheel-main>"
                                                   :sha "9be32e51c72cab21a71b643c350474eec3b55a72"}
                        com.bhauman/figwheel-repl {:git/url "<https://github.com/MikeJCusack/figwheel-repl>"
                                                   :sha "b155e7631501f90921cf2a7505055fe2c937214c"}}}

raspasov 2021-03-05T13:19:49.015100Z

Very nice.

mikejcusack 2021-03-05T13:20:21.015300Z

Now, I set the exception to nil when figwheel wasn't working with an exception. I'm not sure if that's how Bruce would want it. But this works.

seancorfield 2021-03-05T16:42:29.015500Z

Are you going to submit PRs for those fixes @mike.j.cusack?

seancorfield 2021-03-05T16:43:08.015700Z

Or are you waiting to discuss with @bhauman first?

mikejcusack 2021-03-05T16:43:21.015900Z

Yeah, I was just waiting for him to chat before submitting.

1
seancorfield 2021-03-05T16:43:47.016100Z

(just curious since I'm "away" from cljs again right now but planning to come back and will be using Figwheel Main so this is something that would have completely confused me)

mikejcusack 2021-03-05T16:44:18.016400Z

Glad to have jumped on it then. I was hoping it would be helpful. 🙂

mikejcusack 2021-03-05T16:44:59.016600Z

Gotta love upstream making a breaking change 😄

seancorfield 2021-03-05T16:48:16.016800Z

SemVer is broken, remember 🙂

🎯 1