portal

Sam Ritchie 2023-06-08T18:20:56.994099Z

okay, working on the next library… @djblue any ideas here?

Thu Jun 08 12:18:38 MDT 2023 [worker-3] ERROR - POST /load
clojure.lang.ExceptionInfo: Unable to find node module: "dequal/lite" {:module "dequal/lite", :search-paths ("/Users/sritchie/code/clj/emmy-viewers/node_modules/leva/dist/node_modules" "/Users/sritchie/code/clj/emmy-viewers/node_modules/leva/node_modules" "/Users/sritchie/code/clj/emmy-viewers/node_modules/node_modules" "/Users/sritchie/code/clj/emmy-viewers/node_modules" "/Users/sritchie/code/clj/node_modules" "/Users/sritchie/code/node_modules" "/Users/sritchie/node_modules" "/Users/node_modules" "/node_modules")}
that folder does indeed exist:
(base) [sritchie@wintermute ~/code/clj/emmy-viewers (sritchie/leva)]$ ll node_modules/dequal/lite
total 32
drwxrwx---  6 sritchie  staff  192 Jun  1 07:27 .
drwxrwx---  8 sritchie  staff  256 Jun  1 07:27 ..
-rw-rw----  1 sritchie  staff   52 Jun  1 07:27 index.d.ts
-rw-rw----  1 sritchie  staff  802 Jun  1 07:27 index.js
-rw-rw----  1 sritchie  staff  658 Jun  1 07:27 index.min.js
-rw-rw----  1 sritchie  staff  784 Jun  1 07:27 index.mjs

Sam Ritchie 2023-06-08T18:25:56.587589Z

ah, the issue is that goog.object is not recognized…

Sam Ritchie 2023-06-08T18:39:50.921239Z

okay, even with that fixed I still have the error about not finding the node module

Sam Ritchie 2023-06-08T18:40:00.110479Z

@djblue maybe a resolution error from the nested package?

djblue 2023-06-08T19:01:50.187729Z

You are correct, I seem to have missed one of the many flavors of require 👌

djblue 2023-06-08T19:02:04.541269Z

require('dequal/lite/index.js') works

Sam Ritchie 2023-06-08T19:02:26.835249Z

unfortunately this require style is inside of ANOTHER npm dependency that I don’t control…

djblue 2023-06-08T19:03:52.766219Z

I think I have a fix, running tests real quick 👍

Sam Ritchie 2023-06-08T19:04:38.293839Z

@djblue and then trying to require mathbox gives me another error that I’ll have to track down:

Execution error (ExceptionInfo) at portal.runtime.jvm.launcher/eval-str (launcher.clj:124).
Cannot use import statement outside a module

djblue 2023-06-08T19:04:41.688989Z

https://github.com/djblue/portal/commit/955fd50f9bf32600a2bfd6183e8de84a509e44cb looks to fix it for me

Sam Ritchie 2023-06-08T19:04:46.075529Z

nice!!

Sam Ritchie 2023-06-08T19:05:09.237259Z

I’ll give that a go shortly, that should unlock https://leva.mentat.org/ for me.

Sam Ritchie 2023-06-08T19:05:36.501589Z

then I have to find where this import statement is? mathbox builds fine with cljs so I don’t THINK there are any invalid import statements…

Sam Ritchie 2023-06-08T19:05:51.937929Z

maybe there is something weird that webpack is understanding and resolving?

djblue 2023-06-08T19:06:42.760399Z

Yeah, I would expect most code in node_modules to use require 🤔 And the resolution algorithm is not looking for .mjs files

Sam Ritchie 2023-06-08T19:07:13.350149Z

I will save that for a more spacious day, and start at the bottom (maybe something in threejs?) and try and track down the error

Sam Ritchie 2023-06-08T19:07:29.847809Z

if we can get mathbox examples loading in portal like this…

Sam Ritchie 2023-06-08T19:07:42.605349Z

1
Sam Ritchie 2023-06-08T19:07:58.132729Z

haha nothing else will be close in the “visual REPL” world 🙂

Sam Ritchie 2023-06-08T19:08:46.779909Z

that little control panel will totally work,that’s what your fix enables. And if you have multiple tapped values , their controllers will stack up with headings, and only the relevant input controls will get erased when you erase a value

djblue 2023-06-08T19:10:18.735599Z

How would I go about trying this?

Sam Ritchie 2023-06-08T19:11:39.877109Z

setting you up, one sec

Sam Ritchie 2023-06-08T19:18:57.833809Z

@djblue oh to get the portal dependency up you’ll need both the :nextjournal/clerk and :portal profiles (obviously you have this part set up)

Sam Ritchie 2023-06-08T20:29:43.367279Z

@djblue totally works