Thanks to visit codestin.com
Credit goes to github.com

Skip to content

refactor(site): use uuid package instead of generateUUID helper - #27709

Merged
jeremyruppel merged 1 commit into
mainfrom
jeremyruppel/replace-generateuuid
Jul 30, 2026
Merged

refactor(site): use uuid package instead of generateUUID helper#27709
jeremyruppel merged 1 commit into
mainfrom
jeremyruppel/replace-generateuuid

Conversation

@jeremyruppel

Copy link
Copy Markdown
Contributor

Summary

#27661 introduced a generateUUID() helper, but the uuid package is already a dependency. This replaces the helper with uuid's v4 and removes the helper and its tests.

Changes

  • site/src/utils/uuid.ts: remove generateUUID(). isUUID() is kept (still used by the IdP sync pages and EditUserPage).
  • site/src/utils/uuid.test.ts: deleted. The whole file was added in feat(site): add generateUUID helper #27661 and only tested generateUUID.
  • site/src/pages/TemplateBuilder/TemplateBuilderPage.tsx: use import { v4 as uuidv4 } from "uuid", matching the existing convention in TerminalPage.tsx and AgentChatPageView.tsx.

Verification

  • No remaining generateUUID references.
  • biome check: clean.
  • tsc --noEmit: no errors for the affected files.

This PR was generated by Coder Agents on behalf of @jeremyruppel.

Replace the generateUUID helper added in #27661 with the existing uuid dependency (v4). Delete the helper and its tests. Keep isUUID.
@jeremyruppel
jeremyruppel requested a review from aqandrew July 30, 2026 19:27
@jeremyruppel
jeremyruppel marked this pull request as ready for review July 30, 2026 19:27
@jeremyruppel
jeremyruppel requested a review from untra July 30, 2026 19:58
@untra

untra commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

so I looked into it, and "biome": 2.5.6 released just this week that supports noJsRestrictedProperties:
https://biomejs.dev/linter/rules/no-js-restricted-properties/

crypto.randomUUID is used in a few other storybook stories. But if we upgrade biome and try out this good new sauce, we can start setting up AI guardrails that nudge tools in the right direction:

"nursery": {
     // crypto.randomUUID() is only defined in secure contexts
     // (HTTPS/localhost), so it is undefined on plain-HTTP deployments.
     "noJsRestrictedProperties": {
         "level": "error",
         "options": {
             "entries": [
                 {
                     "property": "randomUUID",
                     "message": "crypto.randomUUID() is unavailable outside secure contexts. Use `import { v4 as uuidv4 } from \"uuid\"` instead."
                 }
             ]
         }
     }
 }

@jeremyruppel
jeremyruppel merged commit 218829d into main Jul 30, 2026
53 of 54 checks passed
@jeremyruppel
jeremyruppel deleted the jeremyruppel/replace-generateuuid branch July 30, 2026 20:52
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 30, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants