Fork me on GitHub
#figwheel-main
<
2020-05-26
>
bhauman14:05:23

@gdanov I’m also available here if you want to talk more about the contains problem

jeff.terrell14:05:49

Sorry if this has been asked already, but I'm having issues with my Figwheel environment now that browsers don't send cross-origin cookies without the Secure attribute set.

jeff.terrell14:05:14

(And I'm running stuff on , not , so the Secure attribute is a no-go.)

jeff.terrell14:05:50

I have Figwheel serving my frontend and a backend running in a different process, listening on a different port, so I'm hitting the cross-origin cookie security policy.

jeff.terrell14:05:15

Here's an SO question I posted yesterday about this. Not about Figwheel per se, but about this issue: https://stackoverflow.com/questions/62013644/how-can-i-bypass-samesite-cookie-restrictions-in-my-development-environment

jeff.terrell14:05:00

I guess I need to either figure out how to use https on localhost or else bundle the frontend and backend together so that they appear to the browser to come from the same origin.

jeff.terrell14:05:07

Anyway, anybody figured this out for Figwheel yet?

bhauman14:05:29

@jeff.terrell hmm this is interesting

bhauman14:05:20

but the answer here is to have your backend serve your front end

jeff.terrell14:05:20

Yeah it was a real stumper for me last week. 😅

bhauman14:05:48

figwheel still runs on localhost to supply reload and repl connection

jeff.terrell14:05:21

Ah…like start Figwheel and keep it running, but actually access the site via the backend.

bhauman14:05:24

but you have to compile the files and serve the static files from your backend server

jeff.terrell14:05:47

OK. Any issues in that case with the cross-origin websocket connection that you know of?

jeff.terrell14:05:06

OK, fantastic. Thanks very much!

👍 4
dominicm14:05:21

You may need to configure your csp if you have one

dominicm14:05:34

Most secure defaults would block access to the Figwheel one

jeff.terrell14:05:29

I definitely read the "Your Own Server" page before. Is it recommending this approach, to actually load your page from the backend server? If so, I missed it. I thought it was saying that it was fine to load frontend from Figwheel and backend from a separate origin. Anyway…

jeff.terrell14:05:46

@dominicm - Gonna look into this CSP thing…thanks.

bhauman14:05:01

@jeff.terrell yeah I just re-read it, I’ll have to have another look at it. It creates a server that serves the whole application including that static assets but its all implicit.

👍 4
bhauman14:05:32

its definitely not making the point I want to make

jeff.terrell14:05:53

I'm relieved to hear you say that, so I'm not just missing it. simple_smile

bhauman14:05:33

@dominicm what to you mean by CSP?

bhauman14:05:59

cross site policy?

dominicm15:05:21

@bhauman yeah. You have to specify where connections are allowed to.

bhauman15:05:54

oh yeah coming back to me 🙂

mikerod16:05:57

Mistakenly posted to #lein-figwheel originally: when figwheel-main fails with a cljs compilation issue - it reports the logs with no stacktrace. is there anyway to get more? example: `[Figwheel:SEVERE] java.lang.IllegalArgumentException: Don't know how to create ISeq from: clojure.lang.Symbol` but no access to more of the stack

bhauman16:05:18

did you try :log-level :all ?

mikerod16:05:32

@bhauman trying it out - no, haven’t configured that option before

mikerod16:05:14

I got more output from it being set in other places - but still no stacktrace for the error or more info on the error

mikerod16:05:22

I know the error happens during macroexpansion while compiling cljs

bhauman16:05:40

is it the initial compile?

bhauman16:05:50

or in the watched compile?

bhauman16:05:22

it seems like the watched compile handles the stacktrace better

mikerod16:05:17

can’t compile - have some issue w/ macro

mikerod16:05:23

so trying to debug what that issue is

bhauman16:05:53

yeah that needs log information

bhauman16:05:02

let me check that out

bhauman16:05:42

but I probably wont have a look at it until tomorrow

mikerod16:05:46

that’s ok

mikerod16:05:49

I appreciate feedback

mikerod16:05:01

I’m trying to dig a bit via the figwheel scripting API

mikerod16:05:03

in the repl

bhauman16:05:07

@mikerod actually I found it

bhauman16:05:25

let’s see if I can get it in the 0.2.6 release

bhauman16:05:53

basically whenever I call log/error I need to call log/debug with a stacktrace

mikerod16:05:11

yes, that makes sense

bhauman16:05:08

I’m going to try and release 0.2.6 in the next half hour and it will include this

mikerod17:05:20

Very fast!

mikerod17:05:07

I’ll try it out though when it’s up

bhauman18:05:06

@mikerod its up and use :log-level :debug

pyrmont18:05:39

The new logo is kick ass.

👍 4
mikerod18:05:39

nice, I’ll try it out soon @bhauman thanks for quick turnaround

mikerod01:05:43

@bhauman I tried out the new version with debug logging and it gives me a lot more useful information. Awesome. Thanks again.

👍 4
bhauman19:05:29

@mike858 Thanks! spent the weekend starting to implement a new design from @lubovsoltan

bhauman21:05:14

figwheel-main 0.2.6 has been released this features a much nicer workflow for using NPM, I’ve started the docs for it here https://figwheel.org/docs/npm.html

👍 16
bhauman21:05:34

autotesting and extra-mains are supported

bhauman21:05:55

it logs the bundle command so that you can see when its happening

dominicm21:05:13

How frequently is it run now?

bhauman21:05:16

it runs once at the beginning, but if you set :bundle-once false it runs every time

bhauman21:05:28

I’m going to add smart bundling based on index.js and npm_deps.js file next and put it behind a flag

❤️ 4
👍 4
bhauman21:05:04

that should cover all the common cases

bhauman21:05:06

I’m also thinking of adding a figwheel option :auto-bundle :webpack to handle the most common case so that folks don’t have to configure anything really

bhauman21:05:39

@dominicm if you get a chance to use it let me know, any feedback is helpful

dominicm21:05:57

I'll probably set it up tomorrow

dominicm21:05:22

With that and install deps, I've got a pretty nice setup

bhauman21:05:48

yeah I’d like to see what you’ve set up

bhauman21:05:10

I’m really looking forward to the $ syntax as that really completes the story

athomasoriginal22:05:01

Just upgraded some non trivial projects to latest. Works great. Thanks, Bruce!

bhauman23:05:01

@tkjone awesome! Thanks!

athomasoriginal23:05:27

Let me know if you want anything tested 🙂

bhauman23:05:53

are you using the :output-to and :final-output-to helpers?

athomasoriginal23:05:38

No. I left what I had from the official webpack guide e.g. :output-to and :output-dir. Want me to check them out?

bhauman23:05:19

@tkjone yeah if you could give the new NPM guide a gander and check if its functionality works for you that would be great https://figwheel.org/docs/npm.html

👍 8
athomasoriginal23:05:13

Okay, ran through the Quickstart and then the Other stuffs and used the :output-to and :final-output-to helpers helpers. Sleek.

athomasoriginal23:05:41

Given my assumption is that the people using this are anywhere from early learners -> experienced developers these are some of the items I might enhance:

athomasoriginal23:05:53

Quickstart • Maybe because the title of the section is smaller, I did not immediately realize it was an official quick-start 😆 • If people are coming from the official webpack guide -> this guide they might trip up around the fact that they don’t have to specify the output-to and output-dir • Linked to the above bullet, I only realized after reading the Figwheel message in the command line that the file output by webpack is called main_bundle.js as opposed to main.js . This is partly from following the official guide and quickly adapting it to your guide. Maybe adding a quick note about the name of the file output in the quickstart section could be helpful :thinking_face: • The yellow comment block in the quickstart is super helpful, but I had to re-read it a few times to fully grok what I think is the suggestion: if you happened to have specified an :output-dir please make sure that :output-to is updated accordingly.