You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
'loose' turns off Mermaid's HTML sanitisation so that raw HTML in node labels is rendered as-is. That output then goes straight into dangerouslySetInnerHTML. The diagram content here is hardcoded, so there is no immediate XSS risk — but this is a footgun: if MermaidDiagram is ever reused with dynamic or user-supplied content, it becomes an XSS vector.
Recommended fix: use securityLevel: 'strict' (the default) and replace <br/> in the diagram strings with \n or a Mermaid line-break (<br/>). With strict, Mermaid sanitises SVG output before returning it, making dangerouslySetInnerHTML safe for its own rendered output.
These are absolute paths on the author's machine — they will 404 for everyone else on GitHub. Replace with repo-relative paths:
- UI: [`app/page.tsx`](../app/page.tsx)
Minor — module-level singleton blocks re-initialisation
components/marketing/mermaid-diagram.tsx line 101
lethasInitializedMermaid=false;
mermaid.initialize() can only be called once per page load with this guard. That is fine for now, but any future need (e.g. dark/light theme switching) would require a more flexible approach. Not blocking, but worth a comment or TODO so the constraint is visible.
Minor — magic number for loading placeholder height
The hardcoded 420px will cause a layout shift when the rendered diagram is taller or shorter. Consider deriving it from the rendered diagram's natural height, or accepting it as a prop so callers can tune it.
Nit — mermaid is a heavy dependency
Mermaid adds roughly 1–2 MB to the JS bundle (minified). The dynamic import('mermaid') is the right call for lazy-loading, but it is worth confirming that Next.js is not accidentally pulling it into the server bundle. A quick check with ANALYZE=true npm run build (if bundle analysis is wired up) would confirm the chunk is client-only.
The architecture doc and the landing page section are a nice addition. Fixing the security level and the broken doc links are the main things I would address before merging.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Testing
npm run ts-checknpm run build