fero.xd
Explore posts from serversTTCTheo's Typesafe Cult
•Created by fero.xd on 5/3/2024 in #questions
Weird react behaviour
I am rendering a element for every item inside of Root's children array, in that element i have a state to open or close the item (if its a dir). When someone opens a directory , i render a Nested Component that uses react query to fetch the contents of that directory and render them, and the nested component again renders the item (recursion goes on). This works fine in itself but when i have a zustand store that stores the current file and directory opened, the tree behaves in a very weird way.. the folders wont open even after multiple clicks and will randomly open on another click.
It seems like updating states is fine but when the component is re rendering coz of the state change, then its causing issues
https://pastebin.com/eJvbiirr
6 replies
TTCTheo's Typesafe Cult
•Created by fero.xd on 4/29/2024 in #questions
Bundle type defs for a package in node_modules
I want to send type definitions for a package that is present in my node_modules folder to the frontend so that i can use it with monaco editor. The problem is how can i bundle all the types of the module into a single file. Sometimes a package has external type dependencies too, how can i handle that.
3 replies
TTCTheo's Typesafe Cult
•Created by fero.xd on 3/20/2024 in #questions
Cloudflare workers: cannot import "node:events"
When running pnpm wrangler dev i get this error
the line that this points in the transpiled js is this
how can i fix this ?
2 replies
CDCloudflare Developers
•Created by fero.xd on 3/18/2024 in #workers-help
Cannot import 'events'
When running pnpm wrangler dev i get this error
the line that this points in the transpiled js is this
how can i fix this ?
2 replies
CDCloudflare Developers
•Created by fero.xd on 3/17/2024 in #workers-help
SynaxError: Unexpected Token export
I am trying to run my code that imports some types from "@cloudflare/workers-types" but it gives me this error
Its a monorepo and am using simple ts-node to run my index file. This file imports a local package that in turn imports from "cloudflare/workers-types".
8 replies
TTCTheo's Typesafe Cult
•Created by fero.xd on 2/21/2024 in #questions
Kubernetes Exec with websockets
So i want to get shell access to my k8s pod from my frontend (using xterm.js) i see k8s node client has a exec method that i can use with streams, but that doesnt seem to work. Can anyone help ?
7 replies
TTCTheo's Typesafe Cult
•Created by fero.xd on 11/15/2023 in #questions
Making a page static
I have my index page, it has nothing dynamic and i want this page to be statically rendered and served from the edge network. But whenever i build the app using pnpm build, next js always marks this page as dynamic(λ), am i too dumb ?
3 replies
TTCTheo's Typesafe Cult
•Created by fero.xd on 11/7/2023 in #questions
WebSocket Reverse proxy
I am using this library
http-proxy-middleware
to hide
my actual websocket server.
Proxy url = 'ws"//localhost:3001'
Ws server = 'ws://localhost:3000'
Is there a way that when i close the proxy server, the websocket connection doesnt get closed1 replies
TTCTheo's Typesafe Cult
•Created by fero.xd on 11/5/2023 in #questions
Pusher auth server on different host
This question is related to
pusher-js
.
I have a channel authorization server at a different physical host, i can specify the url of the server while creating new instance of Pusher, but it doesnt send cookies alongside it.
When using transport to jsonp
it shows jsonp is not recognized as auth transport
2 replies
TTCTheo's Typesafe Cult
•Created by fero.xd on 10/21/2023 in #questions
Nextjs
is there a way i can pass nextjs/headers to axios ?
2 replies
TTCTheo's Typesafe Cult
•Created by fero.xd on 7/3/2023 in #questions
Refactor type
I got a type def -
ValidSubscription
, DropEntitlementGrantCondition
. SubWithoutBroadcasterId
, UserAuthSubCondition
are an union of strings
Is there a way i can make this better1 replies
TTCTheo's Typesafe Cult
•Created by fero.xd on 5/31/2023 in #questions
Want to request only half of the audio file but not working
i request an audio file from my server and stream it to the browser .. on the browser i make a request to get only half of the audio file stream (i am doing total size of the file / 2 bytes) using the range header in request. the response header is something like this
but in the html <audio /> element i am getting the total duration of the audio as the original length of the file not the half of it
i also tried to manipulate the total size of the file in the response header but still it shows the full length
but the actual available audio is correct (i.e half of the original audio file)
7 replies