fix(vue3-bridge): resolved remote component prop handling and root container attribute passing #3562
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Fixed several issues:
Resolved inconsistencies in naming between
name
andmoduleName
to align with the type defined inpackages/bridge/bridge-shared/src/type.ts
. This also fixed an issue wherename
was being passed to the remote component, and if it was<router-view>
, it caused rendering issues.Issue: When passing props from a Vue 3 host application to a Vue 3 remote application created with
createRemoteComponent
, the props were being applied as attributes on the root container instead of being passed to the remote component.Fix: Set
inheritAttrs: false
inremoteApp.tsx
and explicitly pass all attributes to the remote component usinguseAttrs()
.Added a
rootAttrs
parameter tocreateRemoteComponent
to allow passing attributes to the root container where the remote application is mounted. This enables setting classes, identifiers, and other attributes for the container element.Related Issue
Following up on: #3462 (comment)
Types of changes
Checklist