Skip to content

fix(FR-2606): replace webpackIgnore with @vite-ignore in dynamic plugin imports#6879

Merged
graphite-app[bot] merged 1 commit intomainfrom
04-21-fix_fr-2606_replace_webpackignore_with_vite-ignore_in_dynamic_plugin_imports
Apr 30, 2026
Merged

fix(FR-2606): replace webpackIgnore with @vite-ignore in dynamic plugin imports#6879
graphite-app[bot] merged 1 commit intomainfrom
04-21-fix_fr-2606_replace_webpackignore_with_vite-ignore_in_dynamic_plugin_imports

Conversation

@nowgnuesLee
Copy link
Copy Markdown
Contributor

@nowgnuesLee nowgnuesLee commented Apr 22, 2026

Resolves #6809(FR-2606)

Summary

Dev-server warning spam noticed after the Vite cutover:

[vite] (client) warning:
  .../PluginLoader.tsx:75
    await import(/* webpackIgnore: true */ pluginUrl);
  The above dynamic import cannot be analyzed by Vite.

Two dynamic-import call sites loaded a runtime-computed URL and tagged it with /* webpackIgnore: true */, the CRA/Webpack magic comment that opted out of static analysis. Vite doesn't recognise it, so it defaults to "can't analyse" and warns on every dev rebuild (plus wastes cycles trying to pre-bundle a spec it can't resolve).

Fix: replace /* webpackIgnore: true */ with /* @vite-ignore */ (Vite's equivalent). Runtime behaviour is unchanged — plugins still load fine.

Sites fixed:

  • react/src/components/PluginLoader.tsx: page-plugin loader for paths under /dist/plugins/*.js
  • react/src/components/LoginView.tsx: login-plugin loader that pulls from ../../../src/plugins/<name>

Verification

  • grep -r 'webpackIgnore' react/src → zero value-level hits; only comments that explain the rename
  • vite:dev no longer warns about un-analysable dynamic imports from these files
  • Plugin loading still works at runtime

Stack

Top of the stack. This is the final fix bundled from end-to-end verification; reviewing this PR gives a good summary of the whole Vite migration series (the "Stack" section above in the PR lists all 11 PRs in order).

Copy link
Copy Markdown
Contributor Author

nowgnuesLee commented Apr 22, 2026


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • flow:merge-queue - adds this PR to the back of the merge queue
  • flow:hotfix - for urgent changes, fast-track this PR to the front of the merge queue

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has required the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@github-actions github-actions Bot added the size:S 10~30 LoC label Apr 22, 2026
@nowgnuesLee nowgnuesLee force-pushed the 04-21-fix_fr-2606_replace_global.packageversion_with_globalthis.packageversion_in_webuisider branch from ac2e78d to 4afa90d Compare April 27, 2026 13:57
@nowgnuesLee nowgnuesLee force-pushed the 04-21-fix_fr-2606_replace_webpackignore_with_vite-ignore_in_dynamic_plugin_imports branch from 2b59a1b to 4147197 Compare April 27, 2026 13:57
@nowgnuesLee nowgnuesLee marked this pull request as ready for review April 28, 2026 04:25
Copilot AI review requested due to automatic review settings April 28, 2026 04:25
@nowgnuesLee nowgnuesLee force-pushed the 04-21-fix_fr-2606_replace_webpackignore_with_vite-ignore_in_dynamic_plugin_imports branch 2 times, most recently from f3317ab to 91d8e0d Compare April 28, 2026 05:15
@nowgnuesLee nowgnuesLee force-pushed the 04-21-fix_fr-2606_replace_global.packageversion_with_globalthis.packageversion_in_webuisider branch from 47b0844 to 71a5bf7 Compare April 28, 2026 05:19
@nowgnuesLee nowgnuesLee force-pushed the 04-21-fix_fr-2606_replace_webpackignore_with_vite-ignore_in_dynamic_plugin_imports branch from 91d8e0d to 7223909 Compare April 28, 2026 05:19
@nowgnuesLee nowgnuesLee force-pushed the 04-21-fix_fr-2606_replace_global.packageversion_with_globalthis.packageversion_in_webuisider branch from 71a5bf7 to fa7e95d Compare April 28, 2026 05:25
@nowgnuesLee nowgnuesLee force-pushed the 04-21-fix_fr-2606_replace_webpackignore_with_vite-ignore_in_dynamic_plugin_imports branch from 7223909 to ac5909d Compare April 28, 2026 05:25
@nowgnuesLee nowgnuesLee force-pushed the 04-21-fix_fr-2606_replace_global.packageversion_with_globalthis.packageversion_in_webuisider branch from fa7e95d to 5f1405f Compare April 28, 2026 05:28
@nowgnuesLee nowgnuesLee force-pushed the 04-21-fix_fr-2606_replace_webpackignore_with_vite-ignore_in_dynamic_plugin_imports branch from ac5909d to 0d2caed Compare April 28, 2026 05:28
@yomybaby yomybaby force-pushed the 04-21-fix_fr-2606_replace_global.packageversion_with_globalthis.packageversion_in_webuisider branch from 5f1405f to cdc4e8a Compare April 30, 2026 12:08
@yomybaby yomybaby force-pushed the 04-21-fix_fr-2606_replace_webpackignore_with_vite-ignore_in_dynamic_plugin_imports branch from 0d2caed to a4205c8 Compare April 30, 2026 12:08
@graphite-app
Copy link
Copy Markdown

graphite-app Bot commented Apr 30, 2026

Merge activity

…in imports (#6879)

Resolves #6809(FR-2606)

## Summary

Dev-server warning spam noticed after the Vite cutover:

```
[vite] (client) warning:
  .../PluginLoader.tsx:75
    await import(/* webpackIgnore: true */ pluginUrl);
  The above dynamic import cannot be analyzed by Vite.
```

Two dynamic-import call sites loaded a runtime-computed URL and tagged it with `/* webpackIgnore: true */`, the CRA/Webpack magic comment that opted out of static analysis. Vite doesn't recognise it, so it defaults to "can't analyse" and warns on every dev rebuild (plus wastes cycles trying to pre-bundle a spec it can't resolve).

**Fix**: replace `/* webpackIgnore: true */` with `/* @vite-ignore */` (Vite's equivalent). Runtime behaviour is unchanged — plugins still load fine.

**Sites fixed**:
- `react/src/components/PluginLoader.tsx`: page-plugin loader for paths under `/dist/plugins/*.js`
- `react/src/components/LoginView.tsx`: login-plugin loader that pulls from `../../../src/plugins/<name>`

## Verification

- [x] `grep -r 'webpackIgnore' react/src` → zero value-level hits; only comments that explain the rename
- [x] `vite:dev` no longer warns about un-analysable dynamic imports from these files
- [x] Plugin loading still works at runtime

## Stack

Top of the stack. This is the final fix bundled from end-to-end verification; reviewing this PR gives a good summary of the whole Vite migration series (the "Stack" section above in the PR lists all 11 PRs in order).
@graphite-app graphite-app Bot force-pushed the 04-21-fix_fr-2606_replace_global.packageversion_with_globalthis.packageversion_in_webuisider branch from cdc4e8a to 6683df9 Compare April 30, 2026 12:17
@graphite-app graphite-app Bot force-pushed the 04-21-fix_fr-2606_replace_webpackignore_with_vite-ignore_in_dynamic_plugin_imports branch from a4205c8 to c303197 Compare April 30, 2026 12:18
graphite-app Bot pushed a commit that referenced this pull request Apr 30, 2026
Resolves #7064(FR-2744)

## Summary

FR-2611 dropped `ArtiomTr/jest-coverage-report-action` (Jest-only) when CI moved to Vitest, so PRs lost the coverage diff comment and inline test-failure annotations. This restores the equivalent surface using `davelosert/vitest-coverage-report-action@v2`.

### Local setup
- Add `@vitest/coverage-v8@^4.1.4` as devDependency in `react/`, `packages/backend.ai-ui/`, root.
- Coverage block in each `vitest.config.ts`:
  - `provider: 'v8'` — uses Node's V8 inspector, no Babel transform needed (fastest provider).
  - `reporter: ['text', 'json', 'json-summary', 'html']` — `json-summary` is what the GitHub Action consumes; `text` keeps a console summary; `html` lets devs open `coverage/index.html` locally.
  - `exclude` patterns trim test files, stories, generated Relay artifacts, and zero-logic entries (`src/index.tsx`, `reportWebVitals`, BUI locale catalog, `wsproxy`, bundled `backend.ai-client-node.*`).
- `/coverage` added to `packages/backend.ai-ui/.gitignore` (root and react/ already had it).

### CI setup
- `.github/workflows/vitest.yml` gains `pull-requests: write` permission so the action can post / update its PR comment.
- Each of the three jobs (`react-vitest`, `backend-ai-ui-vitest`, `root-vitest`) runs `pnpm exec vitest run --coverage` and follows it with a `davelosert/vitest-coverage-report-action@v2` step keyed by a unique `name:` so the three PR comments don't collide.
- The action runs with `if: always()` so a coverage comment posts even when tests fail (matches the prior Jest behaviour, which surfaced failed-test annotations).

## Verification

```
=== react/   ===  Lines 7.23%  (1645/22722)
=== BUI      ===  Lines 7.91%  (317/4006)
=== root     ===  Lines 3.66%  (282/7703)
```

- [x] All three workspaces produce `coverage/coverage-summary.json` in the shape the action expects
- [x] Test pass counts unchanged (react 856/856, BUI 315 + 5 skip, root 90 + 1 skip)
- [x] No regression in lint / format

## Out of scope

- **No coverage threshold gates** — baseline %s above are intentionally low (mostly UI code without unit tests). Gating now would block normal PRs. A separate decision on thresholds belongs to a follow-up after the team agrees on a target.
- README coverage badge.
- Backfilling the 6 `TODO(FR-2609)` skipped tests.

## Stack

Top of the Vite migration stack (now 12 PRs). Builds on PR #6879 (`fix(FR-2606)` webpackIgnore → @vite-ignore).
Base automatically changed from 04-21-fix_fr-2606_replace_global.packageversion_with_globalthis.packageversion_in_webuisider to main April 30, 2026 12:33
@graphite-app graphite-app Bot merged commit c303197 into main Apr 30, 2026
7 of 8 checks passed
@graphite-app graphite-app Bot deleted the 04-21-fix_fr-2606_replace_webpackignore_with_vite-ignore_in_dynamic_plugin_imports branch April 30, 2026 12:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S 10~30 LoC

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Vite PoC Phase 1: dev server + HMR parity for react/ and backend.ai-ui

1 participant