figwheel-main

figwheel-main http://figwheel.org
bhauman 2020-05-23T02:11:50.346200Z

@laheadle its a temlpate ๐Ÿ™‚

bhauman 2020-05-23T02:13:12.347400Z

that fills in :output-to with the :output-in options, and fills in :final-output-to with output-to + โ€œ_bundle.jsโ€

2020-05-23T02:17:08.347600Z

Can't seem to figure it out.

bhauman 2020-05-23T02:17:28.347800Z

oh you are trying to use it?

2020-05-23T02:17:41.347900Z

2020-05-23T02:17:55.348400Z

yes trying to pull in an npm module

bhauman 2020-05-23T02:18:49.349Z

@laheadle you skipped the :final-output-to after the โ€œ-oโ€

bhauman 2020-05-23T02:19:03.349300Z

you can try the command on the command line

2020-05-23T02:19:29.349700Z

doh

bhauman 2020-05-23T02:20:08.350300Z

trying the command on the command line after your initial compile is a good way to figure out any glitches in your set up

bhauman 2020-05-23T02:20:39.350800Z

I have to head out but Iโ€™ll be available tomorrow if you have more questions

2020-05-23T02:22:01.351600Z

ok. Not sure which command I should try from the command line. I am running from the command line: clj -m figwheel.main --build dev

2020-05-23T02:23:13.351700Z

2020-05-23T02:34:38.352200Z

oh maybe webpack from command line

2020-05-23T02:44:23.352400Z

ok fixed webpack a bit

2020-05-23T02:45:09.352500Z

2020-05-23T02:45:59.352800Z

2020-05-23T02:46:25.353300Z

still getting :bundle-cmd :none failed

2020-05-23T03:15:44.353700Z

Ok found an error with clj -m figwheel.main --build-once dev

2020-05-23T03:16:23.354200Z

my npm dep needed react in package.json. seems to be working now.

2020-05-23T03:25:55.354700Z

I see I don't need to make my own webpack.config.js

2020-05-23T11:17:07.355500Z

Ok I've made a lot of progress. Currently trying to figure out how to get figwheel to tell webpack to export React as a global on window, so rum can refer to it using js/React.

2020-05-23T11:39:23.357200Z

I cannot believe how good the figwheel docs are. Seriously, so good. So complete. A pleasure to read. Almost like they were written by a Fun driven developer or something.

1
bhauman 2020-05-23T12:20:15.357700Z

thanks!

bhauman 2020-05-23T12:20:43.358200Z

Yeah rum needs to change the way it imports react

bhauman 2020-05-23T12:21:05.358700Z

you can still use cljsjs/react in the meantime to support rum

bhauman 2020-05-23T12:21:33.359300Z

or you can set! window[โ€œReactโ€] = react

bhauman 2020-05-23T12:22:28.359500Z

@laheadle ^

bhauman 2020-05-23T12:22:29.359700Z

https://github.com/tonsky/rum/issues/211

bhauman 2020-05-23T12:23:49.360500Z

I have yet to update the docs on using npm modules and webpack

2020-05-23T14:54:19.360800Z

Ok I am up and running. Thanks a million @bhauman

bhauman 2020-05-23T14:54:33.361100Z

cool did you update an older project?

bhauman 2020-05-23T14:54:40.361300Z

@laheadle ^

2020-05-23T14:55:13.361700Z

Yeah, I had a small one I started a few months ago.

bhauman 2020-05-23T14:56:01.362600Z

This should improve the workflow

bhauman 2020-05-23T14:56:49.363700Z

you can now just do npm add lib and use it

2020-05-23T14:57:11.364100Z

absolutely. 3rd party react hooks ecosystem is spread out before us like a buffet.

bhauman 2020-05-23T14:57:20.364300Z

๐Ÿ™‚

bhauman 2020-05-23T14:58:05.365300Z

also another thing you can do is run webpack on the command line with the -w flag after figwheel has launched

2020-05-23T14:58:43.366400Z

does figwheel create a webpack.config.js?

bhauman 2020-05-23T14:58:47.366600Z

no

bhauman 2020-05-23T14:59:19.367400Z

one isnโ€™t needed if you are doing simple things

2020-05-23T14:59:33.367700Z

gotcha

Jp Soares 2020-05-23T15:40:05.371800Z

I'm using firebase importing the npm package, this is what I have in index.js

import * as firebase from 'firebase/app';                                          
import "firebase/analytics";                                                       
import 'firebase/auth';                                                            
import 'firebase/database';                                                        
window["firebase"] = firebase;
When I run the following code in advanced compilation I get an error saying firebase.database is not a function (actually YG.pi is not a function because the names were minified)
(ns myapp.firebase                                                                 
  (:require                                                                        
    [firebase]                                                                     
    ))

(def firebase-db                                                                   
  (do                                                                              
    (when (= 0 (some-> firebase .-apps .-length))                                  
      (-> firebase (.initializeApp firebase-config)))                              
    (-> firebase (.database)))) 
I'm thinking it might be because of the way I'm importing firebase. Any suggestions?

bhauman 2020-05-23T18:13:37.372500Z

@jpsoares106 yeah this is an externs problem

bhauman 2020-05-23T18:16:02.373400Z

The good news is that this may be fixed with the new npm support in ClojureScript

bhauman 2020-05-23T18:17:54.374400Z

Iโ€™m intending to write a tutorial on how to use these new features on Monday

34๐ŸŽ‰
athomasoriginal 2020-05-23T20:29:28.376300Z

ha did you just push a change to the 0.2.6 snapshot, bruce? Seemed to fix a console warning about :after-hook not being found :thinking_face: ๐ŸŽ‰

bhauman 2020-05-23T21:39:32.377300Z

I did but I donโ€™t know what would have caused that