cljs-dev

ClojureScript compiler & std lib dev, https://clojurescript.org/community/dev
dnolen 2020-05-01T18:17:47.186900Z

I haven't heard much since last weekend's release issues, anything I missed that should go into a bugfix release?

lilactown 2020-05-01T18:22:55.189400Z

haven’t had the chance to play with the :bundle target in depth yet, but to respond to the above re: the guide, I think that tekacs was reading the guide step by step and didn’t understand the state they were in would be remedied by executing the next step. I am puzzled why :bundle creates a main.js or the cljs http server serves a main.js if one isn’t there, let alone why it appears to be in such a broken state (it contains clearly invalid JS)

lilactown 2020-05-01T18:23:43.190100Z

might not be worth fixing atm, since the happy path does work once we figured it out

dnolen 2020-05-01T18:26:32.190700Z

@lilactown :bundle doesn't create anything itself, it respects :output-to like all other targets

dnolen 2020-05-01T18:27:33.191400Z

the browser REPL attempts to serve main.js if it exists

dnolen 2020-05-01T18:29:22.191900Z

so I'm really still not clear on what the problem was

dnolen 2020-05-01T18:30:10.192200Z

other than something lacking clarity in the guide

lilactown 2020-05-01T18:31:01.192600Z

it appeared to be serving a main.js that did not exist on disk

dnolen 2020-05-01T18:39:28.193Z

I don't understand

dnolen 2020-05-01T18:39:32.193200Z

how could the next step fix it?

dnolen 2020-05-01T18:40:21.193600Z

maybe pointing to the specific part of the guide where this happens would shed some light

dnolen 2020-05-01T18:40:30.193900Z

I just copy and paste the steps when I do it and it works

dnolen 2020-05-01T18:40:36.194200Z

so something must have happened out of order

lilactown 2020-05-01T18:44:44.195300Z

the user setup a cljs build with target :bundle, but did not try to bundle it in any way with a JS bundler yet

lilactown 2020-05-01T18:45:22.195900Z

they ran a CLJS REPL and navigated to localhost:9000 and get a broken main.js

dnolen 2020-05-01T18:45:34.196700Z

so they didn't follow the tutorial

dnolen 2020-05-01T18:45:37.197Z

there's nothing to do here

lilactown 2020-05-01T18:45:39.197100Z

bundling the code with parcel or webpack to generate a main.js on disk fixed it

dnolen 2020-05-01T18:46:12.197800Z

they never generated main.js

dnolen 2020-05-01T18:46:22.198200Z

the browser repl couldn't find it

dnolen 2020-05-01T18:46:26.198500Z

nothing is going to work

dnolen 2020-05-01T18:46:32.198800Z

the order of the tutorial prevents this

lilactown 2020-05-01T18:46:56.199200Z

😄 if you see no issue here, then I’ll drop it. I think the user had an expectation to follow the guide step by step and when they got into a broken state, instead of continuing they tried to understand the broken state.

lilactown 2020-05-01T18:47:17.199700Z

serving a broken main.js if one isn’t on disk seems weird, but if you see no issue then I won’t pursue further

dnolen 2020-05-01T18:49:23.201Z

@lilactown there's just lack information in nearly everything that has been said so far 🙂

2020-05-01T18:49:25.201200Z

Yup it’s the latter that’s a concern more than anything else @dnolen

dnolen 2020-05-01T18:49:30.201500Z

so I can't help if I don't understand

2020-05-01T18:49:49.202400Z

So — if you don’t run the bundler, it serves a main.js even if there’s not one on disk

2020-05-01T18:49:56.203Z

Seemingly one that’s generated on the fly?

dnolen 2020-05-01T18:50:07.203400Z

but what does "broken" mean here?

2020-05-01T18:50:31.204200Z

Broken in the way I outlined in the original thread — it has incorrectly generated JS syntax in it

dnolen 2020-05-01T18:51:19.205800Z

ah k

2020-05-01T18:51:44.206700Z

I appreciate that you’re told to run the bundler first, but if (like me) you’re trying to adapt the tutorial for another bundler and it fails to generate main.js, you’re going to be fairly confused when the server ‘correctly’ serves a main.js when there’s none on disk... only one that’s broken

dnolen 2020-05-01T18:52:42.208200Z

so I found the bug in browser REPL and that is fixed

dnolen 2020-05-01T18:52:55.208900Z

but that not going to help w/ any confusion about :bundle and browser REPL

dnolen 2020-05-01T18:53:04.209300Z

since they are in fact independent features

2020-05-01T18:53:30.210500Z

If it served a 404 that’d be amazing — or even a working (but not the bundled) file.

dnolen 2020-05-01T18:53:34.210700Z

browser REPL generates a main.js if none found so you can use the browser REPL anywhere you want

dnolen 2020-05-01T18:53:48.211400Z

@tekacs what I just said makes that undesirable

dnolen 2020-05-01T18:54:08.211800Z

you don't need a project to start browser REPL

dnolen 2020-05-01T18:54:12.212Z

or any source files at all

dnolen 2020-05-01T18:54:16.212300Z

just like the Node REPL

2020-05-01T18:54:31.212800Z

Yup that makes total sense — I think even this is less confusing

2020-05-01T18:54:45.213500Z

If it weren’t broken then you could continue without feeling that something is blocking

dnolen 2020-05-01T18:55:08.214600Z

for sure, thanks for bringing up again @lilactown and being patient with my confusion about what was going on

❤️ 2
2020-05-01T18:55:14.214900Z

Thank you for fixing that!

2020-05-01T18:55:50.215300Z

When I saw invalid generated JS I thought I was going crazy :)

dnolen 2020-05-01T19:05:27.215700Z

Building 1.10.753 now

dnolen 2020-05-01T19:17:55.216300Z

feel free to give it a spin when it appears, if I don't hear anything bad over the weekend will put together an announce post

👍 1