Sign in

Divyansh Singh

@brc-dd.dev
1.1K followers 405 following 124 posts

Software Engineer | @vuejs.org Core Team | vitepress.dev Maintainer | Director at globalbrains.com

PostsRepliesMedia
Divyansh Singh @brc-dd.dev · 01/11/2025
You can also disable them.
Notification settings at https://github.com/sponsors/<user>/dashboard/settings showing unchecked "Sponsorship cancelled" option.
010
Divyansh Singh @brc-dd.dev · 26/08/2025
It's already there? 👀
vscode status bar showing the used tsconfig
110
Divyansh Singh @brc-dd.dev · 26/07/2025
VitePress v2-alpha now supports @algolia.com's DocSearch v4 - including the new "Ask AI" feature! ✨ Try it out: - vitepress.dev/reference/de... - docsearch.algolia.com/docs/v4/askai And a big congrats to Algolia on 10 years of DocSearch! 🎉
latest vitepress docs showing docsearch AI answering a question
070
Divyansh Singh @brc-dd.dev · 23/07/2025
Not related to the API itself, but the errors shouldn't be shown in this case unless the user clicks submit again?
100
Divyansh Singh @brc-dd.dev · 15/07/2025
I honestly believe these people are just rage baiting. I haven't used ArkType before, but it hardly takes 2 minutes to find what to do for dynamic stuff. 🤷‍♂️ I think there might be more idiomatic ways to do this, but this didn't need much effort and works fine.
import { type } from 'npm:arktype'

const dynamicObject = {
  foo: 'bar',
  baz: 42,
}

const Foo = type('string').narrow((n, ctx) => {
  if (Object.hasOwn(dynamicObject, n)) return true
  return ctx.mustBe('one of ' + JSON.stringify(Object.keys(dynamicObject)))
})

Foo.assert('foo')
Foo.assert('baz')
Foo.assert('bar')
240
Divyansh Singh @brc-dd.dev · 10/05/2025
It’s configurable:
autofill and passwords setting page in ios
120
Divyansh Singh @brc-dd.dev · 27/04/2025
Found an old pic. I guess it's the same thing? (might be hard to tell though, I'm not good at taking photos 🫠 and it's from ~10 years ago)
some tree with heart shaped leaves and reddish-brown pods
010
Divyansh Singh @brc-dd.dev · 14/04/2025
Deno doesn't support installing tarballs from arbitrary URLs - github.com/denoland/den.... You'll need to use https imports using esm.sh
```ts
// Examples
import { Bench } from "https://esm.sh/pr/tinylibs/tinybench/tinybench@a832a55";
import { Bench } from "https://esm.sh/pr/tinybench@a832a55"; // --compact
```
121
Divyansh Singh @brc-dd.dev · 30/03/2025
Ok damn 😂 Looks like you aren't alone. www.reddit.com/r/MacOS/comm...
Apple bug showing 1047 hour screen time.
020
Divyansh Singh @brc-dd.dev · 29/03/2025
Ah, maybe it's region specific then. It has been available for about an year in India. 👀
chat with meta ai showing image generation
010
Divyansh Singh @brc-dd.dev · 27/03/2025
The banding isn't visible on the video for some reasons, so here is the screenshot. It's also visible on the MVCE shared on the StackOverflow thread - jonnygarrill.com/purple.html (try to scroll, the bottom will then look different).
image showing banding on background
000
Divyansh Singh @brc-dd.dev · 27/03/2025
Does anyone why is there banding when using certain modern colors on Chrome? I'm on mac and it only happens on Chrome/Chromium-based browsers. Firefox and safari render it fine. The only related thing I could see was stackoverflow.com/q/78455453/1...
430
Divyansh Singh @brc-dd.dev · 23/03/2025
If you use the copy code button, it automatically strips out leading $ and >. Adding `user-select: none;` to span can be done, but might be slightly tricky.
screenshot of vite's docs showing the copy code button in create-vite instructions
100
Divyansh Singh @brc-dd.dev · 19/02/2025
Also, import attributes were backported to node 18/20 too.
import attributes (e.g. `with { type: 'json' }`) work fine on node 18
120
Divyansh Singh @brc-dd.dev · 13/02/2025
Huge thanks to StackBlitz for their generous support in the latest wave of sponsors! I'm truly grateful for their commitment to the Vite ecosystem and open-source sustainability. And a big shoutout for the recent Expo x Bolt integration! 🚀💙
StackBlitz's recent sponsors (digital altered to show everyone on same page 😅)
4325
Divyansh Singh @brc-dd.dev · 05/02/2025
* 137M JavaScript files on GitHub – only 1K mention JET. * 2.5M JavaScript questions on Stack Overflow – fewer than 50 reference JET. * 55B times JavaScript packages are downloaded from NPM every week – JET-related downloads? Less than 7K. Oh wise Oracle, how does one even prove genericness?!
Text from Oracle's motion to dismiss (https://ttabvue.uspto.gov/ttabvue/v?pno=92086835&pty=CAN&eno=7) - 

Petitioner seeks to cancel Oracle’s longstanding Registration No. 2416017 (the “Registration”) for its JAVASCRIPT mark on the basis of: (1) genericness; (2) fraud; and (3) abandonment. See generally 1 TTABVUE. Oracle expects to prevail as to genericness and abandonment at summary judgment, where the undisputed evidence will show that Oracle uses the JAVASCRIPT mark in connection with a variety of offerings, including its JAVASCRIPT Extension Toolkit as well as developer’s guides and educational resources, and also that relevant consumers do not perceive JAVASCRIPT as a generic term.
040
Divyansh Singh @brc-dd.dev · 15/01/2025
Ah, then this is the best I could come with (would be better to just re-assert the type instead of this 😅)
// @ts-check

/**
 * @template {string} T
 * @typedef {T extends '' ? T : `${T}`} PrependIfDefined
 */

/**
 * @template {string[]} T
 * @typedef {T extends [infer F extends string, ...infer R extends string[]] ? `${F}${PrependIfDefined<Concat<R>>}` : ''} Concat
 */

/**
 * @type {<T extends string[]>(...strings: T) => Concat<T>}
 */
function concat() {
  return /** @type {any} */ (Array.prototype.slice.call(arguments).join(''))
}

var bar = /** @type {const} */ ('bar')

var str = concat('foo', bar)
010
Divyansh Singh @brc-dd.dev · 15/01/2025
You'll need to use template syntax:
var str = /** @type {const} */ (`foo${bar}`)
100
Divyansh Singh @brc-dd.dev · 20/12/2024
🎉
deno reached 100K stars on github
010
Divyansh Singh @brc-dd.dev · 05/12/2024
BTW split+join is faster on v8 than both replace and replaceAll 😅
split+join is faster than replaceAll in both bun and node. In node, it's also faster than replace+RE.
3150
Divyansh Singh @brc-dd.dev · 05/12/2024
Depends on the runtime I guess 👀
replace is faster than replaceAll by ~1500x in bun but almost same on node
180
Divyansh Singh @brc-dd.dev · 19/11/2024
Ah, you'll need to enable that from settings 😅. But it's that power cord on left image.
Screenshot of bsky content filters settings.
000
Divyansh Singh @brc-dd.dev · 19/11/2024
Wait, what is this? 💀
suicide cord?
100
Divyansh Singh @brc-dd.dev · 12/11/2024
Wouldn't just type Adjusted = `$${Props}` work the same?
screenshot of ts playground showing usage of string union interpolation in template literal types
160
Divyansh Singh @brc-dd.dev · 08/11/2024
Also, it has bsky dns preset:
Porkbun domain management dashboard showing quick dns config for Bluesky.
000
Divyansh Singh @brc-dd.dev · 04/11/2024
🦋 on Vite docs:
Bluesky, Mastodon, X, Discord and GitHub logos on Vite docs' navbar. (Running locally with the above config.)
1281
Divyansh Singh @brc-dd.dev · 04/11/2024
New in VitePress - Now you can easily add links to any platform using icons from Simple Icons via Iconify. And yeah Bluesky works too! Also, it'll only add icons you're actually using = smaller CSS bundle.
Image showing socialLinks config for vitepress' default theme. Docs - https://vitepress.dev/reference/default-theme-config#sociallinks
1435