Skip to content

refactor: replace tidwall/jsonc with tailscale/hujson#679

Draft
skevetter wants to merge 2 commits intomainfrom
sk/dep-replace-jsonc
Draft

refactor: replace tidwall/jsonc with tailscale/hujson#679
skevetter wants to merge 2 commits intomainfrom
sk/dep-replace-jsonc

Conversation

@skevetter
Copy link
Copy Markdown
Owner

Summary

tidwall/jsonc was used in pkg/devcontainer/config/parse.go to strip comments and trailing commas from devcontainer JSON files before unmarshalling. Replaces it with tailscale/hujson, which was already an indirect dependency and provides stricter, AST-based JSONC parsing.

The replacement adds proper error propagation: hujson.Standardize() returns an error on genuinely malformed input, whereas tidwall/jsonc silently passed malformed files through to json.Unmarshal. For all valid devcontainer.json files there is no behavior change.

Changes

  • pkg/devcontainer/config/parse.go: replaced jsonc.ToJSON(data) pattern with hujson.Standardize(data) (2 call sites), with error propagation
  • go.mod: tidwall/jsonc removed; tailscale/hujson promoted from indirect to direct
  • docs/pages/licenses/devpod.mdx: removed tidwall/jsonc entry, added tailscale/hujson (BSD-3-Clause)

Both packages strip JSON comments and trailing commas (JSONC format).
hujson was already an indirect dep in the module tree; promote it to a
direct dep and remove tidwall/jsonc entirely.

hujson.Standardize() returns an error on malformed input, which is now
propagated rather than silently ignored as before.
Remove stale github.com/tidwall/jsonc entry and add
github.com/tailscale/hujson (BSD-3-Clause) which replaced it.
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 4, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 50e8bfcb-45d5-443c-85d4-aec56c6e632a

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch sk/dep-replace-jsonc

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions bot added the size/s label Apr 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant