D.JS v14 - Is the shardCount client option good to use?

I am using TypeScript, so I cant use the shard manager cause it will need me to transpile back to JS. Is this client option a viable and good one to use for sharding?
12 Replies
megatank58
megatank582y ago
ShardingManager should work just fine with typescript
space
space2y ago
You have to transpile back to JS either way, as node can't run TS. You can use shards with 'auto' to spawn all shards in process; Will only get you so far though.
megatank58
megatank582y ago
You can also just use internal sharding with shards: 'auto' I mean it is absolutely fine to use internal sharding till 20k guilds It may start to break after that as in performance
nikoszz
nikoszz2y ago
I'm using ts-node. ^
megatank58
megatank582y ago
ts-node is not a code transpiler it's more of a REPL, it's better to use something like tsup if you really have to
nikoszz
nikoszz2y ago
I will look into tsup
space
space2y ago
You could also use worker sharding, which will run shards in separate threads instead of processes.
nikoszz
nikoszz2y ago
compiling with TSC is fine right?
megatank58
megatank582y ago
It's the preferred method
nikoszz
nikoszz2y ago
i had found this package some days ago and wonder if it is a good idea to implement: https://www.npmjs.com/package/discord-hybrid-sharding
npm
discord-hybrid-sharding
The first package which combines sharding manager & internal sharding to save a lot of resources, which allows clustering!. Latest version: 1.6.7, last published: 2 days ago. Start using discord-hybrid-sharding in your project by running npm i discord-hybrid-sharding. There are no other projects in the npm registry using discord-hybrid-sharding.
megatank58
megatank582y ago
You probably won't require it unless you are in more than 20k guilds
nikoszz
nikoszz2y ago
alright, thanks anyway