qdot / syncydink

A web based video player that supports multiple viewing modes, haptic formats, and output devices
http://buttplug.world/syncydink
BSD 3-Clause "New" or "Revised" License
21 stars 20 forks source link

Compiler Error with strictNullChecks #81

Closed greenyouse closed 3 years ago

greenyouse commented 3 years ago

Hi, I was going to try to help knock out some of the easier issues but I ran into an error compiling the project with a fresh clone. It looks like some functions are being passed nullable types which break due to the strictNullChecks flag which doesn't allow for null or undefined.

These are the parts with the errors:

https://github.com/metafetish/syncydink/blob/master/src/components/VideoEncoder/VideoEncoder.ts#L122-L123 https://github.com/metafetish/syncydink/blob/master/src/components/VideoEncoder/VideoEncoder.ts#L236-L237 https://github.com/metafetish/syncydink/blob/master/src/components/VideoEncoder/VideoEncoder.ts#L250-L251 https://github.com/metafetish/syncydink/blob/master/src/components/VideoEncoder/VideoEncoder.ts#L275

It looks like they're all referencing d3 scale types but those get set with ! so they shouldn't be nullable.

https://github.com/metafetish/syncydink/blob/master/src/components/VideoEncoder/VideoEncoder.ts#L12-L14

I'm not sure what exactly the problem is. I'm pretty new to TypeScript. Any idea what could be going on?

qdot commented 3 years ago

Hahahaha holy shit. Welcome to hell.

So, here's where things currently are:

The D3 part is by far the most complicated, I have zero memory of how D3 works at this point so that's gonna be an uphill climb to identify and fix. But I'll see about taking a look at it.

Also, if you're gonna dig into this, avoid touching anything having to do with actually accessing Buttplug. All of that is getting ripped out and reworked in the next couple of weeks as I move this project from buttplug-js to buttplug-wasm.

The drag/drop PR stuff should be fine though, I think. I'm considering maaaaaybe changing the UI to something more resembling the container overlay that Playground (https://playground.buttplug.world) uses because the side menu is just nothing but problems due to z-levels and cursor contexts, but that should be portable. Still haven't decided yet.

Also also: if you wanna ask me questions in real time, it's best to join the discord: https://discord.buttplug.io

greenyouse commented 3 years ago

Oh this was totally one of those pebcak kind of problems haha. I was using npm instead of yarn :facepalm: Everything just worked with yarn so this issue should be good to close.

This app does so much stuff but I have no clue how the D3 part works. It's pretty far along so maybe it could be refactored or something? It has loads of stuff working so it's super tempting to just keep going with it.

I like the modal on the buttplug playground page. It doesn't seem like it'd be too hard to change the side menu to do that (famous last words).