A CLI for publishing standard.site documents to ATProto sequoia.pub

Replace js-yaml with yaml and smol-toml with toml #49

Closed stevedylan.dev
Closed opened by stevedylan.dev

I tried this. With js-yaml the entry point is 3.67MB. With yaml it's 3.82MB. That said, the community says js-yaml appears unmaintained: https://e18e.dev/docs/replacements/js-yaml#replacements-for-js-yaml

That doesn't seem to be the case, though. According to npmx, js-yaml was last published 2026-05-31. yaml was last published 2026-05-11.

But the community also said js-yaml has spec issues. Seems good enough for our case. I'm going to go ahead and publish the branch - even make a PR - but will close this issue. @stevedylan.dev, if you want to take it or not, it's all good. Figured it's at least worth having as a PR for posterity if nothing else. There were a couple small changes to call sites, but tests were unchanged.

Actually, now that PR #46 added remark and friends, which use toml and yaml packages, it may actually be worth replacing js-yaml and smol-toml to reduce dependencies. Of course, bundled there's a lot of tree shaking that occurs, but still duplication otherwise.

Right now, it's 4.0MB post-build. I'll replace those two packages and see if it changes much. At least when I tested replacing js-yaml with yaml before, the code changes were minimal.

If I add --minify to the build script, with or without smol-toml the bundle is 2.26MB. And given toml doesn't have a stringify, seems we probably need to use smol-toml anyway.

Again with --minify and keeping both toml and smol-toml from my step above, adding js-yaml back in - with yaml still as a transitive dependency - the size goes down to 2.19MB!

I think the take-away is to add --minify but otherwise keep things as-is.

Nice find!

Sign up or Sign in to add to the discussion.