Skip to content

Conversation

@dwgray
Copy link
Member

@dwgray dwgray commented Sep 29, 2025

Describe the PR

While investigating #2860 I noticed that the way we have our test app structured doesn’t work if you wanted to import useModal or and of the other composables that depend on being contained by the BApp

This is one way to fix the issue. Another would be to add a component below our App and do the testing in the component (that’s basically what our template for bug reports does).

This seemed a little easier for day-to-day work, but happy to implement the other if anyone has a strong preference.

Small replication

Import useModal in our test app and you’ll see an error that it must be contained.

PR checklist

What kind of change does this PR introduce? (check at least one)

  • Bugfix 🐛 - fix(…)
  • Feature - feat(…)
  • ARIA accessibility - fix(…)
  • Documentation update - docs(…)
  • Other (please describe)

The PR fulfills these requirements:

  • Pull request title and all commits follow the Conventional Commits convention or has an override in this pull request body This is very important, as the CHANGELOG is generated from these messages, and determines the next version type. Pull requests that do not follow conventional commits or do not have an override will be denied

Summary by CodeRabbit

  • Refactor
    • Updated app initialization to wrap the root component with the application container, improving consistency of global layout and directives.
    • Moved the application wrapper from the internal app component to the bootstrap layer for cleaner composition and easier maintenance.
    • No user-facing behavior changes; existing routing and features continue to work as before.

Copilot AI review requested due to automatic review settings September 29, 2025 17:40
@bolt-new-by-stackblitz
Copy link

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@coderabbitai
Copy link

coderabbitai bot commented Sep 29, 2025

Walkthrough

BApp usage was removed from App.vue and reintroduced at the bootstrap level. main.ts now defines a Wrapper component that renders BApp as the root and places App in its default slot, then mounts Wrapper. Imports were adjusted accordingly, and BApp is now exported from ./index.

Changes

Cohort / File(s) Summary
App structure update
packages/bootstrap-vue-next/src/App.vue
Removed BApp wrapper from template and its import; template now renders BContainer > BRow > BCol directly.
Bootstrap and mounting flow
packages/bootstrap-vue-next/src/main.ts
Added Wrapper component that renders BApp and nests App via default slot; imports updated to include BApp; app mounts Wrapper instead of App.
Public export surface
./index
Added export of BApp.

Sequence Diagram(s)

sequenceDiagram
    autonumber
    actor User
    participant Browser
    participant VueApp as Vue App (Wrapper)
    participant BApp as BApp (Root)
    participant App as App (Content)

    User->>Browser: Load page
    Browser->>VueApp: Create and mount Wrapper
    VueApp->>BApp: Render BApp as root
    BApp->>App: Render App in default slot
    App-->>BApp: Provide content (BContainer/BRow/BCol)
    BApp-->>VueApp: Composed root hierarchy ready
    VueApp-->>Browser: Mounted application
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

I hopped through slots with nimble cheer,
Moved roots around without a fear.
BApp now wraps the scene just right,
While App keeps shining, lean and light.
Thump-thump! The mount is snug and tight—
A tidy warren, built to delight. 🐇✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Description Check ⚠️ Warning The pull request description follows the template structure well with all required sections present and filled out meaningfully. The description clearly explains the problem being solved, provides context from issue #2860, discusses an alternative approach, and includes a replication case. The PR checklist correctly identifies this as a bugfix. However, the critical Conventional Commits requirement checkbox remains unchecked, which the template explicitly states is "very important" for CHANGELOG generation and version determination, and notes that PRs not following this "will be denied." The author should check the Conventional Commits checkbox to confirm that the pull request title and commits follow the Conventional Commits convention. The title already follows the correct format (fix(BApp): ...), so this appears to be an oversight in not marking the checkbox. Once verified that all commits follow this convention, the checkbox should be updated to indicate compliance with this critical requirement.
✅ Passed checks (2 passed)
Check name Status Explanation
Title Check ✅ Passed The pull request title accurately describes the primary change in the changeset. The title states that the test app is being wrapped in BApp within main.ts, which aligns precisely with the code changes shown in the raw summary where main.ts introduces a Wrapper component that renders BApp as the root and nests the original App inside it. The title also clearly explains the purpose—enabling easy verification of useModal and other composables that require BApp containment—which matches the PR objectives and the described problem being solved.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 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 6685308 and a7a7ceb.

📒 Files selected for processing (2)
  • packages/bootstrap-vue-next/src/App.vue (1 hunks)
  • packages/bootstrap-vue-next/src/main.ts (2 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
packages/bootstrap-vue-next/src/App.vue

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Use packages/bootstrap-vue-next/src/App.vue as a local test area for component changes

Files:

  • packages/bootstrap-vue-next/src/App.vue
🧠 Learnings (6)
📓 Common learnings
Learnt from: CR
PR: bootstrap-vue-next/bootstrap-vue-next#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-09-12T14:46:49.416Z
Learning: Applies to packages/bootstrap-vue-next/src/App.vue : Use packages/bootstrap-vue-next/src/App.vue as a local test area for component changes
Learnt from: CR
PR: bootstrap-vue-next/bootstrap-vue-next#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-09-12T14:46:49.416Z
Learning: Applies to packages/bootstrap-vue-next/src/styles/styles.scss : Use packages/bootstrap-vue-next/src/styles/styles.scss as the main styles entry point
Learnt from: CR
PR: bootstrap-vue-next/bootstrap-vue-next#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-09-12T14:46:49.416Z
Learning: Applies to packages/bootstrap-vue-next/src/components/index.ts : When adding a new component, update packages/bootstrap-vue-next/src/components/index.ts to export it
📚 Learning: 2025-09-12T14:46:49.416Z
Learnt from: CR
PR: bootstrap-vue-next/bootstrap-vue-next#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-09-12T14:46:49.416Z
Learning: Applies to packages/bootstrap-vue-next/src/App.vue : Use packages/bootstrap-vue-next/src/App.vue as a local test area for component changes

Applied to files:

  • packages/bootstrap-vue-next/src/main.ts
  • packages/bootstrap-vue-next/src/App.vue
📚 Learning: 2025-09-12T14:46:49.416Z
Learnt from: CR
PR: bootstrap-vue-next/bootstrap-vue-next#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-09-12T14:46:49.416Z
Learning: Applies to packages/bootstrap-vue-next/src/components/index.ts : When adding a new component, update packages/bootstrap-vue-next/src/components/index.ts to export it

Applied to files:

  • packages/bootstrap-vue-next/src/main.ts
  • packages/bootstrap-vue-next/src/App.vue
📚 Learning: 2025-09-12T14:46:49.416Z
Learnt from: CR
PR: bootstrap-vue-next/bootstrap-vue-next#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-09-12T14:46:49.416Z
Learning: Applies to packages/bootstrap-vue-next/src/components/** : Create and modify Vue components only under packages/bootstrap-vue-next/src/components/

Applied to files:

  • packages/bootstrap-vue-next/src/main.ts
  • packages/bootstrap-vue-next/src/App.vue
📚 Learning: 2025-09-12T14:46:49.416Z
Learnt from: CR
PR: bootstrap-vue-next/bootstrap-vue-next#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-09-12T14:46:49.416Z
Learning: Applies to packages/bootstrap-vue-next/src/styles/styles.scss : Use packages/bootstrap-vue-next/src/styles/styles.scss as the main styles entry point

Applied to files:

  • packages/bootstrap-vue-next/src/main.ts
  • packages/bootstrap-vue-next/src/App.vue
📚 Learning: 2025-09-12T14:46:49.416Z
Learnt from: CR
PR: bootstrap-vue-next/bootstrap-vue-next#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-09-12T14:46:49.416Z
Learning: Applies to packages/bootstrap-vue-next/src/components/**/*.vue : Keep component-specific styles within their respective .vue single-file components

Applied to files:

  • packages/bootstrap-vue-next/src/main.ts
  • packages/bootstrap-vue-next/src/App.vue
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: build
🔇 Additional comments (4)
packages/bootstrap-vue-next/src/App.vue (1)

2-12: LGTM! Clean removal of BApp wrapper.

The changes correctly remove the BApp wrapper from the test app template and update the imports accordingly. This aligns with the PR objective to move BApp containment to the bootstrap level in main.ts, enabling composables like useModal to work properly in the test environment.

packages/bootstrap-vue-next/src/main.ts (3)

46-51: Clean implementation of the BApp wrapper.

The Wrapper component elegantly achieves the PR objective by wrapping the App in BApp at the bootstrap level. This enables composables like useModal that require BApp containment to work in the test environment.

The inline component definition using h() is appropriate for this bootstrap-level wrapper and keeps the code concise.


53-53: LGTM! Bootstrap change maintains existing functionality.

Mounting Wrapper instead of App directly is the correct approach. The router and directives are still properly applied before mounting, so existing functionality is preserved while achieving the BApp containment requirement.


5-5: BApp export verified successfully.

The export chain has been confirmed:

  • BApp.vueBApp/index.ts exports {default as BApp}
  • components/index.ts re-exports via export * from './BApp'
  • Main index.ts re-exports via export * from './components'

The import statement import {BApp, Directives} from './index' is correct and will work as expected.


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

Tip

🧪 Early access (models): enabled

We are currently testing Sonnet 4.5 code review models, which should lead to better review quality. However, this model may result in higher noise levels in the review comments. Please disable the early access features if the noise level causes any inconvenience.

Note:

  • Public repositories are always opted into early access features.
  • You can enable or disable early access features from the CodeRabbit UI or by updating the CodeRabbit configuration file.

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

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes the test app structure to enable proper testing of composables like useModal that require being wrapped in a BApp component. The change moves the BApp wrapper from App.vue to main.ts, creating a wrapper component that renders the main app inside BApp.

Key changes:

  • Restructures the test app to wrap the entire application in BApp at the root level
  • Enables testing of composables that depend on BApp context (like useModal)
  • Maintains the same functionality while improving developer experience

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
packages/bootstrap-vue-next/src/main.ts Creates a wrapper component that renders App inside BApp and uses it as the root component
packages/bootstrap-vue-next/src/App.vue Removes BApp wrapper and import since it's now handled at the application level

@pkg-pr-new
Copy link

pkg-pr-new bot commented Sep 29, 2025

bsvn-vite-ts

npm i https://pkg.pr.new/bootstrap-vue-next/bootstrap-vue-next@2865
npm i https://pkg.pr.new/bootstrap-vue-next/bootstrap-vue-next/@bootstrap-vue-next/nuxt@2865

commit: a7a7ceb

@VividLemon VividLemon merged commit d7d3476 into bootstrap-vue-next:main Oct 1, 2025
5 checks passed
@github-actions github-actions bot mentioned this pull request Oct 1, 2025
xvaara added a commit to xvaara/bootstrap-vue-next that referenced this pull request Oct 11, 2025
* upstream/main:
  chore: release main (bootstrap-vue-next#2868)
  fix(useModalOrchestrator): circular dependency (bootstrap-vue-next#2874)
  docs(BModal): Parity pass (bootstrap-vue-next#2866)
  docs: Enable directly loading examples into StackBlitz (bootstrap-vue-next#2869)
  fix(BApp): wrap our test app in BApp in main.ts to enable easy verification of useModal, etc. (bootstrap-vue-next#2865)
  export useScrollLock() (bootstrap-vue-next#2854)
  chore: release main (bootstrap-vue-next#2858)
  fix(BToggle): stop looking for missing targets after directive is unmounted (bootstrap-vue-next#2857)
  chore: release main (bootstrap-vue-next#2851)
  Fix modal transition delays by making TransitionGroup name conditional (bootstrap-vue-next#2845)
  chore: release main (bootstrap-vue-next#2842)
  fix(BTable): events being wrongly stopped when sent from elements inside TRs (bootstrap-vue-next#2841)
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