membrane

zimablue 2022-04-03T18:30:26.165029Z

Hey coming back to this https://clojurians.slack.com/archives/CVB8K7V50/p1646659055749079 I still can't get it to work, tried a clean project with shadow-cljs, when I use this kind of dep in deps.edn:

zimablue 2022-04-03T18:35:28.060289Z

com.phronemophobic/membrane {:mvn/version "0.9.31.5-beta"} I get this build error: (resolve-sci-meta first-form) Use of undeclared Var membrane.component/resolve-sci-meta Which skimming the code doesn't make sense because it should be defined under a :default clause. When I depend it like this: com.phronemophobic/membrane {:local/root ../membrane_latest"} It builds, but then the textarea fails to work for me in the way described in the previous thread, it pops up with the right text but the text then doesn't update when typing. I'll try and dig into this tomorrow but thought I'd post in case you knew an obvious cause

phronmophobic 2022-04-03T18:37:17.937419Z

do you have the code that uses the text area?

zimablue 2022-04-03T18:37:26.129029Z

it's on the original thread

zimablue 2022-04-03T18:37:32.033409Z

it works for you so it's a build or version problem

zimablue 2022-04-03T18:37:45.624519Z

i'm using electron but it also failed in chrome I tried that

zimablue 2022-04-03T18:40:02.225229Z

maybe if you post how you have it configured? like deps.edn, shadow-cljs I guess?

phronmophobic 2022-04-03T18:40:25.012859Z

yea, if you post the project, I can try that as well

phronmophobic 2022-04-03T18:40:30.190979Z

how do you clean and compile?

zimablue 2022-04-03T18:42:59.372619Z

delete .shadow-cljs and .cpcache and anything in the public folder and run shadow-cljs watch app

zimablue 2022-04-03T18:43:23.835599Z

anything in the public folder other than the html and js permanent bits

zimablue 2022-04-03T18:43:52.621819Z

sec I'm tidying to post to github

zimablue 2022-04-03T18:46:32.498279Z

thanks by the way

👍 1
zimablue 2022-04-03T18:59:34.191959Z

https://github.com/FalseProtagonist/test_proj

zimablue 2022-04-03T19:00:09.140199Z

that should work and just "yarn" "shadow-cljs watch backend" "shadow-cljs watch app" "yarn start" in different terminals I think

phronmophobic 2022-04-03T19:05:05.970759Z

I'm not familiar with yarn, but I'll give it a try

zimablue 2022-04-03T19:05:40.208159Z

do you use npm?

zimablue 2022-04-03T19:05:52.803259Z

fuck I hope this isn't something stupid sorry

phronmophobic 2022-04-03T19:14:25.059009Z

I'm just not that familiar with the js ecosystem

zimablue 2022-04-03T19:15:01.337439Z

the breadth of technologies you've built as a possible membrane backend is impressive

phronmophobic 2022-04-03T19:15:13.170119Z

The canvas needs to have tabindex="0" as an attribute.

phronmophobic 2022-04-03T19:15:41.118069Z

When I update public/index.html to :


<html>
  <head>
    <meta charset="UTF-8">
    <!--  -->
    <!-- <meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self'">
    <meta http-equiv="X-Content-Security-Policy" content="default-src 'self'; script-src 'self'"> -->
    <title>tab</title>
  </head>
  <body>
    <canvas tabindex="0" id="canvas" height="900px" width="1600px"></canvas>
  </body>
  <script src="assets/app/js/main.js"></script>
  <!-- <script src="assets/app/js/make_alert.js"></script> -->
</html>
It seems to work

phronmophobic 2022-04-03T19:16:45.871219Z

<canvas tabindex="0" id="canvas" height="900px" width="1600px"></canvas>
Adding tabindex="0" being the only change

phronmophobic 2022-04-03T19:18:03.233729Z

There's a note about it in the https://github.com/phronmophobic/membrane/blob/master/docs/webgl.md#hello-world doc, but it's very easy to miss. I should probably add a warning or something in membrane.webgl/run

zimablue 2022-04-03T19:20:02.674259Z

that fixed it for me too

zimablue 2022-04-03T19:20:26.414299Z

actually I now have a very strange bug where once I click into the window it spams "m"s but once I click delete once it works

zimablue 2022-04-03T19:20:28.849709Z

I'm so sorry

zimablue 2022-04-03T19:20:52.027549Z

the tabindex=0 thing rings a bell, I dunno if I pulled this code from some sample code somewhere

zimablue 2022-04-03T19:20:53.134889Z

thank you

phronmophobic 2022-04-03T19:24:21.979879Z

no problem! I'm going to add a warning to membrane.webgl/run so that it's easier to identify the problem.

zimablue 2022-04-03T19:24:37.243879Z

thank you

zimablue 2022-04-03T19:24:55.327829Z

I thought it would be versioning because lots of other stuff in webgl is working just not that

phronmophobic 2022-04-03T19:25:37.350269Z

I don't want to have membrane.webgl/run add the tabindex property automatically since there are legitimate use cases for not caring about key events and not wanting the canvas to accept focus.

zimablue 2022-04-03T19:26:48.648269Z

any idea re the "m" spam? I guess I should css out the orange border for the canvas focus, weird that buttons were working without focus

phronmophobic 2022-04-03T19:27:25.635189Z

focus is just about key events

zimablue 2022-04-03T19:27:46.740709Z

I can type! so happy

🎉 1
phronmophobic 2022-04-03T19:27:48.006889Z

mostly, but the canvas can still receive mouse events

zimablue 2022-04-03T19:28:05.555519Z

this didn't work and then I went to work on other parts of my project and just came back

phronmophobic 2022-04-03T19:28:36.023849Z

what do you mean by "m" spam?

phronmophobic 2022-04-03T19:28:38.587659Z

in the console?

zimablue 2022-04-03T19:28:52.841059Z

when I click into the textarea, it acts as if I have the "m" button held down

zimablue 2022-04-03T19:28:54.883249Z

so "mmmmmmmmmmmmmmmmm"

zimablue 2022-04-03T19:28:59.059579Z

then I push delete once

zimablue 2022-04-03T19:29:06.116649Z

and it stops and then just generally works

zimablue 2022-04-03T19:29:41.870439Z

sorry for missing something that was already in the docs re tabindex

phronmophobic 2022-04-03T19:29:59.113359Z

no worries at all. It's very easy to miss.

phronmophobic 2022-04-03T19:30:30.116449Z

The m spam is very curious

phronmophobic 2022-04-03T19:30:47.439349Z

If you refresh the page, does it happen again?

zimablue 2022-04-03T19:32:06.485119Z

it's now just totally stopped even on killing and relaunching the app

zimablue 2022-04-03T19:32:35.152229Z

this might be an issue that I'm running electron through windows WSL2 in the fake windows-linux thing

zimablue 2022-04-03T19:33:05.403349Z

so weird it's just not doing it now

zimablue 2022-04-03T19:34:10.344889Z

it happened over again several times with that behavior so it's not something quite as stupid as me actually holding down m but now it's ghosted away

zimablue 2022-04-03T19:34:14.660039Z

time for me to call it a night

phronmophobic 2022-04-03T20:20:35.696439Z

ok, have a good night!