Fork me on GitHub
#membrane
<
2022-04-03
>
zimablue18:04:26

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:

zimablue18:04:28

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

phronmophobic18:04:17

do you have the code that uses the text area?

zimablue18:04:26

it's on the original thread

zimablue18:04:32

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

zimablue18:04:45

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

zimablue18:04:02

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

phronmophobic18:04:25

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

phronmophobic18:04:30

how do you clean and compile?

zimablue18:04:59

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

zimablue18:04:23

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

zimablue18:04:52

sec I'm tidying to post to github

zimablue18:04:32

thanks by the way

👍 1
zimablue19:04:09

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

phronmophobic19:04:05

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

zimablue19:04:40

do you use npm?

zimablue19:04:52

fuck I hope this isn't something stupid sorry

phronmophobic19:04:25

I'm just not that familiar with the js ecosystem

zimablue19:04:01

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

phronmophobic19:04:13

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

phronmophobic19:04:41

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

phronmophobic19:04:45

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

phronmophobic19:04:03

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

zimablue19:04:02

that fixed it for me too

zimablue19:04:26

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

zimablue19:04:28

I'm so sorry

zimablue19:04:52

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

phronmophobic19:04:21

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

zimablue19:04:55

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

phronmophobic19:04:37

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.

zimablue19:04:48

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

phronmophobic19:04:25

focus is just about key events

zimablue19:04:46

I can type! so happy

🎉 1
phronmophobic19:04:48

mostly, but the canvas can still receive mouse events

zimablue19:04:05

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

phronmophobic19:04:36

what do you mean by "m" spam?

phronmophobic19:04:38

in the console?

zimablue19:04:52

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

zimablue19:04:54

so "mmmmmmmmmmmmmmmmm"

zimablue19:04:59

then I push delete once

zimablue19:04:06

and it stops and then just generally works

zimablue19:04:41

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

phronmophobic19:04:59

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

phronmophobic19:04:30

The m spam is very curious

phronmophobic19:04:47

If you refresh the page, does it happen again?

zimablue19:04:06

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

zimablue19:04:35

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

zimablue19:04:05

so weird it's just not doing it now

zimablue19:04:10

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

zimablue19:04:14

time for me to call it a night

phronmophobic20:04:35

ok, have a good night!