Skip to content

Chore/20250811#235

Merged
SvenVw merged 16 commits into
developmentfrom
chore/20250811
Aug 12, 2025
Merged

Chore/20250811#235
SvenVw merged 16 commits into
developmentfrom
chore/20250811

Conversation

@SvenVw
Copy link
Copy Markdown
Collaborator

@SvenVw SvenVw commented Aug 11, 2025

Summary by CodeRabbit

  • Chores

    • Upgraded many dependencies and workspace tooling; standardized package manager to pnpm 10.14.0.
  • New Features

    • Migrated to the router-aware Sentry integration and added build-time reporting hooks for improved tracing.
  • Dev experience

    • Build now always emits sourcemaps to aid debugging.
  • Tests/CI

    • CI workflows updated to use pnpm 10.14.0 for consistent installs and builds.
  • Bug Fixes

    • Removed unused Mapbox CSS imports and simplified feedback UI behavior.

@SvenVw SvenVw self-assigned this Aug 11, 2025
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Aug 11, 2025

🦋 Changeset detected

Latest commit: c6e166a

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@svenvw/fdm-app Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Aug 11, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

Repository-wide dependency and toolchain updates: pnpm bumped from 10.13.1 → 10.14.0 across CI workflows and packageManager fields; multiple package/version bumps in packages; Sentry integration migrated from @sentry/react / @sentry/node to @sentry/react-router with build/runtime changes; Vite config refactored and sourcemaps always enabled.

Changes

Cohort / File(s) Summary
CI: pnpm version bump
.github/workflows/deploy-docs-test.yml, .github/workflows/deploy-docs.yml, .github/workflows/release.yml, .github/workflows/tests.yml
Update pnpm/action-setup@v4 input version from 10.13.110.14.0; no other workflow logic changed.
PackageManager metadata
fdm-app/package.json, fdm-calculator/package.json, fdm-core/package.json, fdm-data/package.json, fdm-docs/package.json, package.json
packageManager fields updated from pnpm@10.13.1pnpm@10.14.0.
App deps refresh
fdm-app/package.json
Multiple dependency/devDependency bumps (React/react-dom 19.1.0→19.1.1, react-router 7.7.0→7.8.0, Sentry packages changed, and others); packageManager set to pnpm@10.14.0.
Core/docs/tooling bumps
fdm-core/package.json, fdm-docs/package.json, pnpm-workspace.yaml
Dependency/devDependency version bumps (e.g., @types/node, fs-extra, @electric-sql/pglite, typedoc, typescript, vite, and catalog entries).
Build config: Vite / Sentry
fdm-app/vite.config.ts, fdm-app/react-router.config.ts
Vite config converted to factory form, conditional Sentry plugin added when SENTRY_AUTH_TOKEN & production, release set, build.sourcemap now always true. Added async buildEnd hook that calls sentryOnBuildEnd when conditions met and logs on error.
Runtime Sentry integration
fdm-app/app/entry.client.tsx, fdm-app/app/entry.server.tsx, fdm-app/instrument.server.mjs, fdm-app/app/root.tsx, fdm-app/app/components/blocks/sidebar/support.tsx
Replaced @sentry/react / @sentry/node with @sentry/react-router; client uses reactRouterTracingIntegration(); server adds getMetaTagTransformer and wrapSentryHandleRequest, default export changed to wrapSentryHandleRequest(handleRequest), streaming now pipes transformed body for tracing; small UI change in feedback button.
Mapbox CSS removal
fdm-app/app/routes/.../fields._index.tsx, fdm-app/app/routes/.../field.$b_id.atlas.tsx
Removed import "mapbox-gl/dist/mapbox-gl.css" from route modules.
Changeset
.changeset/light-bushes-sniff.md
Adds patch-level changeset for @svenvw/fdm-app noting Sentry integration change.

Sequence Diagram(s)

sequenceDiagram
participant Client
participant Router
participant SentryClient as Sentry (client)
Client->>SentryClient: Sentry.init(..., reactRouterTracingIntegration())
Client->>Router: navigate()
Router->>SentryClient: route events traced
Loading
sequenceDiagram
participant Web as Web Request
participant Wrapper as wrapSentryHandleRequest
participant App as handleRequest
participant SentryServer as Sentry (server)
Web->>Wrapper: incoming request
Wrapper->>SentryServer: start trace / annotate
Wrapper->>App: call handleRequest(req)
App-->>Wrapper: Response (streaming body)
Wrapper->>SentryServer: pipe(getMetaTagTransformer(body))
Wrapper-->>Web: traced Response
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested labels

enhancement

Suggested reviewers

  • gerardhros
  • BoraIneviNMI

Poem

I nibbled through versions, tidy and bright,
From ten-point-thirteen to fourteen by night.
Sentry hopped in, router-aware and keen,
Sourcemaps glowing, traces seen.
A small rabbit's update — neat and light 🐇✨


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8c45b37 and c6e166a.

📒 Files selected for processing (6)
  • .changeset/light-bushes-sniff.md (1 hunks)
  • fdm-app/app/components/blocks/sidebar/support.tsx (2 hunks)
  • fdm-app/app/entry.server.tsx (7 hunks)
  • fdm-app/instrument.server.mjs (2 hunks)
  • fdm-app/react-router.config.ts (1 hunks)
  • fdm-app/vite.config.ts (1 hunks)
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chore/20250811

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@codecov
Copy link
Copy Markdown

codecov Bot commented Aug 11, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.86%. Comparing base (49592ab) to head (b7067fd).

Additional details and impacted files
@@             Coverage Diff              @@
##           development     #235   +/-   ##
============================================
  Coverage        92.86%   92.86%           
============================================
  Files               85       85           
  Lines            12889    12889           
  Branches          1294     1294           
============================================
  Hits             11970    11970           
  Misses             917      917           
  Partials             2        2           
Flag Coverage Δ
fdm-calculator 94.57% <ø> (ø)
fdm-core 91.60% <ø> (ø)
fdm-data 94.23% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
.github/workflows/tests.yml (1)

56-56: Tests workflow: pnpm pinned to 10.14.0 across jobs — OK; consider lockfile enforcement

The bumps are consistent. Optional: switch install steps to use pnpm install --frozen-lockfile for reproducible CI installs.

Also applies to: 149-149, 229-229

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 49592ab and e4540af.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (11)
  • .github/workflows/deploy-docs-test.yml (1 hunks)
  • .github/workflows/deploy-docs.yml (1 hunks)
  • .github/workflows/release.yml (1 hunks)
  • .github/workflows/tests.yml (3 hunks)
  • fdm-app/package.json (5 hunks)
  • fdm-calculator/package.json (1 hunks)
  • fdm-core/package.json (3 hunks)
  • fdm-data/package.json (1 hunks)
  • fdm-docs/package.json (2 hunks)
  • package.json (1 hunks)
  • pnpm-workspace.yaml (1 hunks)
🧰 Additional context used
🧠 Learnings (3)
📚 Learning: 2025-05-28T07:57:19.217Z
Learnt from: SvenVw
PR: SvenVw/fdm#147
File: fdm-docs/package.json:39-39
Timestamp: 2025-05-28T07:57:19.217Z
Learning: In pnpm workspaces, the syntax `"typescript": "catalog:"` is valid and correct. It references the version defined in the workspace's catalog section in pnpm-workspace.yaml, allowing consistent dependency versions across packages in a monorepo.

Applied to files:

  • fdm-data/package.json
  • fdm-calculator/package.json
  • pnpm-workspace.yaml
  • fdm-core/package.json
📚 Learning: 2025-05-28T07:57:19.217Z
Learnt from: SvenVw
PR: SvenVw/fdm#147
File: fdm-docs/package.json:39-39
Timestamp: 2025-05-28T07:57:19.217Z
Learning: In pnpm workspaces, the syntax `"typescript": "catalog:"` is valid and correct. It references the version defined in the workspace's catalog section in pnpm-workspace.yaml, allowing consistent dependency versions across packages in a monorepo. The catalog: syntax without a package name is the shorthand for referencing the default catalog.

Applied to files:

  • fdm-data/package.json
  • fdm-calculator/package.json
  • pnpm-workspace.yaml
  • fdm-core/package.json
📚 Learning: 2024-11-25T12:42:32.783Z
Learnt from: SvenVw
PR: SvenVw/fdm#6
File: fdm-app/vite.config.ts:5-9
Timestamp: 2024-11-25T12:42:32.783Z
Learning: In the `fdm-app` project, SvenVw is preparing for migration to Remix v3 and may include type declarations or configurations for v3 features in advance, such as in `vite.config.ts`.

Applied to files:

  • pnpm-workspace.yaml
🔇 Additional comments (20)
fdm-calculator/package.json (1)

64-64: Align packageManager to pnpm 10.14.0 — looks good

Consistent with the repo-wide bump. No functional impact expected.

fdm-data/package.json (1)

60-60: pnpm version bump confirmed

packageManager updated to 10.14.0 to match the workspace and CI. Good.

.github/workflows/deploy-docs.yml (1)

41-41: CI uses pnpm 10.14.0 — consistent with workspace

Pinned version updated correctly in the action setup.

.github/workflows/deploy-docs-test.yml (1)

38-38: Docs test workflow aligned to pnpm 10.14.0

Version pin matches other workflows.

fdm-docs/package.json (1)

29-30: Patch bumps and pnpm version update — LGTM

  • react/react-dom: ^19.1.1 (patch) — low risk, consistent with app.
  • docusaurus-plugin-typedoc/typedoc-plugin-markdown: minor upgrades — OK.
  • packageManager: pnpm@10.14.0 — consistent.
    Note: Continued use of "catalog:" (typedoc/typescript) is correct per workspace catalog.

Also applies to: 36-36, 38-38, 56-56

package.json (1)

28-28: PNPM version consistency verified

  • Root manifest update (@biomejs/biome → ^2.1.4) looks good.
  • All package.json files declare packageManager: "pnpm@10.14.0".
  • Every GitHub workflow uses pnpm/action-setup@v4 with version: 10.14.0.
  • No remaining references to pnpm@10.13.x found.

No further changes needed.

.github/workflows/release.yml (1)

40-40: Release workflow pinned to pnpm 10.14.0 — good

In line with other workflows and manifests.

fdm-core/package.json (4)

54-54: @types/node patch bump looks safe

Patch update within the same major; low risk. No action needed.


57-57: fs-extra patch bump is fine

Patch release, no API changes expected. All good.


67-67: Verify fdm-core build/test with proper dependency install
It looks like the smoke test failed due to a missing dotenvx (and no node_modules in fdm-core). Please ensure that fdm-core’s dependencies are bootstrapped before rerunning the build/test to validate the pglite bump:

Suggested steps from repo root:

  • Install all workspace deps
    pnpm install
  • Ensure fdm-core’s own deps are present
    pnpm install --filter @svenvw/fdm-core
  • Rebuild and retest fdm-core
    pnpm -w -F @svenvw/fdm-core build
    pnpm -w -F @svenvw/fdm-core test
  • Confirm there are no unexpected changes in pglite usage
    rg -n --glob 'fdm-core/**' '@electric-sql/pglite' -A3 -B3

76-76: pnpm version consistency verified

All package.json files are set to "packageManager": "pnpm@10.14.0", and every GitHub Actions workflow under .github/workflows/ uses pnpm/action-setup@v4 with version: 10.14.0. No mismatches found—no further changes needed.

pnpm-workspace.yaml (2)

9-9: dotenvx catalog bump

Looks good. Consumers use dotenvx via “dotenvx run” scripts; patch bump should be transparent.


16-24: All bumped dependencies use catalog: references
Confirmed that in every workspace package (fdm-docs, fdm-data, fdm-core, fdm-app, fdm-calculator), the following libraries are pinned via catalog: with no stray semver versions:

  • better-auth
  • drizzle-orm
  • rollup
  • rollup-plugin-polyfill-node
  • typedoc
  • typedoc-plugin-missing-exports
  • typescript
  • vite

No action required.

fdm-app/package.json (7)

17-17: @hookform/resolvers → 5.2.1 aligns with react-hook-form 7.62

Compatible pair; no issues expected.


48-56: UI/SDK patch/minor bumps (framer-motion, isbot, lucide-react, mapbox-gl, posthog-js)

All look routine. No API changes expected; keep an eye on mapbox-gl minor for style/bundle changes.


60-67: React 19.1.1 and React Router 7.8.0

Patch for React/DOM and minor for Router; versions are aligned across deps/devDeps. Good.


72-80: Misc libs (remix-utils, sonner, zustand) minor/patch

Low risk; approve.


84-86: Dev tooling bumps (React Router dev/fs-routes, @types/react)*

Aligned to runtime versions; type-only changes. Looks good.

Also applies to: 95-96


26-33: No Sentry init or React Email usage changes needed in fdm-app

A quick grep confirms:

  • Sentry is initialized in fdm-app/instrument.server.mjs (using @sentry/node and @sentry/profiling-node) and imported in your Remix entry and root files. The v10 upgrade retains the same init API.
  • There’s no @react-email/* import in fdm-app, so the tailwind/email package bump doesn’t affect this app.

No code changes are required here; the build and runtime I/O remain compatible.


108-108: pnpm 10.14.0: verify your CI pins the same version

All packageManager entries in your package.json files are now set to pnpm@10.14.0, but I didn’t find any GitHub Actions workflows under .github/workflows. Please double-check that your CI system (e.g. GitHub Actions, CircleCI, GitLab CI) installs or pins pnpm 10.14.0, for example by reviewing:

  • .github/workflows/*.yml
  • .circleci/config.yml
  • .gitlab-ci.yml

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (1)
fdm-app/package.json (1)

26-27: Quick scan: @react-email/components & @react-email/tailwind usages intact

I ran the suggested grep across the codebase and confirmed that your email templates import the same primitives (Section, Text, Tailwind) in these files without any missing references:

  • fdm-app/app/components/blocks/email/magic-link.tsx
  • fdm-app/app/components/blocks/email/welcome.tsx
  • fdm-app/app/components/blocks/email/invitation.tsx

The pnpm-lock shows both packages at the intended versions and no unexpected API removals. Please proceed to build or preview your email templates (and run any CI/email‐rendering tests) to ensure there are no compile- or runtime-time regressions with v0.5.0.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e4540af and 50caaab.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (3)
  • fdm-app/package.json (5 hunks)
  • fdm-app/vite.config.ts (1 hunks)
  • pnpm-workspace.yaml (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • pnpm-workspace.yaml
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2024-11-25T12:42:32.783Z
Learnt from: SvenVw
PR: SvenVw/fdm#6
File: fdm-app/vite.config.ts:5-9
Timestamp: 2024-11-25T12:42:32.783Z
Learning: In the `fdm-app` project, SvenVw is preparing for migration to Remix v3 and may include type declarations or configurations for v3 features in advance, such as in `vite.config.ts`.

Applied to files:

  • fdm-app/vite.config.ts
🔇 Additional comments (3)
fdm-app/vite.config.ts (1)

16-16: Gate production source maps and upload hidden maps to Sentry

The current Vite config at fdm-app/vite.config.ts always emits full source maps (sourcemap: true), which increases bundle size and risks exposing your source in prod. In production builds, you should:

  • Use conditional or “hidden” source maps instead of always-on
  • Upload hidden maps to Sentry via the @sentry/vite-plugin rather than serving them publicly

Minimal diff to gate by NODE_ENV:

--- a/fdm-app/vite.config.ts
+++ b/fdm-app/vite.config.ts
@@ build: {
-       sourcemap: true,
+       sourcemap: process.env.NODE_ENV === "development" ? true : "hidden",
        target: "ES2022",
        rollupOptions: { … },
    },

Optionally add Sentry upload:

import { sentryVitePlugin } from "@sentry/vite-plugin";

export default defineConfig({
  plugins: [
    /* other plugins */,
    sentryVitePlugin({
      org: process.env.SENTRY_ORG,
      project: process.env.SENTRY_PROJECT,
      authToken: process.env.SENTRY_AUTH_TOKEN,
      telemetry: false,
    }),
  ],
  build: {
    sourcemap: "hidden",
  },
});

Please verify in your production build artifacts (e.g. after npm run build in fdm-app) that no .map files are publicly served:

find fdm-app/dist -type f -name '*.map'
fdm-app/package.json (2)

17-17: LGTM: react-hook-form and resolvers bumped in lockstep

Keeping these in sync prevents peer/version mismatches and runtime warnings.

Also applies to: 63-63


108-108: All workflows already pinned to pnpm@10.14.0
The RG search confirms every GitHub Actions workflow specifies version: 10.14.0, matching your package.json.

• .github/workflows/tests.yml (lines 56, 149, 229)
• .github/workflows/release.yml (line 40)
• .github/workflows/deploy-docs.yml (line 41)
• .github/workflows/deploy-docs-test.yml (line 38)

No changes required.

Comment thread fdm-app/package.json Outdated
Comment thread fdm-app/package.json
"lucide-react": "^0.525.0",
"mapbox-gl": "^3.13.0",
"lucide-react": "^0.539.0",
"mapbox-gl": "^3.14.0",
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.

💡 Verification agent

🧩 Analysis chain

Mapbox GL 3.14 and proj4 2.19.x — verify worker/css import and ESM import style

  • Ensure client bundles import Mapbox CSS once to avoid styling regressions.
  • In ESM projects, avoid require("proj4"); prefer ESM imports.

Run:

If require("proj4") is found, replace with:

import proj4 from "proj4"

Also applies to: 58-58


🏁 Script executed:

#!/bin/bash
# Verify Mapbox CSS import present
rg -n 'mapbox-gl/dist/mapbox-gl.css' -g '!**/node_modules/**' || echo "Missing Mapbox GL CSS import"

# Flag any CommonJS imports of proj4
rg -n 'require\\(["\\\']proj4["\\\']\\)' -g '!**/node_modules/**' || true

Length of output: 476


🏁 Script executed:

#!/bin/bash
# Re-check CommonJS imports of proj4 with corrected quoting
rg -n "require\\(['\"]proj4['\"]\\)" -g '!**/node_modules/**' || echo "No CommonJS require of proj4 found"

Length of output: 144


Consolidate Mapbox GL CSS import and confirm ESM proj4 usage

  • Confirmed that Mapbox CSS is imported in:
    • fdm-app/app/root.tsx (line 2)
    • fdm-app/app/routes/farm.$b_id_farm.$calendar.field.$b_id.atlas.tsx (line 2)
    • fdm-app/app/routes/farm.$b_id_farm.$calendar.atlas.fields._index.tsx (line 8)
    To avoid duplicate styling, remove the CSS imports from the two route files and keep the single import in app/root.tsx.

  • No CommonJS require("proj4") calls were found in the codebase—ESM imports are already in use, so no changes needed for proj4.

Files to update:

  • Remove import "mapbox-gl/dist/mapbox-gl.css" from
    • fdm-app/app/routes/farm.$b_id_farm.$calendar.field.$b_id.atlas.tsx
    • fdm-app/app/routes/farm.$b_id_farm.$calendar.atlas.fields._index.tsx
🤖 Prompt for AI Agents
In fdm-app/app/routes/farm.$b_id_farm.$calendar.field.$b_id.atlas.tsx (around
line 2) and fdm-app/app/routes/farm.$b_id_farm.$calendar.atlas.fields._index.tsx
(around line 8), remove the duplicate import statement import
"mapbox-gl/dist/mapbox-gl.css" so only the single CSS import in
fdm-app/app/root.tsx remains; simply delete those import lines from the two
route files and ensure no other mapbox CSS imports exist, no changes required
for proj4 as ESM imports are already used.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🔭 Outside diff range comments (3)
.changeset/light-bushes-sniff.md (1)

6-6: Remove stray character from changeset.

There’s an extraneous “6” at EOF that will show up in release notes. Please remove it.

Apply this diff to fix:

-6
+
fdm-app/app/components/blocks/sidebar/support.tsx (1)

36-38: Fix Sentry.getFeedback type usage

I searched all @sentry/* declaration files in node_modules and found no getFeedback export—so ReturnType<typeof Sentry.getFeedback> will cause TS errors. To resolve:

• File: fdm-app/app/components/blocks/sidebar/support.tsx (lines 36–38)
Replace:

const [feedback, setFeedback] = useState<ReturnType<
    typeof Sentry.getFeedback
> | null>(null)

With a structural interface:

interface SentryFeedback {
  appendToDom(): void
  open(): void
}
const [feedback, setFeedback] = useState<SentryFeedback | null>(null)

• Or, if a Feedback type exists in @sentry/react, import it directly:

import type { Feedback as SentryFeedback } from '@sentry/react'
const [feedback, setFeedback] = useState<SentryFeedback | null>(null)

This ensures type safety without relying on an un-exported symbol.

fdm-app/app/entry.server.tsx (1)

25-35: Function return type mismatch: make handleRequest async

handleRequest is typed to return Promise<Response> but returns a bare Response in the redirect branch. Mark it async to satisfy the signature.

-const handleRequest = function handleRequest(
+const handleRequest = async function handleRequest(
🧹 Nitpick comments (6)
.changeset/light-bushes-sniff.md (1)

5-5: Tighten the changeset message (scope and rationale).

Consider clarifying the scope and motivation, e.g. “Migrate Sentry to @sentry/react-router (React Router v7 integration, tracing/profiling alignment).” This helps future readers scanning release notes.

Apply this diff to refine the message:

-Switch to `@sentry/react-router` from `@sentry/react` for better error monitoring
+Migrate Sentry to `@sentry/react-router` (RRv7 integration with improved routing-aware tracing and profiling)
fdm-app/instrument.server.mjs (1)

16-21: Add environment and release metadata to Sentry.init.

Attaching environment and release greatly improves issue triage and source map association.

Apply this diff to enhance initialization:

 Sentry.init({
     dsn: String(process.env.VITE_SENTRY_DSN),
     integrations: [nodeProfilingIntegration()],
     tracesSampleRate: Number(process.env.VITE_SENTRY_TRACE_SAMPLE_RATE),
     profilesSampleRate: Number(process.env.VITE_SENTRY_PROFILE_SAMPLE_RATE),
+    environment: process.env.NODE_ENV ?? "development",
+    release: process.env.npm_package_version
 })
fdm-app/app/components/blocks/sidebar/support.tsx (2)

103-112: Avoid anchor navigation to “#” when opening the feedback form.

Clicking the “Feedback” item navigates to “#” in addition to opening the form. Prefer a pure button to prevent hash navigation.

Apply this diff:

-                        <SidebarMenuItem key="feedback">
-                            <SidebarMenuButton
-                                asChild
-                                size="sm"
-                                onClick={openFeedbackForm}
-                            >
-                                <NavLink to="#">
-                                    <Send />
-                                    <span>Feedback</span>
-                                </NavLink>
-                            </SidebarMenuButton>
-                        </SidebarMenuItem>
+                        <SidebarMenuItem key="feedback">
+                            <SidebarMenuButton size="sm" onClick={openFeedbackForm}>
+                                <Send />
+                                <span>Feedback</span>
+                            </SidebarMenuButton>
+                        </SidebarMenuItem>

82-85: Don’t derive support email from window.hostname.

support@${window.location.hostname} can generate invalid/unroutable addresses (e.g., staging hosts, subdomains). Prefer a configured email.

Options:

  • Use a config value: clientConfig.supportEmail ?? "support@example.com".
  • Or derive from a known base URL domain exposed via runtime config, not the current hostname.
fdm-app/app/entry.client.tsx (1)

21-21: Good: Router-aware tracing integration enabled

Using Sentry.reactRouterTracingIntegration() pairs well with the server’s getMetaTagTransformer and wrapSentryHandleRequest for distributed tracing.

If you want the environment to reflect Vite’s mode reliably, consider using import.meta.env.MODE instead of import.meta.env.NODE_ENV:

environment: import.meta.env.MODE
fdm-app/react-router.config.ts (1)

5-13: Consider failing-soft or logging when build-end upload fails

Right now, any error inside sentryOnBuildEnd will bubble and may fail builds. If that’s undesirable, wrap it in try/catch and log a warning while proceeding.

-    buildEnd: async ({ viteConfig, reactRouterConfig, buildManifest }) => {
-        if (process.env.SENTRY_AUTH_TOKEN !== undefined) {
-            await sentryOnBuildEnd({
-                viteConfig,
-                reactRouterConfig,
-                buildManifest,
-            })
-        }
-    },
+    buildEnd: async ({ viteConfig, reactRouterConfig, buildManifest }) => {
+        if (process.env.SENTRY_AUTH_TOKEN !== undefined) {
+            try {
+                await sentryOnBuildEnd({
+                    viteConfig,
+                    reactRouterConfig,
+                    buildManifest,
+                })
+            } catch (err) {
+                console.warn("Sentry buildEnd hook failed; continuing without blocking the build.", err)
+            }
+        }
+    },
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 50caaab and 8c45b37.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (11)
  • .changeset/light-bushes-sniff.md (1 hunks)
  • fdm-app/app/components/blocks/sidebar/support.tsx (1 hunks)
  • fdm-app/app/entry.client.tsx (2 hunks)
  • fdm-app/app/entry.server.tsx (7 hunks)
  • fdm-app/app/root.tsx (1 hunks)
  • fdm-app/app/routes/farm.$b_id_farm.$calendar.atlas.fields._index.tsx (1 hunks)
  • fdm-app/app/routes/farm.$b_id_farm.$calendar.field.$b_id.atlas.tsx (0 hunks)
  • fdm-app/instrument.server.mjs (1 hunks)
  • fdm-app/package.json (5 hunks)
  • fdm-app/react-router.config.ts (1 hunks)
  • fdm-app/vite.config.ts (1 hunks)
💤 Files with no reviewable changes (1)
  • fdm-app/app/routes/farm.$b_id_farm.$calendar.field.$b_id.atlas.tsx
🧰 Additional context used
🧠 Learnings (13)
📚 Learning: 2025-01-14T16:06:24.294Z
Learnt from: SvenVw
PR: SvenVw/fdm#45
File: fdm-app/app/routes/farm.$b_id_farm._index.tsx:1-1
Timestamp: 2025-01-14T16:06:24.294Z
Learning: In the fdm-app codebase, the `redirect` function should be imported from `react-router`, not `react-router-dom`.

Applied to files:

  • .changeset/light-bushes-sniff.md
  • fdm-app/instrument.server.mjs
  • fdm-app/app/entry.client.tsx
  • fdm-app/app/root.tsx
📚 Learning: 2025-01-14T16:06:21.832Z
Learnt from: SvenVw
PR: SvenVw/fdm#45
File: fdm-app/app/routes/farm.$b_id_farm.settings._index.tsx:1-1
Timestamp: 2025-01-14T16:06:21.832Z
Learning: In the fdm project, `redirect` and other routing utilities should be imported from `react-router` instead of `react-router-dom`.

Applied to files:

  • .changeset/light-bushes-sniff.md
  • fdm-app/instrument.server.mjs
  • fdm-app/app/entry.client.tsx
  • fdm-app/app/root.tsx
📚 Learning: 2025-04-18T13:49:17.029Z
Learnt from: SvenVw
PR: SvenVw/fdm#124
File: fdm-app/app/components/custom/farm/farm-title.tsx:3-3
Timestamp: 2025-04-18T13:49:17.029Z
Learning: In the fdm project, NavLink and other routing components can be imported from either "react-router" or "react-router-dom" as react-router-dom is included in react-router.

Applied to files:

  • .changeset/light-bushes-sniff.md
  • fdm-app/app/components/blocks/sidebar/support.tsx
📚 Learning: 2025-02-19T10:50:50.200Z
Learnt from: SvenVw
PR: SvenVw/fdm#82
File: fdm-app/app/entry.client.tsx:13-13
Timestamp: 2025-02-19T10:50:50.200Z
Learning: Sentry DSN being public in client-side code is not a security concern as per Sentry documentation, but it can be made configurable using Vite's environment variables system with the `VITE_` prefix.

Applied to files:

  • fdm-app/instrument.server.mjs
  • fdm-app/vite.config.ts
  • fdm-app/package.json
📚 Learning: 2024-12-11T12:09:35.540Z
Learnt from: SvenVw
PR: SvenVw/fdm#20
File: fdm-app/tsconfig.json:8-9
Timestamp: 2024-12-11T12:09:35.540Z
Learning: In the `fdm-app/tsconfig.json` file, the include path `.react-router/types/**/*` refers to a build-time generated directory which is intentionally not included in the repository.

Applied to files:

  • fdm-app/app/components/blocks/sidebar/support.tsx
  • fdm-app/app/entry.client.tsx
  • fdm-app/app/root.tsx
  • fdm-app/react-router.config.ts
📚 Learning: 2024-12-16T10:56:07.561Z
Learnt from: SvenVw
PR: SvenVw/fdm#16
File: fdm-app/app/routes/app.addfarm.$b_id_farm.cultivations.$b_lu_catalogue.fertilizers.tsx:1-1
Timestamp: 2024-12-16T10:56:07.561Z
Learning: The project uses `react-router` v7, and the `data` function is exported and used for error handling in loaders and actions.

Applied to files:

  • fdm-app/app/components/blocks/sidebar/support.tsx
📚 Learning: 2024-11-25T14:42:26.660Z
Learnt from: SvenVw
PR: SvenVw/fdm#6
File: fdm-app/app/components/blocks/field-map.tsx:0-0
Timestamp: 2024-11-25T14:42:26.660Z
Learning: In `fdm-app/app/components/blocks/field-map.tsx`, explicit cleanup of Mapbox GL resources is not necessary, as `react-map-gl` handles it automatically upon component unmount, and `MapRef` does not have a `remove` method.

Applied to files:

  • fdm-app/app/routes/farm.$b_id_farm.$calendar.atlas.fields._index.tsx
📚 Learning: 2025-01-09T16:03:37.764Z
Learnt from: SvenVw
PR: SvenVw/fdm#42
File: fdm-app/app/routes/farm/_b_id_farm/layout.tsx:46-95
Timestamp: 2025-01-09T16:03:37.764Z
Learning: A shared layout component `FarmLayoutBase` has been created in `components/custom/farm-layout-base.tsx` to maintain consistency across farm-related pages. The component handles farm selection dropdown, breadcrumb navigation, and provides a common layout structure.

Applied to files:

  • fdm-app/app/routes/farm.$b_id_farm.$calendar.atlas.fields._index.tsx
📚 Learning: 2025-01-31T15:41:43.741Z
Learnt from: SvenVw
PR: SvenVw/fdm#67
File: fdm-app/app/components/custom/atlas/atlas-panels.tsx:28-28
Timestamp: 2025-01-31T15:41:43.741Z
Learning: When handling different map event types in react-map-gl v7.1.8, use MapLayerMouseEvent for mouse events (which have the point property) and ViewStateChangeEvent for view state changes. Use a type guard like 'point' in evt to safely access event-specific properties.

Applied to files:

  • fdm-app/app/routes/farm.$b_id_farm.$calendar.atlas.fields._index.tsx
📚 Learning: 2025-01-31T15:06:35.764Z
Learnt from: SvenVw
PR: SvenVw/fdm#67
File: fdm-app/app/components/custom/atlas/atlas-sources.tsx:21-66
Timestamp: 2025-01-31T15:06:35.764Z
Learning: In react-map-gl components, when querying rendered features via map.queryRenderedFeatures(), the effect's dependency array must include any props that affect the map's rendered state (like source data) to ensure features are queried against the current map state.

Applied to files:

  • fdm-app/app/routes/farm.$b_id_farm.$calendar.atlas.fields._index.tsx
📚 Learning: 2025-06-10T13:10:03.154Z
Learnt from: SvenVw
PR: SvenVw/fdm#161
File: fdm-app/app/components/blocks/field-map.tsx:0-0
Timestamp: 2025-06-10T13:10:03.154Z
Learning: When facing prop name inconsistencies with react-map-gl (like mapboxAccessToken vs mapboxApiAccessToken), using different import statements can resolve the issue more elegantly than changing prop names across multiple files.

Applied to files:

  • fdm-app/app/routes/farm.$b_id_farm.$calendar.atlas.fields._index.tsx
📚 Learning: 2025-01-31T16:06:33.810Z
Learnt from: SvenVw
PR: SvenVw/fdm#67
File: fdm-app/app/routes/farm.create.$b_id_farm.atlas.tsx:164-212
Timestamp: 2025-01-31T16:06:33.810Z
Learning: Map configuration in the application should be modularized using the `useMapConfig` hook and `MapControls` component to maintain consistency across all MapGL instances.

Applied to files:

  • fdm-app/app/routes/farm.$b_id_farm.$calendar.atlas.fields._index.tsx
📚 Learning: 2024-11-25T12:42:32.783Z
Learnt from: SvenVw
PR: SvenVw/fdm#6
File: fdm-app/vite.config.ts:5-9
Timestamp: 2024-11-25T12:42:32.783Z
Learning: In the `fdm-app` project, SvenVw is preparing for migration to Remix v3 and may include type declarations or configurations for v3 features in advance, such as in `vite.config.ts`.

Applied to files:

  • fdm-app/vite.config.ts
  • fdm-app/package.json
🔇 Additional comments (12)
fdm-app/instrument.server.mjs (1)

1-1: All checks passed: SSR integration verified for @sentry/react-router

  • Confirmed wrapSentryHandleRequest is imported and applied in fdm-app/app/entry.server.tsx.
  • No remaining imports from @sentry/react or @sentry/node were found.
  • Client-side feedback integration via Sentry.getFeedback() is in use.
fdm-app/app/components/blocks/sidebar/support.tsx (1)

1-1: LGTM: Sentry import path aligns with the router-aware migration.

Switching to @sentry/react-router here is consistent with the project-wide RRv7 Sentry migration.

fdm-app/app/root.tsx (1)

1-1: LGTM: Sentry import updated to router-aware package.

This aligns with RRv7 and keeps Sentry.captureException usage intact in ErrorBoundary. Also matches prior guidance to use react-router for routing utilities (e.g., redirect).

fdm-app/app/routes/farm.$b_id_farm.$calendar.atlas.fields._index.tsx (1)

11-11: LGTM: Trimmed router imports to what’s used.

Importing only LoaderFunctionArgs and useLoaderData from react-router is correct and removes the unused data helper here.

fdm-app/app/entry.client.tsx (1)

7-7: Migration to @sentry/react-router looks correct

Importing from @sentry/react-router aligns with the rest of the PR and the server-side changes.

fdm-app/react-router.config.ts (1)

2-2: Build-time Sentry hook import is correct

sentryOnBuildEnd import from @sentry/react-router matches the new integration approach.

fdm-app/package.json (3)

30-31: Sentry dependency migration aligns with code changes

Switching to @sentry/react-router (+ keeping @sentry/profiling-node) matches the new integration across the app.


107-107: pnpm manager bump acknowledged

Repository-wide upgrade to pnpm 10.14.0 is consistent.


30-31: Dependency Usage Verified
The @sentry/profiling-node package is still imported in fdm-app/instrument.server.mjs (line 2), so the dependency remains required and should not be removed.

fdm-app/vite.config.ts (1)

49-49: Always-on sourcemaps: OK given conditional upload

With sourcemaps always generated and upload gated by token+production, this matches the intended behavior.

fdm-app/app/entry.server.tsx (2)

155-157: Good: enable distributed tracing in streamed HTML

Using pipe(getMetaTagTransformer(body)) correctly injects distributed tracing metadata.


177-179: Good: wrap default export with Sentry handler

wrapSentryHandleRequest(handleRequest) is the correct pattern for the router integration.

Comment thread fdm-app/vite.config.ts Outdated
Comment thread fdm-app/vite.config.ts Outdated
@SvenVw SvenVw merged commit 9c1d6be into development Aug 12, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file enhancement New feature or request fdm-app fdm-calculator fdm-core fdm-data fdm-docs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant