Skip to content

FE-518: Add Storybook and update build/lint setup for refractive#8549

Open
kube wants to merge 4 commits intomainfrom
cf/fe-518-add-storybook-and-update-build-setup
Open

FE-518: Add Storybook and update build/lint setup for refractive#8549
kube wants to merge 4 commits intomainfrom
cf/fe-518-add-storybook-and-update-build-setup

Conversation

@kube
Copy link
Collaborator

@kube kube commented Mar 15, 2026

🌟 What is the purpose of this PR?

Modernizes the build, lint, and dev tooling for @hashintel/petrinaut, @apps/petrinaut-website, and @hashintel/refractive to use the latest versions of Vite, oxlint, and the React Compiler plugin — and aligns all three packages on the same configuration patterns.

🔗 Related links

🔍 What does this change?

Migrate petrinaut & petrinaut-website from ESLint to oxlint

  • Replace eslint.config.js with .oxlintrc.json in both packages
  • Enable --type-aware linting and --report-unused-disable-directives-severity=error
  • Add jsx-a11y, unicorn plugins; promote all warn rules to error
  • Fix all newly-surfaced lint violations (unused disables, missing use no memo, etc.)
  • Add CLAUDE.md for petrinaut with stack/conventions docs

Upgrade dev tooling across all three packages

  • @vitejs/plugin-react 5.x → 6.0.1
  • @typescript/native-preview → 7.0.0-dev.20260315.1
  • rolldown-plugin-dts → 0.22.5, storybook → 10.2.19
  • Switch React Compiler setup from inline babel.plugins to @rolldown/plugin-babel + reactCompilerPreset
  • Drop unused devDependencies from petrinaut

Add Storybook to @hashintel/refractive

  • Add .storybook/ config and playground.stories.tsx (replaces old playground/ directory)
  • Remove the old playground app

Align @hashintel/refractive config with petrinaut

  • Adopt identical .oxlintrc.json, tsconfig.json (noFallthroughCasesInSwitch), and Vite config patterns
  • Add oxlint-tsgolint, @rolldown/plugin-babel devDependencies
  • Rename uppercase constant functions (CONVEXconvex, etc.) to satisfy new-cap rule

Monorepo fixes

  • Exclude node_modules from workspace glob to fix turbo duplicate package error
  • Add web-worker to hash-frontend for elkjs compatibility
  • Extract ui-subviews.ts constant in petrinaut to fix circular reference

Pre-Merge Checklist 🚀

🚢 Has this modified a publishable library?

This PR:

  • modifies an npm-publishable library and I have added a changeset file(s)

📜 Does this require a change to the docs?

The changes in this PR:

  • are internal and do not require a docs change

🕸️ Does this require a change to the Turbo Graph?

The changes in this PR:

  • affected the execution graph, and the turbo.json's have been updated to reflect this

🛡 What tests cover this?

  • yarn lint:eslint and yarn lint:tsc pass for all three packages
  • yarn build succeeds for @hashintel/refractive and @hashintel/petrinaut

@vercel
Copy link

vercel bot commented Mar 15, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
hash Error Error Mar 15, 2026 10:55pm
hashdotdesign Ready Ready Preview, Comment Mar 15, 2026 10:55pm
petrinaut Ready Ready Preview Mar 15, 2026 10:55pm
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
hashdotdesign-tokens Ignored Ignored Preview Mar 15, 2026 10:55pm

Copy link
Collaborator Author

kube commented Mar 15, 2026

@kube kube marked this pull request as ready for review March 15, 2026 16:36
@cursor
Copy link

cursor bot commented Mar 15, 2026

PR Summary

Medium Risk
Moderate risk because it changes @hashintel/refractive’s published build output (ESM-only), exported API names (CONVEX/LIPconvex/lip), and its type/lint/build pipeline, which could impact downstream consumers and CI.

Overview
Adds Storybook-based development for @hashintel/refractive by introducing .storybook config and a Playground story, replacing the previous Vite playground/ app.

Modernizes @hashintel/refractive packaging/tooling: replaces ESLint config with .oxlintrc.json (oxlint + type-aware lint), updates tsconfig.json/scripts to use tsgo, upgrades Vite/React plugin, and switches the build to a rolldown-based ESM library output with rolldown-plugin-dts.

API/usage adjustments: renames surface equation exports to lowerCamelCase (CONVEX_CIRCLE/CONVEX/CONCAVE/LIPconvexCircle/convex/concave/lip) and updates consumers (e.g., ds-components Switch) plus a small logic tweak in calculateRoundedSquareMap around maximumDistanceToBorder handling. Also updates the root workspace globs to exclude node_modules.

Written by Cursor Bugbot for commit 4c2a6f1. This will update automatically on new commits. Configure here.

@augmentcode
Copy link

augmentcode bot commented Mar 15, 2026

🤖 Augment PR Summary

Summary: This PR modernizes the @hashintel/refractive package’s developer workflow by adding Storybook and switching the build/lint toolchain to newer Vite/Rolldown + Oxlint tooling.

Changes:

  • Added Storybook configuration (.storybook/main.ts, .storybook/preview.ts) and a new playground story under stories/
  • Removed the old Vite “playground” dev app and repurposed yarn dev to run Storybook
  • Replaced the ESLint setup with an .oxlintrc.json and updated lint scripts to use oxlint + type-aware checks
  • Updated TypeScript config to a stricter, standalone tsconfig.json and adjusted includes for Storybook + stories
  • Updated Vite config to Vite 8 / Rolldown options and swapped DTS generation to rolldown-plugin-dts
  • Renamed and re-exported surface-equation helpers (camelCase) and updated internal imports
  • Minor story/content tweaks (e.g., improved alt text in example story)

Technical Notes: The library build now targets ESM output only and declares types from dist/index.d.ts, while Storybook provides the primary interactive dev environment.

🤖 Was this summary useful? React with 👍 or 👎

Copy link

@augmentcode augmentcode bot left a comment

Choose a reason for hiding this comment

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

Review completed. 3 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

{ "button": true, "submit": true, "reset": false }
],

"react-hooks/rules-of-hooks": "error",
Copy link

Choose a reason for hiding this comment

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

Oxlint’s Rules of Hooks rules are react/rules-of-hooks (and react/exhaustive-deps), so react-hooks/* here may be treated as unknown/ignored and leave hooks unenforced.

Severity: medium

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Re: react-hooks rules — oxlint supports react-hooks/* syntax, same as petrinaut's config. No change needed.

export type SurfaceFnDef = (x: number) => number;

export const CONVEX_CIRCLE: SurfaceFnDef = (x) => Math.sqrt(1 - (1 - x) ** 2);
export const convexCircle: SurfaceFnDef = (x) =>
Copy link

Choose a reason for hiding this comment

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

These exports were renamed from CONVEX*/CONCAVE/LIP to camelCase, and src/main.ts re-exports them, so this is a public API breaking change for any downstream imports. It may be worth confirming versioning/changelog expectations for this rename.

Severity: medium

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fixed in 4c2a6f1 — updated the consumer in ds-components/switch.tsx to use the new names.

"sideEffects": false,
"main": "./dist/index.cjs",
"module": "./dist/index.js",
"main": "./dist/index.js",
Copy link

Choose a reason for hiding this comment

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

This package now appears to be ESM-only (type: "module", main points to dist/index.js, and the Vite config builds only es), which will break CommonJS require() consumers if any exist.

Severity: medium

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Intentional — ESM-only, same as @hashintel/petrinaut. All consumers use bundlers.

@codspeed-hq
Copy link

codspeed-hq bot commented Mar 15, 2026

Merging this PR will not alter performance

✅ 80 untouched benchmarks


Comparing cf/fe-518-add-storybook-and-update-build-setup (4c2a6f1) with main (46e4caf)

Open in CodSpeed

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Fix All in Cursor

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

import react from "@vitejs/plugin-react";
import babel from "@rolldown/plugin-babel";
import react, { reactCompilerPreset } from "@vitejs/plugin-react";
import { dts } from "rolldown-plugin-dts";
Copy link
Contributor

Choose a reason for hiding this comment

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

Replace the import of 'rolldown-plugin-dts' with 'vite-plugin-dts' to fix the compatibility issue with rolldown. Change to: import dts from 'vite-plugin-dts';

Spotted by Graphite (based on CI logs)

Fix in Graphite


Is this helpful? React 👍 or 👎 to let us know.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

rolldown-plugin-dts is correct — same as petrinaut. vite-plugin-dts is the old approach.

Comment on lines +21 to +26
dts({ tsgo: true }).map((plugin) =>
// Ensure runs before Vite's native TypeScript transform
plugin.name.endsWith("fake-js")
? { ...plugin, enforce: "pre" }
: plugin,
),
Copy link
Contributor

Choose a reason for hiding this comment

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

Replace the rolldown-plugin-dts configuration with vite-plugin-dts configuration. Change to: dts({ rollupTypes: true, insertTypesEntry: true, exclude: ['/.stories.', '/.test.'], copyDtsFiles: false, outDir: 'dist' })

Spotted by Graphite (based on CI logs)

Fix in Graphite


Is this helpful? React 👍 or 👎 to let us know.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

rolldown-plugin-dts with tsgo: true is the intended setup, matching petrinaut.

@kube kube changed the base branch from cf/h-6324-migrate-petrinaut-to-oxlint-and-verify-react-compiler to graphite-base/8549 March 15, 2026 16:58
@kube kube force-pushed the graphite-base/8549 branch from 17e5684 to ccc9e08 Compare March 15, 2026 18:09
@kube kube force-pushed the cf/fe-518-add-storybook-and-update-build-setup branch from 132f9b3 to a0766e7 Compare March 15, 2026 18:09
@kube kube changed the base branch from graphite-base/8549 to cf/h-6324-migrate-petrinaut-to-oxlint-and-verify-react-compiler March 15, 2026 18:09
@kube kube changed the base branch from cf/h-6324-migrate-petrinaut-to-oxlint-and-verify-react-compiler to graphite-base/8549 March 15, 2026 18:33
@kube kube force-pushed the cf/fe-518-add-storybook-and-update-build-setup branch from a0766e7 to e6353b8 Compare March 15, 2026 18:33
@kube kube force-pushed the graphite-base/8549 branch from ccc9e08 to 6cecb10 Compare March 15, 2026 18:33
@kube kube changed the base branch from graphite-base/8549 to cf/h-6324-migrate-petrinaut-to-oxlint-and-verify-react-compiler March 15, 2026 18:33
Base automatically changed from cf/h-6324-migrate-petrinaut-to-oxlint-and-verify-react-compiler to main March 15, 2026 19:38
kube and others added 3 commits March 15, 2026 23:37
Replace the playground/ dev server with Storybook for component
development and visual testing.

- Remove playground/ folder and its Vite dev server setup
- Add Storybook 9 with @storybook/react-vite framework
- Create playground story showing refractive glass effect over
  scrollable article content
- Simplify vite.config.ts for lib-only builds (Storybook handles dev)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…cate package error

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace ESLint with oxlint, tsc with tsgo, upgrade to Vite 8 + Storybook 10,
switch to ES-only output with rolldown-plugin-dts for declaration generation.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Bump Storybook from 10.2.13 to 10.2.19 for Vite 8 compatibility
- Update ds-components/switch.tsx to use renamed `lip` export

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@github-actions
Copy link
Contributor

Benchmark results

@rust/hash-graph-benches – Integrations

policy_resolution_large

Function Value Mean Flame graphs
resolve_policies_for_actor user: empty, selectivity: high, policies: 2002 $$27.5 \mathrm{ms} \pm 173 \mathrm{μs}\left({\color{gray}-2.089 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: low, policies: 1 $$3.51 \mathrm{ms} \pm 19.1 \mathrm{μs}\left({\color{gray}-0.856 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: medium, policies: 1001 $$12.5 \mathrm{ms} \pm 82.2 \mathrm{μs}\left({\color{lightgreen}-5.168 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: high, policies: 3314 $$43.9 \mathrm{ms} \pm 324 \mathrm{μs}\left({\color{gray}-2.392 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: low, policies: 1 $$15.0 \mathrm{ms} \pm 101 \mathrm{μs}\left({\color{gray}-4.435 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: medium, policies: 1526 $$24.7 \mathrm{ms} \pm 183 \mathrm{μs}\left({\color{gray}-2.489 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: high, policies: 2078 $$28.4 \mathrm{ms} \pm 171 \mathrm{μs}\left({\color{gray}-2.403 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: low, policies: 1 $$3.80 \mathrm{ms} \pm 18.8 \mathrm{μs}\left({\color{gray}-1.066 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: medium, policies: 1033 $$13.4 \mathrm{ms} \pm 76.6 \mathrm{μs}\left({\color{lightgreen}-9.822 \mathrm{\%}}\right) $$ Flame Graph

policy_resolution_medium

Function Value Mean Flame graphs
resolve_policies_for_actor user: empty, selectivity: high, policies: 102 $$3.89 \mathrm{ms} \pm 20.6 \mathrm{μs}\left({\color{gray}-1.775 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: low, policies: 1 $$3.09 \mathrm{ms} \pm 16.0 \mathrm{μs}\left({\color{gray}-1.501 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: medium, policies: 51 $$3.44 \mathrm{ms} \pm 15.1 \mathrm{μs}\left({\color{gray}-1.536 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: high, policies: 269 $$5.32 \mathrm{ms} \pm 35.4 \mathrm{μs}\left({\color{gray}-0.626 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: low, policies: 1 $$3.66 \mathrm{ms} \pm 18.8 \mathrm{μs}\left({\color{gray}-1.443 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: medium, policies: 107 $$4.28 \mathrm{ms} \pm 26.1 \mathrm{μs}\left({\color{gray}-0.878 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: high, policies: 133 $$4.58 \mathrm{ms} \pm 24.9 \mathrm{μs}\left({\color{gray}-0.357 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: low, policies: 1 $$3.53 \mathrm{ms} \pm 15.3 \mathrm{μs}\left({\color{gray}-1.363 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: medium, policies: 63 $$4.26 \mathrm{ms} \pm 27.9 \mathrm{μs}\left({\color{gray}0.662 \mathrm{\%}}\right) $$ Flame Graph

policy_resolution_none

Function Value Mean Flame graphs
resolve_policies_for_actor user: empty, selectivity: high, policies: 2 $$2.82 \mathrm{ms} \pm 12.3 \mathrm{μs}\left({\color{gray}-0.151 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: low, policies: 1 $$2.77 \mathrm{ms} \pm 12.8 \mathrm{μs}\left({\color{gray}0.043 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: medium, policies: 1 $$2.89 \mathrm{ms} \pm 13.2 \mathrm{μs}\left({\color{gray}-0.272 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: high, policies: 8 $$3.16 \mathrm{ms} \pm 18.4 \mathrm{μs}\left({\color{gray}-0.459 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: low, policies: 1 $$2.95 \mathrm{ms} \pm 13.1 \mathrm{μs}\left({\color{gray}-0.713 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: medium, policies: 3 $$3.27 \mathrm{ms} \pm 20.5 \mathrm{μs}\left({\color{gray}-0.227 \mathrm{\%}}\right) $$ Flame Graph

policy_resolution_small

Function Value Mean Flame graphs
resolve_policies_for_actor user: empty, selectivity: high, policies: 52 $$3.17 \mathrm{ms} \pm 19.0 \mathrm{μs}\left({\color{gray}0.029 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: low, policies: 1 $$2.87 \mathrm{ms} \pm 10.7 \mathrm{μs}\left({\color{gray}-0.443 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: medium, policies: 25 $$3.04 \mathrm{ms} \pm 17.3 \mathrm{μs}\left({\color{gray}-0.409 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: high, policies: 94 $$3.61 \mathrm{ms} \pm 18.8 \mathrm{μs}\left({\color{gray}-1.157 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: low, policies: 1 $$3.14 \mathrm{ms} \pm 12.5 \mathrm{μs}\left({\color{gray}-1.073 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: medium, policies: 26 $$3.37 \mathrm{ms} \pm 15.7 \mathrm{μs}\left({\color{gray}-1.462 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: high, policies: 66 $$3.50 \mathrm{ms} \pm 14.5 \mathrm{μs}\left({\color{gray}-2.355 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: low, policies: 1 $$3.14 \mathrm{ms} \pm 14.9 \mathrm{μs}\left({\color{gray}-0.074 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: medium, policies: 29 $$3.43 \mathrm{ms} \pm 15.4 \mathrm{μs}\left({\color{gray}-1.043 \mathrm{\%}}\right) $$ Flame Graph

read_scaling_complete

Function Value Mean Flame graphs
entity_by_id;one_depth 1 entities $$45.8 \mathrm{ms} \pm 190 \mathrm{μs}\left({\color{gray}-1.123 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;one_depth 10 entities $$82.4 \mathrm{ms} \pm 374 \mathrm{μs}\left({\color{gray}-1.935 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;one_depth 25 entities $$49.5 \mathrm{ms} \pm 223 \mathrm{μs}\left({\color{gray}-0.962 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;one_depth 5 entities $$52.0 \mathrm{ms} \pm 255 \mathrm{μs}\left({\color{gray}-2.359 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;one_depth 50 entities $$62.4 \mathrm{ms} \pm 430 \mathrm{μs}\left({\color{gray}1.47 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;two_depth 1 entities $$47.4 \mathrm{ms} \pm 217 \mathrm{μs}\left({\color{gray}0.559 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;two_depth 10 entities $$418 \mathrm{ms} \pm 1.05 \mathrm{ms}\left({\color{gray}-0.948 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;two_depth 25 entities $$96.3 \mathrm{ms} \pm 429 \mathrm{μs}\left({\color{gray}-0.717 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;two_depth 5 entities $$91.6 \mathrm{ms} \pm 357 \mathrm{μs}\left({\color{gray}0.475 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;two_depth 50 entities $$292 \mathrm{ms} \pm 842 \mathrm{μs}\left({\color{lightgreen}-8.062 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;zero_depth 1 entities $$19.6 \mathrm{ms} \pm 95.1 \mathrm{μs}\left({\color{gray}-1.841 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;zero_depth 10 entities $$20.5 \mathrm{ms} \pm 101 \mathrm{μs}\left({\color{gray}0.075 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;zero_depth 25 entities $$20.4 \mathrm{ms} \pm 86.4 \mathrm{μs}\left({\color{gray}0.395 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;zero_depth 5 entities $$20.4 \mathrm{ms} \pm 102 \mathrm{μs}\left({\color{gray}-0.291 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;zero_depth 50 entities $$24.9 \mathrm{ms} \pm 116 \mathrm{μs}\left({\color{gray}0.159 \mathrm{\%}}\right) $$ Flame Graph

read_scaling_linkless

Function Value Mean Flame graphs
entity_by_id 1 entities $$19.7 \mathrm{ms} \pm 104 \mathrm{μs}\left({\color{gray}-0.668 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 10 entities $$19.6 \mathrm{ms} \pm 99.7 \mathrm{μs}\left({\color{gray}-0.469 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 100 entities $$19.8 \mathrm{ms} \pm 104 \mathrm{μs}\left({\color{gray}0.192 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 1000 entities $$20.1 \mathrm{ms} \pm 108 \mathrm{μs}\left({\color{gray}-0.597 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 10000 entities $$26.0 \mathrm{ms} \pm 185 \mathrm{μs}\left({\color{gray}0.163 \mathrm{\%}}\right) $$ Flame Graph

representative_read_entity

Function Value Mean Flame graphs
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/block/v/1 $$33.9 \mathrm{ms} \pm 282 \mathrm{μs}\left({\color{gray}-3.237 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/book/v/1 $$35.4 \mathrm{ms} \pm 261 \mathrm{μs}\left({\color{gray}0.872 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/building/v/1 $$34.0 \mathrm{ms} \pm 226 \mathrm{μs}\left({\color{gray}-0.476 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/organization/v/1 $$34.5 \mathrm{ms} \pm 332 \mathrm{μs}\left({\color{gray}0.633 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/page/v/2 $$34.6 \mathrm{ms} \pm 309 \mathrm{μs}\left({\color{gray}0.312 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/person/v/1 $$36.1 \mathrm{ms} \pm 279 \mathrm{μs}\left({\color{gray}1.04 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/playlist/v/1 $$33.6 \mathrm{ms} \pm 236 \mathrm{μs}\left({\color{gray}-1.509 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/song/v/1 $$34.7 \mathrm{ms} \pm 303 \mathrm{μs}\left({\color{gray}-2.309 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/uk-address/v/1 $$35.6 \mathrm{ms} \pm 292 \mathrm{μs}\left({\color{gray}-0.314 \mathrm{\%}}\right) $$ Flame Graph

representative_read_entity_type

Function Value Mean Flame graphs
get_entity_type_by_id Account ID: bf5a9ef5-dc3b-43cf-a291-6210c0321eba $$8.70 \mathrm{ms} \pm 51.7 \mathrm{μs}\left({\color{gray}0.837 \mathrm{\%}}\right) $$ Flame Graph

representative_read_multiple_entities

Function Value Mean Flame graphs
entity_by_property traversal_paths=0 0 $$93.3 \mathrm{ms} \pm 543 \mathrm{μs}\left({\color{gray}-0.137 \mathrm{\%}}\right) $$
entity_by_property traversal_paths=255 1,resolve_depths=inherit:1;values:255;properties:255;links:127;link_dests:126;type:true $$145 \mathrm{ms} \pm 669 \mathrm{μs}\left({\color{gray}0.244 \mathrm{\%}}\right) $$
entity_by_property traversal_paths=2 1,resolve_depths=inherit:0;values:0;properties:0;links:0;link_dests:0;type:false $$100 \mathrm{ms} \pm 623 \mathrm{μs}\left({\color{gray}-0.213 \mathrm{\%}}\right) $$
entity_by_property traversal_paths=2 1,resolve_depths=inherit:0;values:0;properties:0;links:1;link_dests:0;type:true $$108 \mathrm{ms} \pm 500 \mathrm{μs}\left({\color{gray}-0.906 \mathrm{\%}}\right) $$
entity_by_property traversal_paths=2 1,resolve_depths=inherit:0;values:0;properties:2;links:1;link_dests:0;type:true $$118 \mathrm{ms} \pm 493 \mathrm{μs}\left({\color{gray}-0.049 \mathrm{\%}}\right) $$
entity_by_property traversal_paths=2 1,resolve_depths=inherit:0;values:2;properties:2;links:1;link_dests:0;type:true $$125 \mathrm{ms} \pm 639 \mathrm{μs}\left({\color{gray}0.474 \mathrm{\%}}\right) $$
link_by_source_by_property traversal_paths=0 0 $$101 \mathrm{ms} \pm 429 \mathrm{μs}\left({\color{gray}-0.213 \mathrm{\%}}\right) $$
link_by_source_by_property traversal_paths=255 1,resolve_depths=inherit:1;values:255;properties:255;links:127;link_dests:126;type:true $$130 \mathrm{ms} \pm 394 \mathrm{μs}\left({\color{gray}0.770 \mathrm{\%}}\right) $$
link_by_source_by_property traversal_paths=2 1,resolve_depths=inherit:0;values:0;properties:0;links:0;link_dests:0;type:false $$109 \mathrm{ms} \pm 549 \mathrm{μs}\left({\color{gray}0.920 \mathrm{\%}}\right) $$
link_by_source_by_property traversal_paths=2 1,resolve_depths=inherit:0;values:0;properties:0;links:1;link_dests:0;type:true $$117 \mathrm{ms} \pm 481 \mathrm{μs}\left({\color{gray}0.104 \mathrm{\%}}\right) $$
link_by_source_by_property traversal_paths=2 1,resolve_depths=inherit:0;values:0;properties:2;links:1;link_dests:0;type:true $$119 \mathrm{ms} \pm 598 \mathrm{μs}\left({\color{gray}0.420 \mathrm{\%}}\right) $$
link_by_source_by_property traversal_paths=2 1,resolve_depths=inherit:0;values:2;properties:2;links:1;link_dests:0;type:true $$118 \mathrm{ms} \pm 460 \mathrm{μs}\left({\color{gray}-0.023 \mathrm{\%}}\right) $$

scenarios

Function Value Mean Flame graphs
full_test query-limited $$137 \mathrm{ms} \pm 411 \mathrm{μs}\left({\color{gray}-1.310 \mathrm{\%}}\right) $$ Flame Graph
full_test query-unlimited $$145 \mathrm{ms} \pm 454 \mathrm{μs}\left({\color{gray}-2.362 \mathrm{\%}}\right) $$ Flame Graph
linked_queries query-limited $$106 \mathrm{ms} \pm 529 \mathrm{μs}\left({\color{gray}-0.575 \mathrm{\%}}\right) $$ Flame Graph
linked_queries query-unlimited $$568 \mathrm{ms} \pm 3.15 \mathrm{ms}\left({\color{gray}-2.467 \mathrm{\%}}\right) $$ Flame Graph

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/apps > hash.design Affects the `hash.design` design site (app) area/deps Relates to third-party dependencies (area) area/libs Relates to first-party libraries/crates/packages (area) type/eng > frontend Owned by the @frontend team

Development

Successfully merging this pull request may close these issues.

2 participants