Fork me on GitHub
#squint
<
2023-12-21
>
Steve Huffman00:12:25

I’m trying to use (condp) but getting a js error about _EQ_ not being defined. I see there is a _EQ_ in cherry but not in squint

borkdude07:12:42

Can you make a repro + issue?

borkdude07:12:23

Why not just use case in this case then? You can work around this by defining = yourself for now, it doesn’t exist as a var in squint yet. GitHub issue welcome

borkdude10:12:26

already fixed on main

Panel08:12:49

I think a stumble upon a way yo escape hatch down to JavaScript from squint cljs. Is this a thing ?

borkdude08:12:20

(js* "escape ~{}" hatch)

Panel13:12:13

Is it currently possible to use “simple” cljs deps with squint ? If the library doesn’t use feature not available in squint they should be able to work ?

borkdude13:12:46

yes, but there is no dependency management thingie in place, so for now you have to copy those sources

👍 1
borkdude13:12:27

what you can do (and what is done for #C029PTWD3HR) is that you could create an uberjar for your dependencies and then unzip this to a directory and add this directory to your :paths in squint.edn

borkdude13:12:10

bb --config my_deps.edn uberjar my_dependencies.jar 
should do that, if you have #CLX41ASCS installed

Panel14:12:35

Who doesn’t have bb installed? 😯 Thanks I’ll try

ccfontes13:12:10

How do I install reagent to use with squint? Came across the only mention in squint repo: https://github.com/squint-cljs/squint/blob/main/test/squint/clerk.clj#L24 I wonder where it comes from. Thanks.

ccfontes13:12:55

really wanted to use squint in a project more interop demanding, but seems I have to copy the sources for deps.. hmm I'll give it a try to cherry in the meantime, no biggie 👍

borkdude13:12:30

you can't use reagent with squint. instead, just use react directly

👍 1
borkdude13:12:58

I don't remember what this file is doing in the squint repo, probably an experiment

borkdude13:12:03

I'll delete it

👍 1
borkdude14:12:28

ah yeah I remember, it's an experiment to use squint in a clerk notebook

👍 1
ccfontes14:12:30

Got it. I'll do the jsx thing too. Sounds fun.

borkdude14:12:05

check out the https://github.com/squint-cljs/squint/tree/main/examples/vite-react example, vite is the missing piece for hot-reloading with front-end development for squint

👍 1
ccfontes14:12:34

Nice, thank you for showing to me. tbh, I never really needed hot-reloading. just reloading is fine. Not even a REPL is a must have. As long as I don't have to see javascript code or wait a gazillion time for something to build, I'm happy.

borkdude14:12:14

you mean you refresh the browser?

borkdude14:12:23

you'll be so glad you've used vite, trust me :)

👀 1
ccfontes18:12:57

Btw, followed the tutorial and getting this:

> bb dev
[squint] Watching paths: src
[squint] Compiling CLJS file: src/app.cljs
[squint] Wrote file: /home/c/proj/front/public/js/app.jsx
[squint] Copying resource src/home.clj to /home/c/proj/front/public/js
The CJS build of Vite's Node API is deprecated. See  for more details.
failed to load config from /home/c/proj/front/viteconfig.js
error when starting dev server:
Error: Cannot find module '@vitejs/plugin-react'
Require stack:
- /home/c/proj/front/viteconfig.js
- /home/c/proj/front/node_modules/vite/dist/node/chunks/dep-R0I0XnyH.js
Running node v21.4.0
cat package.json
{
  "name": "front",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "dependencies": {
    "react-dom": "^18.2.0",
    "squint-cljs": "^0.4.85"
  },
  "devDependencies": {
    "vite": "^5.0.10"
  }
}
Had to manually install @vitejs/plugin-react:
npm install --save-dev @vitejs/plugin-react
but still getting the deprecated warning:
bb dev
[squint] Watching paths: src
[squint] Compiling CLJS file: src/app.cljs
[squint] Wrote file: /home/c/proj/front/public/js/app.jsx
[squint] Copying resource src/home.clj to /home/c/proj/front/public/js
The CJS build of Vite's Node API is deprecated. See  for more details.

  VITE v5.0.10  ready in 430 ms

  ➜  Local:   
  ➜  Network: use --host to expose
  ➜  press h + enter to show help
To clear the warning, added "type": "module" to package.json:
{
  "name": "front",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "type": "module",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "dependencies": {
    "react-dom": "^18.2.0",
    "squint-cljs": "^0.4.85"
  },
  "devDependencies": {
    "@vitejs/plugin-react": "^4.2.1",
    "vite": "^5.0.10"
  }
}