Skip to content

remove non determinism from deployed site files [beta] - #2654

Merged
plowsof merged 6 commits into
monero-project:betafrom
plowsof:deterministic-dist-zip
May 17, 2026
Merged

remove non determinism from deployed site files [beta]#2654
plowsof merged 6 commits into
monero-project:betafrom
plowsof:deterministic-dist-zip

Conversation

@plowsof

@plowsof plowsof commented May 6, 2026

Copy link
Copy Markdown
Collaborator

#2653

3 commits have small diffs, i built with everything, committed the dist folder, removed the commit and rebuilt, the file is the resulting diff

Accordian.astro-15864bcc.txt
index.astro-7c1dbd7b.txt
SectionTabs.astro-457800c3.txt

@github-actions

github-actions Bot commented May 6, 2026

Copy link
Copy Markdown
What Link
🕵️‍♂️ Review Files changed
🌐 Deploy Preview #2654

@plowsof plowsof added the beta label May 6, 2026
Comment on lines +16 to +24
if (items?.some((i) => typeof i.title !== "string" || !i.title.trim())) {
throw new Error("<Accordion> item has an empty title.");
}
const accordionId = items?.length
? `${variant}-${[...items.map((i) => i.title).join("")]
.slice(0, 7)
.map((c) => c.codePointAt(0))
.join("-")}`
: `${variant}-slot`;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could add a stableId helper, smth like this that works with both strings & lists:

import { createHash } from "node:crypto";

export const stableId = (input: string | string[], length = 12): string => {
  const data = typeof input === "string" ? input : JSON.stringify(input);
  return createHash("sha256").update(data).digest("hex").slice(0, length);
};

then can collapse to smth like this, and apply in NavItem, SectionTabs the same:

import { stableId } from "@/utils/stableId";
// ...
const titles = items?.map((i) => i.title) ?? [];
if (titles.some((t) => !t.trim())) {
  throw new Error("<Accordion> item has an empty title.");
}
const accordionId = `${variant}-${titles.length ? stableId(titles) : "slot"}`

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice refactor , (although adding the import back), could PR it after this as i'd hate to back into diff hell / confirming what works

@plowsof
plowsof merged commit 52c1b7f into monero-project:beta May 17, 2026
3 checks passed
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.

2 participants