David Sherret's Avatar

David Sherret

@dsherret.bsky.social

Software developer at Deno. Also working on ts-morph, dprint, and more (https://github.com/dsherret)

1,325 Followers  |  72 Following  |  90 Posts  |  Joined: 03.06.2023  |  2.1723

Latest posts by dsherret.bsky.social on Bluesky

Thanks! Just a fetch then find and replace. It’s pretty hacked together πŸ˜…

23.10.2025 02:43 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
First-class JSONC manipulation in JavaScript Manipulating JSONC in JavaScript using a CST via jsonc-morph

Wrote a library this weekend for modifying JSONC files david.deno.dev/posts/jsonc-...

12.10.2025 23:30 β€” πŸ‘ 17    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Post image

Stuck in an elevator with @snek.dev, @littledivy.com, @bartlomieju.bsky.social, @magurotuna.bsky.social, @dsherret.bsky.social, @kettmeir.dev, and Nathan

07.08.2025 18:58 β€” πŸ‘ 27    πŸ” 3    πŸ’¬ 2    πŸ“Œ 0
Poster for SquiggleConf 2025, September 18-19 Boston

JSR: Designing Package Registry Module Resolution

David Sherret, Deno Developer; creator of ts-morph, dprint-ts-ast-viewer

Poster for SquiggleConf 2025, September 18-19 Boston JSR: Designing Package Registry Module Resolution David Sherret, Deno Developer; creator of ts-morph, dprint-ts-ast-viewer

🌟 Speaker Spotlight: David Sherret

@dsherret.bsky.social will walk us through the JSR package registry: why it exists, how it improves on previous approaches such as HTTPS specifiers, and the design decisions behind its module resolution.

Schedule, speakers & more info: squiggleconf.com

18.07.2025 12:00 β€” πŸ‘ 11    πŸ” 2    πŸ’¬ 0    πŸ“Œ 1
Video thumbnail

Importing bytes and texts:
βœ… adds to your module graph
βœ… type checking
βœ… works with deno bundle and deno compile

deno.com/blog/v2.4#im...

03.07.2025 16:49 β€” πŸ‘ 34    πŸ” 3    πŸ’¬ 2    πŸ“Œ 0

They recently landed these methods to ReadableStream that haven't standardized yet: github.com/whatwg/strea... (I want those methods too, but it's not standard)

03.07.2025 01:14 β€” πŸ‘ 2    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

Yeah, essentially just `node.text += "?bytes"`. I'm pretty sure it's going to break when TS does some refactorings, but I'll deal with fixing that in the future.

26.06.2025 18:44 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

We use TS via the API so we can resolve specifiers based on their location. That said, once resolved, TS will cache the lookups keyed by specifier and node resolution mode only (github.com/microsoft/Ty...). To work around this, we trick TS into thinking each import attribute is a unique specifier.

26.06.2025 14:51 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

Type checking text and bytes imports is now working.

25.06.2025 17:57 β€” πŸ‘ 9    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

We're probably going to do it later to improve node compatibility, but JS loaders are not so great because it creates a decent amount of extra complexity, is slower, and is not as portable or standard.

21.06.2025 17:03 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

Couple things: github.com/whatwg/html/... github.com/tc39/proposa...

Also, probably waiting on github.com/tc39/proposa...

21.06.2025 16:56 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0
Importing a module as bytes and text with a dynamic import.

Importing a module as bytes and text with a dynamic import.

Yup.

20.06.2025 20:42 β€” πŸ‘ 2    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Importing a file as text and bytes with an import attribute.

Importing a file as text and bytes with an import attribute.

Should have importing files as text and bytes ready for Deno 2.4 -- will be unstable because it hasn't been standardized.

20.06.2025 20:23 β€” πŸ‘ 26    πŸ” 2    πŸ’¬ 4    πŸ“Œ 2

Oof that's terrible. Sorry to hear!

13.06.2025 22:31 β€” πŸ‘ 2    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

I skip stairs going down. I've wondered when and how I'll find out I can no longer do that.

13.06.2025 22:02 β€” πŸ‘ 3    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

bsky.app/profile/dshe...

04.06.2025 21:34 β€” πŸ‘ 2    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Post image

It's very untested and probably won't work in many scenarios, but it's a start. Bugs can be reported here: github.com/denoland/rol...

04.06.2025 21:34 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

This is now published to JSR as a rolldown plugin: jsr.io/@deno/rolldo...

04.06.2025 21:34 β€” πŸ‘ 12    πŸ” 1    πŸ’¬ 1    πŸ“Œ 1
Terminal output showing a JSR specifier being bundled to a single file then executed.

> ../rolldown/target/debug/rolldown_deno.exe jsr:@david/dax@0.43
Bundle jsr:@david/dax@0.43
Writing: dax.bundle.js
Writing: dax.bundle.js.map
> deno
Deno 2.3.5
exit using ctrl+d, ctrl+c, or close()
REPL is running with all permissions allowed.
To specify permissions, run `deno repl` with allow flags.
> import $ from "./dax.bundle.js"
undefined
> await $`echo 'Hello there!' && echo 'This is from a bundled copy.'`
Hello there!
This is from a bundled copy.
CommandResult { code: 0 }

Terminal output showing a JSR specifier being bundled to a single file then executed. > ../rolldown/target/debug/rolldown_deno.exe jsr:@david/dax@0.43 Bundle jsr:@david/dax@0.43 Writing: dax.bundle.js Writing: dax.bundle.js.map > deno Deno 2.3.5 exit using ctrl+d, ctrl+c, or close() REPL is running with all permissions allowed. To specify permissions, run `deno repl` with allow flags. > import $ from "./dax.bundle.js" undefined > await $`echo 'Hello there!' && echo 'This is from a bundled copy.'` Hello there! This is from a bundled copy. CommandResult { code: 0 }

Got bundling JSR/Deno code with Rolldown working.

This is using Rolldown's and Deno's crates respecting Deno's lockfile, config discovery, and resolution. Finally Deno's crates have been refactored enough for this to be feasible (~500 LOC). I'll update with more details later.

31.05.2025 02:19 β€” πŸ‘ 15    πŸ” 1    πŸ’¬ 2    πŸ“Œ 1

That sucks! Sorry to hear that :(

13.05.2025 20:31 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

This is crazy and I'm sorry to hear. I hope you'll find a way to continue contributing to the ecosystem.

13.05.2025 20:14 β€” πŸ‘ 6    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

Nice. Thanks!

27.03.2025 22:41 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Clippy Lints A collection of lints to catch common mistakes and improve your Rust code.

I've only found rust-lang.github.io/rust-clippy/... which seems to only error when there's a single variant left and not multiple.

27.03.2025 22:36 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0
Post image

I've come across so many bugs caused by using wildcard matches in Rust. Even though it can be verbose, I think it's better to avoid them in most cases so that adding a new enum variant causes compiler errors, forcing you to re-evaluate each match.

27.03.2025 21:50 β€” πŸ‘ 16    πŸ” 1    πŸ’¬ 1    πŸ“Œ 0

In the past I did something similar for dprint here... basically if there's a graph then it's almost always useful to have an easy way to visualize it: x.com/DavidSherret...

20.03.2025 19:35 β€” πŸ‘ 2    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

Deno's npm resolution uses a one directional graph and maintains a reverse path through the graph for where it's currently resolving (shown as the red line).

20.03.2025 19:35 β€” πŸ‘ 2    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0
Video thumbnail

It was getting difficult to debug Deno's npm resolution so I wrote a tool to help visualize each step it makes.

20.03.2025 19:35 β€” πŸ‘ 9    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

I think there needs to be something more restrictive that allows for doing isolated work in parallel while having native and js (non-parallel) targets. I was thinking about this earlier and did a bit of work exploring. The problem is use cases are small.

12.03.2025 02:39 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Microsoft is Getting Rusty: A Review of Successes and Challenges - Mark Russinovich
YouTube video by Rust Nation UK Microsoft is Getting Rusty: A Review of Successes and Challenges - Mark Russinovich

My closing keynote from Rust Nation UK last week is now online: "Microsoft is Getting Rusty: A Review of Successes and Challenges"

26.02.2025 22:18 β€” πŸ‘ 59    πŸ” 15    πŸ’¬ 6    πŸ“Œ 1

Also, this was C# WinForms. While there I created a development only ctrl+i tool for inspecting/modifying controls at runtime that I was quite proud.

25.02.2025 01:43 β€” πŸ‘ 7    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

@dsherret is following 19 prominent accounts