Skip to content

Vue: Expose docgen provider, inject in manifest and gate behind vue-component-meta only - #35670

Merged
valentinpalkovic merged 4 commits into
julien/vue_project_managerfrom
julien/vue_expeirmental_docgen_provider
Aug 4, 2026
Merged

valentinpalkovic merged 4 commits into
julien/vue_project_managerfrom
julien/vue_expeirmental_docgen_provider

Conversation

@huang-julien

@huang-julien huang-julien commented Jul 30, 2026 •

Copy link
Copy Markdown
Contributor

Closes #

What I did

This pR makes vue renderer exposes dogenProvider and manifest in preset to:

  • provide dogen when docgen is set to vue-omponent-meta and experimentalDogenServer is enabled
  • inject the dogen result in manifest, in the vuecomponentMeta field

Checklist for Contributors

Testing

The changes in this PR are covered in the following automated tests:

  • stories
  • unit tests
  • integration tests
  • end-to-end tests

Manual testing

  • in a vue sandbix
    • manifest feature enabled --- docgen enabled --- vue-component-meta set for the Vue Framework options
      • run a build
        • expect docgen to be in the manifest
        • expect OSA file to contain docgen for each component
      • dev
        • should see different docgen data in the OSA panel
    • manifest feature enabled --- docgen enabled --- vue-docgen-api set for the Vue Framework options
      • should be fully disabled

Caution

This section is mandatory for all contributions. If you believe no manual test is necessary, please state so explicitly. Thanks!

Documentation

  • Add or update documentation reflecting your changes
  • If you are deprecating/removing a feature, make sure to update
    MIGRATION.MD

Checklist for Maintainers

  • When this PR is ready for testing, make sure to add ci:normal, ci:merged or ci:daily GH label to it to run a specific set of sandboxes. The particular set of sandboxes can be found in code/lib/cli-storybook/src/sandbox-templates.ts

  • Declare whether manual QA will be needed for this PR during the next release, through qa:needed or qa:skip

  • Make sure this PR contains one of the labels below:

    Available labels
    • bug: Internal changes that fixes incorrect behavior.
    • maintenance: User-facing maintenance tasks.
    • dependencies: Upgrading (sometimes downgrading) dependencies.
    • build: Internal-facing build tooling & test updates. Will not show up in release changelog.
    • cleanup: Minor cleanup style change. Will not show up in release changelog.
    • documentation: Documentation only changes. Will not show up in release changelog.
    • feature request: Introducing a new feature.
    • BREAKING CHANGE: Changes that break compatibility in some way with current major version.
    • other: Changes that don't fit in the above categories.

🦋 Canary release

This PR does not have a canary release associated. You can request a canary release of this pull request by mentioning the @storybookjs/core team here.

core team members can create a canary release here or locally with gh workflow run --repo storybookjs/storybook publish.yml --field pr=<PR_NUMBER>

@github-actions

github-actions Bot commented Jul 30, 2026 •

Copy link
Copy Markdown
Contributor
Warnings
⚠️

This PR targets julien/vue_project_manager. The default branch for contributions is next. Please make sure you are targeting the correct branch.

Generated by 🚫 dangerJS against a4fdb53

@huang-julien
huang-julien requested a review from a team July 30, 2026 13:22
@huang-julien
huang-julien force-pushed the julien/vue_project_manager branch from 2990f44 to 4a99e43 Compare July 30, 2026 13:26
@huang-julien
huang-julien force-pushed the julien/vue_expeirmental_docgen_provider branch from 5213816 to f1108d9 Compare July 30, 2026 13:26
@coderabbitai

coderabbitai Bot commented Jul 30, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

Changes

Vue docgen service integration

Layer / File(s) Summary
Docgen setup resolution
code/core/src/types/modules/core-common.ts, code/frameworks/vue3-vite/src/docgen/options.ts
The manifest docgen union adds vue-component-meta. Framework options and feature flags resolve into normalized docgen settings and a usesDocgenService flag.
Provider and manifest service hooks
code/frameworks/vue3-vite/src/docgen/preset.ts, code/frameworks/vue3-vite/src/docgen/preset.test.ts
Experimental hooks register the Vue docgen worker and component manifest metadata when the configuration uses vue-component-meta. Tests cover enabled and disabled configurations.
Vite plugin wiring and validation
code/frameworks/vue3-vite/src/preset.ts, code/frameworks/vue3-vite/src/preset.test.ts
The Vite preset skips local docgen plugin registration when the docgen service is active. Tests cover plugin selection and template compilation behavior.

Sequence Diagram(s)

sequenceDiagram
  participant Vue3VitePreset
  participant resolveDocgenSetup
  participant DocgenWorker
  participant ManifestAccumulator
  Vue3VitePreset->>resolveDocgenSetup: resolve docgen and service usage
  resolveDocgenSetup-->>Vue3VitePreset: return service usage flag
  Vue3VitePreset->>DocgenWorker: register worker descriptor
  Vue3VitePreset->>ManifestAccumulator: add component metadata
Loading

Possibly related PRs

✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Fix failing CI checks
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

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

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

@coderabbitai coderabbitai Bot left a comment

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.

🧹 Nitpick comments (1)
code/frameworks/vue3-vite/src/preset.test.ts (1)

9-17: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Use spy mocks configured in beforeEach.

Replace the module factories with vi.mock(path, { spy: true }), import the exported plugins, and implement the async return values through vi.mocked(...) in beforeEach. This follows the Vitest test mocking rule and keeps mock behavior per-case instead of encoded at module scope.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@code/frameworks/vue3-vite/src/preset.test.ts` around lines 9 - 17, Update the
module mocks in preset.test.ts to use Vitest spy mocks via vi.mock with { spy:
true } for the three plugin modules, then import templateCompilation,
vueComponentMeta, and vueDocgen and configure their async return values with
vi.mocked(...) inside beforeEach. Remove the module-scope factory
implementations so each test can control mock behavior independently.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@code/frameworks/vue3-vite/src/preset.test.ts`:
- Around line 9-17: Update the module mocks in preset.test.ts to use Vitest spy
mocks via vi.mock with { spy: true } for the three plugin modules, then import
templateCompilation, vueComponentMeta, and vueDocgen and configure their async
return values with vi.mocked(...) inside beforeEach. Remove the module-scope
factory implementations so each test can control mock behavior independently.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 8d077e92-fc74-4745-b050-e8f590cd9753

📥 Commits

Reviewing files that changed from the base of the PR and between 4a99e43 and f1108d9.

📒 Files selected for processing (6)
  • code/core/src/types/modules/core-common.ts
  • code/frameworks/vue3-vite/src/docgen/options.ts
  • code/frameworks/vue3-vite/src/docgen/preset.test.ts
  • code/frameworks/vue3-vite/src/docgen/preset.ts
  • code/frameworks/vue3-vite/src/preset.test.ts
  • code/frameworks/vue3-vite/src/preset.ts

@valentinpalkovic valentinpalkovic left a comment

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.

Second review pass. For transparency: I paired this with an AI code-quality review (the Cursor "thermo-nuclear code quality review" skill), then filtered it down to only the findings that are genuinely new on top of my earlier comments. A couple are deliberately low-confidence questions rather than blockers - flagged inline. 🙂

Comment thread code/frameworks/vue3-vite/src/docgen/options.ts Outdated
Comment thread code/frameworks/vue3-vite/src/docgen/options.ts Outdated
@huang-julien
huang-julien force-pushed the julien/vue_project_manager branch from 4a99e43 to 5521aa1 Compare July 30, 2026 20:08
@huang-julien
huang-julien force-pushed the julien/vue_expeirmental_docgen_provider branch from f1108d9 to 0056678 Compare July 30, 2026 20:08

@coderabbitai coderabbitai Bot left a comment

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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@code/frameworks/vue3-vite/src/preset.test.ts`:
- Around line 9-17: Update the Vitest mocks for templateCompilation,
vueComponentMeta, and vueDocgen to use vi.mock(modulePath, { spy: true })
instead of factory implementations. Import each factory, access it through
vi.mocked(), and configure its mockResolvedValue plugin object inside beforeEach
so the spies remain type-safe and resettable between tests.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 56388200-f7c0-4ba8-abcf-d90925300100

📥 Commits

Reviewing files that changed from the base of the PR and between f1108d9 and 0056678.

📒 Files selected for processing (6)
  • code/core/src/types/modules/core-common.ts
  • code/frameworks/vue3-vite/src/docgen/options.ts
  • code/frameworks/vue3-vite/src/docgen/preset.test.ts
  • code/frameworks/vue3-vite/src/docgen/preset.ts
  • code/frameworks/vue3-vite/src/preset.test.ts
  • code/frameworks/vue3-vite/src/preset.ts

Comment thread code/frameworks/vue3-vite/src/preset.test.ts Outdated
@huang-julien
huang-julien force-pushed the julien/vue_project_manager branch from 5521aa1 to 01ccf9a Compare July 30, 2026 20:21
@huang-julien
huang-julien force-pushed the julien/vue_expeirmental_docgen_provider branch 3 times, most recently from 1604c2e to 6ff1624 Compare July 31, 2026 09:45
@huang-julien
huang-julien force-pushed the julien/vue_project_manager branch from 1c94c86 to 8d33d89 Compare July 31, 2026 15:53
@huang-julien
huang-julien force-pushed the julien/vue_expeirmental_docgen_provider branch 2 times, most recently from 09d0d85 to 5e0e9ec Compare August 3, 2026 13:45
@huang-julien
huang-julien force-pushed the julien/vue_project_manager branch 2 times, most recently from 7d92b8e to 388f139 Compare August 3, 2026 13:56
@huang-julien
huang-julien force-pushed the julien/vue_expeirmental_docgen_provider branch from 5e0e9ec to 2c2eea5 Compare August 3, 2026 13:56
@huang-julien
huang-julien force-pushed the julien/vue_project_manager branch from 388f139 to e2269f5 Compare August 3, 2026 13:59
@huang-julien
huang-julien force-pushed the julien/vue_expeirmental_docgen_provider branch from 2c2eea5 to 519ce07 Compare August 3, 2026 13:59
@huang-julien huang-julien added feature request vue vue3 ci:normal Run our default set of CI jobs (choose this for most PRs). qa:needed Pull Requests that will need manual QA prior to release. labels Aug 3, 2026
@huang-julien
huang-julien force-pushed the julien/vue_expeirmental_docgen_provider branch 2 times, most recently from 4a29d7e to 2c2eea5 Compare August 3, 2026 17:28
Comment thread code/frameworks/vue3-vite/src/docgen/options.ts Outdated
Comment thread code/frameworks/vue3-vite/src/docgen/preset.ts Outdated
@huang-julien
huang-julien force-pushed the julien/vue_project_manager branch from 77c16ed to 7b02459 Compare August 3, 2026 18:02
@huang-julien
huang-julien force-pushed the julien/vue_expeirmental_docgen_provider branch 4 times, most recently from e48866e to bb9b741 Compare August 4, 2026 07:15
@huang-julien
huang-julien force-pushed the julien/vue_project_manager branch from bd9a59b to df12640 Compare August 4, 2026 08:24
@huang-julien
huang-julien force-pushed the julien/vue_expeirmental_docgen_provider branch from a0187b6 to a752a56 Compare August 4, 2026 08:24
@valentinpalkovic
valentinpalkovic merged commit f72e4de into julien/vue_project_manager Aug 4, 2026
11 checks passed
@valentinpalkovic
valentinpalkovic deleted the julien/vue_expeirmental_docgen_provider branch August 4, 2026 10:24
@coderabbitai coderabbitai Bot mentioned this pull request Aug 18, 2026
9 tasks
@JReinhold JReinhold added qa:skip Pull Requests that do not need any QA. (e.g. documentation) and removed qa:needed Pull Requests that will need manual QA prior to release. labels Aug 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:normal Run our default set of CI jobs (choose this for most PRs). feature request qa:skip Pull Requests that do not need any QA. (e.g. documentation) vue vue3

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants