Skip to content

Frontend: bump Ardupilot Parameter repository submodule#3970

Merged
patrickelectric merged 2 commits into
bluerobotics:masterfrom
Williangalvani:bump_params
Jul 10, 2026
Merged

Frontend: bump Ardupilot Parameter repository submodule#3970
patrickelectric merged 2 commits into
bluerobotics:masterfrom
Williangalvani:bump_params

Conversation

@Williangalvani

@Williangalvani Williangalvani commented Jun 30, 2026

Copy link
Copy Markdown
Member

Summary by Sourcery

Index ArduPilot parameter repository JSON files at build time via a virtual module instead of import-time globbing to avoid bundling file contents and reduce frontend build memory usage.

New Features:

  • Expose a virtual module that provides the list of ArduPilot parameter JSON paths for runtime fetching.

Enhancements:

  • Update the parameters table logic to consume the new virtual index of ArduPilot parameter JSON files instead of using import.meta.glob.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hey - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@github-actions

github-actions Bot commented Jun 30, 2026

Copy link
Copy Markdown

Automated PR Review

0. Summary

  • Verdict: MINOR SUGGESTIONS ✏️

Bumps the ArduPilot-Parameter-Repository submodule and, in the same PR, replaces import.meta.glob('/public/assets/ArduPilot-Parameter-Repository/**/*.json') with a small Vite plugin that exposes just the list of JSON paths via a virtual:ardupilot-param-index module. The rationale (bundling every multi-MB param file into the module graph blows up build memory) is called out in a comment and is a real problem worth avoiding. The virtual paths keep the same /public/assets/... shape the runtime lookup already expects, so the call sites don't otherwise change.

6. Code Quality & Style

  • 6.1 [nit] core/frontend/vite.config.js:61const fs = require('fs') inside load() matches the existing style in this file, but you could hoist it alongside const path = require('path') at the top (already required by the sibling cleanup-ardupilot-files and draco-dev-fix plugins) to avoid re-requiring on every plugin load call. Purely cosmetic.
  • 6.2 [nit] core/frontend/vite.config.js:65-76walk() could be replaced with a single fs.readdirSync(repoDir, { withFileTypes: true, recursive: true }) (Node ≥18). Same behaviour, less code. Optional.

8. Documentation

  • 8.1 [minor] PR title/description only mention the submodule bump, but the substantive change is a 32-line build-time refactor to work around a build-memory issue. That refactor is the interesting change for reviewers and future git blame — consider mentioning it in the PR body (or splitting into two commits: Frontend: avoid bundling ArduPilot param JSONs via a virtual module followed by the submodule bump). If the two are actually coupled (i.e. the newer submodule is what pushed the old approach over the memory limit), a one-line note to that effect would make the intent clear.

9. Nitpicks / Optional

  • 9.1 [nit] core/frontend/src/types/autopilot/parameter-table.ts:134 — pre-existing, not introduced here, but exposed by this change: jsons[0].replace('/public', '') will throw if the virtual index is empty (e.g. submodule not initialised). The prior import.meta.glob had the same failure mode, so this isn't a regression — worth a defensive check the next time this file is touched.

Generated by PR Review Bot. This is advisory, a human reviewer must still approve.

@cursor

cursor Bot commented Jul 7, 2026

Copy link
Copy Markdown

Bugbot is not enabled for this team, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hey - I've left some high level feedback:

  • The virtual ardupilot-param-index plugin currently prefixes paths with /public/..., but files in Vite’s public directory are served from /, so consider dropping the /public segment to avoid broken URLs (e.g. /${path.relative(publicDir, fullPath).split(path.sep).join('/')}).
  • Instead of resolving the public directory via path.resolve(__dirname, 'public') inside the plugin, consider using Vite’s configured publicDir (from config.publicDir or similar) to keep this logic in sync with the build configuration.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The virtual `ardupilot-param-index` plugin currently prefixes paths with `/public/...`, but files in Vite’s `public` directory are served from `/`, so consider dropping the `/public` segment to avoid broken URLs (e.g. `/${path.relative(publicDir, fullPath).split(path.sep).join('/')}`).
- Instead of resolving the `public` directory via `path.resolve(__dirname, 'public')` inside the plugin, consider using Vite’s configured `publicDir` (from `config.publicDir` or similar) to keep this logic in sync with the build configuration.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@patrickelectric patrickelectric merged commit ecd6e9c into bluerobotics:master Jul 10, 2026
14 checks passed
@patrickelectric patrickelectric deleted the bump_params branch July 10, 2026 13:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants