pyzaist
Deno, TypeScript, ESBuild, WebGL, VSCode
from a user perspective, i will still say that it is unfortunate that i would have to write
with { type: "string" }
after every GLSL (or CSS, or HTML, or whatever plaintext file i would use) import i do, instead of specify in one place that GLSL files should always be imported in this way.
for my use case this is totally fine, but just providing signal to you all for how i would anticipate larger projects would prefer to engage with this topic30 replies
Deno, TypeScript, ESBuild, WebGL, VSCode
until the new import method is available as you mentioned above, im leaning towards having a pre-build step that takes these two files im working in and generating a ts file that outputs the contents as a string. i think thatll do fine for a quick solution. and this is a small hobby project, so it doesnt need to be completely ideal
30 replies
Deno, TypeScript, ESBuild, WebGL, VSCode
hmmmmm okay i was going to ask why the plan is not to replicate how typescript does this as i discussed above, but i think im starting to get it.
in the non-deno case, there is a loader/bundler that takes all my TS and plaintext imports and handles the actual turning it into runnable JS code.
however in the deno case, TS is the native language, so it needs to be able to run the code without all this. so it cant simply say "this file will be a string" to satisfy the type system, it needs to know what particular string it will be.
is that getting at the right explanation?
30 replies
Deno, TypeScript, ESBuild, WebGL, VSCode
issue from a long time ago that discusses this: https://github.com/Microsoft/TypeScript/issues/2709
30 replies
Deno, TypeScript, ESBuild, WebGL, VSCode
hmm okay so im checking this out today. it appears that 1) webGPU is not widely supported yet (https://caniuse.com/webgpu) but likely will be soon and 2) even if it was, i would have the same problem with WGSL as i do with GLSL - so it doesnt really benefit me to use it
30 replies
Deno, TypeScript, ESBuild, WebGL, VSCode
Yeah I currently have a .ts file with a single import of a string, but there’s a few sad things about this: 1) it treats glsl code as second class rather than first class, and more tangibly 2) it doesn’t allow syntax highlighting in vs code
30 replies
Deno, TypeScript, ESBuild, WebGL, VSCode
https://docs.deno.com/runtime/manual/advanced/typescript/types#using-a-configuration-file
^ relevant docs for deno
30 replies