Fork me on GitHub
#figwheel-main
<
2020-05-23
>
bhauman02:05:50

@laheadle its a temlpate 🙂

bhauman02:05:12

that fills in :output-to with the :output-in options, and fills in :final-output-to with output-to + “_bundle.js”

Lyn Headley02:05:08

Can't seem to figure it out.

bhauman02:05:28

oh you are trying to use it?

Lyn Headley02:05:55

yes trying to pull in an npm module

bhauman02:05:49

@laheadle you skipped the :final-output-to after the “-o”

bhauman02:05:03

you can try the command on the command line

bhauman02:05:08

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

bhauman02:05:39

I have to head out but I’ll be available tomorrow if you have more questions

Lyn Headley02:05:01

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

Lyn Headley02:05:38

oh maybe webpack from command line

Lyn Headley02:05:23

ok fixed webpack a bit

Lyn Headley02:05:25

still getting :bundle-cmd :none failed

Lyn Headley03:05:44

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

Lyn Headley03:05:23

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

Lyn Headley03:05:55

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

Lyn Headley11:05:07

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.

Lyn Headley11:05:23

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.

4
bhauman12:05:43

Yeah rum needs to change the way it imports react

bhauman12:05:05

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

bhauman12:05:33

or you can set! window[“React”] = react

bhauman12:05:49

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

Lyn Headley14:05:19

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

bhauman14:05:33

cool did you update an older project?

Lyn Headley14:05:13

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

bhauman14:05:01

This should improve the workflow

bhauman14:05:49

you can now just do npm add lib and use it

Lyn Headley14:05:11

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

bhauman14:05:05

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

Lyn Headley14:05:43

does figwheel create a webpack.config.js?

bhauman14:05:19

one isn’t needed if you are doing simple things

Jp Soares15:05:05

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?

bhauman18:05:37

@jpsoares106 yeah this is an externs problem

bhauman18:05:02

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

bhauman18:05:54

I’m intending to write a tutorial on how to use these new features on Monday

12
🎉 16
athomasoriginal20:05:28

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: 🎉

bhauman21:05:32

I did but I don’t know what would have caused that