membrane 2022-04-03

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:

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

do you have the code that uses the text area?

it's on the original thread

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

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

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

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

how do you clean and compile?

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

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

sec I'm tidying to post to github

thanks by the way

👍 1

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

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

do you use npm?

fuck I hope this isn't something stupid sorry

I'm just not that familiar with the js ecosystem

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

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

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

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

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

that fixed it for me too

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

I'm so sorry

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

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

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

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.

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

focus is just about key events

I can type! so happy

🎉 1

mostly, but the canvas can still receive mouse events

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

what do you mean by "m" spam?

in the console?

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

so "mmmmmmmmmmmmmmmmm"

then I push delete once

and it stops and then just generally works

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

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

The m spam is very curious

If you refresh the page, does it happen again?

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

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

so weird it's just not doing it now

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

time for me to call it a night

ok, have a good night!