pyzaist
pyzaist
DDeno
Created by pyzaist on 12/22/2023 in #help
Deno, TypeScript, ESBuild, WebGL, VSCode
Hello! As the title suggests, I am using these technologies to create a web application: * Deno * TypeScript * ESBuild * WebGL (which uses .glsl shader files) * VSCode My goal is to have a .ts file be able to import a .glsl file as a string, and for there to be no errors or warnings about this in VSCode. This is a very common workflow for frontend development involving WebGL. My understanding is that I need to create a modules.d.ts file at the root of my project that looks like so:
declare module "*.glsl" {
const value: string;
export default value;
}
declare module "*.glsl" {
const value: string;
export default value;
}
and then have Deno use it by having deno.json have a line like so:
{
"compilerOptions": {
"types": ["modules.d.ts"]
}
}
{
"compilerOptions": {
"types": ["modules.d.ts"]
}
}
I believe that this is all that should be needed to have any .ts file be able to import any .glsl as a string like so:
import fragmentShaderSource from "./fragmentShader.glsl";
import vertexShaderSource from "./vertexShader.glsl";
import fragmentShaderSource from "./fragmentShader.glsl";
import vertexShaderSource from "./vertexShader.glsl";
It appears that this actually works with ESBuild and the glsl plugin. However, in VSCode I am getting errors on the above import lines like so: Module '"file:///<root path of my project>/fragmentShader.glsl"' has no default export So what I am doing wrong here, and how can I get VSCode to be happy?
30 replies
DDeno
Created by pyzaist on 9/9/2023 in #help
WebSocket connections killing setInterval()
Hey Deno friends, it appears that websocket connections are somehow stopping the execution of setInterval(). I filed an issue about this here, two months ago: https://github.com/denoland/deno/issues/19707 Should I expect to get a resolution on this? Thanks!
5 replies
DDeno
Created by pyzaist on 5/3/2023 in #help
Standard setup of a monorepo that includes frontend and backend TypeScript code for one app
Hello friends, I'm new to Deno and have what I feel is a relatively simple use case, but I've struggled to find good guidance about it. My repo is here: https://github.com/timschwab/chesswar. Nothing too fancy, messing about with WebSockets and <canvas>. I used to have two repos - one for the backend server and one for the frontend server. But I decided to just join them into one repo, so I could trivially share some code and types between the server code and the client code. However this means that the VSCode workspace includes both Deno server code and frontend TypeScript, and so I don't know the right way to set target and lib. Does this make sense? Any help appreciated. Thanks!
10 replies