Skip to content

FE-627: Update tsgo/vite/rolldown + better React hooks linting in Petrinaut#8708

Open
kube wants to merge 5 commits intomainfrom
cf/fe-627-update-petrinaut-tech-stack-and-dev-tooling
Open

FE-627: Update tsgo/vite/rolldown + better React hooks linting in Petrinaut#8708
kube wants to merge 5 commits intomainfrom
cf/fe-627-update-petrinaut-tech-stack-and-dev-tooling

Conversation

@kube
Copy link
Copy Markdown
Collaborator

@kube kube commented May 8, 2026

🌟 What is the purpose of this PR?

Update the Petrinaut frontend toolchain and linting after extracting the library.

🔍 What does this change?

  • Upgrades Petrinaut, Refractive, and the Petrinaut website dev tooling around tsgo, Vite, Rolldown, Oxlint, and related packages.
  • Adds shared Oxlint config for React Hooks, React Compiler diagnostics, and React Refresh checks.
  • Fixes Petrinaut React Hooks exhaustive-deps issues surfaced by the new config.

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:

  • do not affect the execution graph

🐾 Next steps

  • Follow up on React Refresh only-export-components refactors in Petrinaut.

🛡 What tests cover this?

  • yarn fix:eslint
  • yarn lint:tsc

❓ How to test this?

  1. Check CI.
  2. Run the Petrinaut lint/typecheck scripts locally.

@vercel
Copy link
Copy Markdown

vercel Bot commented May 8, 2026

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

Project Deployment Actions Updated (UTC)
hash Ready Ready Preview, Comment May 8, 2026 11:34am
hashdotdesign-tokens Ready Ready Preview, Comment May 8, 2026 11:34am
petrinaut Ready Ready Preview, Comment May 8, 2026 11:34am

@cursor
Copy link
Copy Markdown

cursor Bot commented May 8, 2026

PR Summary

Medium Risk
Moderate risk due to dependency upgrades (oxlint/tsgo/vite/rolldown/storybook) and several React hook/effect dependency changes that could alter event listeners or chart update behavior at runtime.

Overview
Introduces a shared oxlint config for React Compiler projects that swaps React Hooks linting to the react-hooks-js plugin, then applies it across Petrinaut, Refractive, and the Petrinaut website.

Upgrades frontend/tooling dependencies (notably @typescript/native-preview/tsgo, oxlint + oxlint-tsgolint, vite, rolldown, rolldown-plugin-dts, and storybook) and updates yarn.lock accordingly.

Fixes/aligns several React hook patterns flagged by stricter linting: adjusts effect dependency arrays and memoization, refactors timeline chart updates to rely on derived data/store length instead of a manual revision prop, and includes small UI/accessibility tweaks (e.g., tabIndex on list rows) plus minor scroll-shadow/viewport recenter behavior changes.

Reviewed by Cursor Bugbot for commit c23120f. Bugbot is set up for automated code reviews on this repo. Configure here.

@github-actions github-actions Bot added 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 area/apps labels May 8, 2026
@augmentcode
Copy link
Copy Markdown

augmentcode Bot commented May 8, 2026

🤖 Augment PR Summary

Summary: This PR updates Petrinaut’s frontend tooling stack and switches to more comprehensive React hooks linting via oxlint’s JS plugin integration.

Changes:

  • Introduced a shared oxlint configuration for React Compiler + hooks rules (.config/oxlint/react-compiler.json) and extended it from Petrinaut-related packages.
  • Upgraded oxlint, oxlint-tsgolint, and TypeScript’s native preview version in affected packages.
  • Upgraded build/dev dependencies in @hashintel/petrinaut (e.g. Rolldown, Storybook, Vite) to newer releases.
  • Adjusted multiple hooks/effects and callbacks across Petrinaut to satisfy stricter hooks linting and avoid unnecessary dependencies.
  • Refined Simulation Timeline’s uPlot lifecycle/data wiring (removing explicit revision prop and syncing via derived data changes).
  • Minor UI/a11y tweak: added tabIndex={-1} to list options in the filterable list subview.

Technical Notes: The new oxlint config disables the built-in React hooks rules and enables eslint-plugin-react-hooks via react-hooks-js, aiming for more precise dependency analysis while working with React 19 + React Compiler constraints.

🤖 Was this summary useful? React with 👍 or 👎

Copy link
Copy Markdown

@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. No suggestions at this time.

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

Copy link
Copy Markdown

@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 1 potential issue.

Fix All in Cursor

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

Reviewed by Cursor Bugbot for commit c23120f. Configure here.

maxZoom: 1.1,
});
}, [reactFlowInstance, petriNetId]);
}, [minZoom, reactFlowInstance, petriNetId]);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Adding minZoom to deps causes viewport reset on resize

High Severity

The fitView effect is intended to center the viewport only on SDCPN load (when petriNetId or reactFlowInstance changes). Adding minZoom to the dependency array causes fitView to re-run whenever minZoom changes. Since minZoom is recalculated inside fitZoomToNodes (which is triggered by useResizeObserver on every container resize), this means every window or panel resize will call fitView, snapping the user's viewport back to show all nodes and overriding any manual panning or zooming.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit c23120f. Configure here.

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

Labels

area/apps 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.

1 participant