feat(react,vue): add RowDetail portal/teleport host context propagation#2602
Draft
ghiscoding wants to merge 2 commits into
Draft
feat(react,vue): add RowDetail portal/teleport host context propagation#2602ghiscoding wants to merge 2 commits into
ghiscoding wants to merge 2 commits into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2602 +/- ##
=======================================
Coverage 100.0% 100.0%
=======================================
Files 199 199
Lines 25168 25170 +2
Branches 8908 8909 +1
=======================================
+ Hits 25168 25170 +2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
angular-slickgrid
aurelia-slickgrid
slickgrid-react
slickgrid-vue
@slickgrid-universal/angular-row-detail-plugin
@slickgrid-universal/aurelia-row-detail-plugin
@slickgrid-universal/react-row-detail-plugin
@slickgrid-universal/vue-row-detail-plugin
@slickgrid-universal/binding
@slickgrid-universal/common
@slickgrid-universal/composite-editor-component
@slickgrid-universal/custom-footer-component
@slickgrid-universal/custom-tooltip-plugin
@slickgrid-universal/empty-warning-component
@slickgrid-universal/event-pub-sub
@slickgrid-universal/excel-export
@slickgrid-universal/graphql
@slickgrid-universal/odata
@slickgrid-universal/pagination-component
@slickgrid-universal/pdf-export
@slickgrid-universal/row-detail-view-plugin
@slickgrid-universal/rxjs-observable
@slickgrid-universal/sql
@slickgrid-universal/text-export
@slickgrid-universal/utils
@slickgrid-universal/vanilla-bundle
@slickgrid-universal/vanilla-force-bundle
commit: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
vibe coded with copilot using Claude Sonnet 4.6
Summary
Adds opt-in
RowDetailPortalHost(React) andRowDetailTeleportHost(Vue) companion components that keep row detail panels inside the framework's component tree, giving them full access to providers that were previously unreachable.Problem
Both plugins previously rendered each row detail in an isolated root outside the main app tree:
createRoot()was called per row, breakinguseContext, Redux, Zustand, etc., and producing a dev-mode console warning on every render (documented in the source code).createApp()was called per row, isolating it fromprovide/inject, Pinia, and Vue Router. The DOM was also moved manually via a tempdiv, which was a workaround for the same problem.Solution
React —
RowDetailPortalHostA companion React component that uses
ReactDOM.createPortalto render each open row detail into its slickgrid containerdiv, while keeping the component inside the app's React tree.Vue —
RowDetailTeleportHostA companion Vue component that uses the built-in
<Teleport>directive to render each open row detail into its slickgrid container element, while keeping it inside the Vue component tree.How it works
The plugin exposes a
registerPortalHost()/registerTeleportHost()method. The host component calls it on mount with a state setter, and the plugin pushes entry updates (add/update/remove) to that setter. When the host is not present, the plugin falls back to the previous isolatedcreateRoot/createAppbehavior — fully backward compatible.Changes
react-row-detail-plugin/src/reactRowDetailView.tsPortalEntryinterface,registerPortalHost(),_updatePortalEntry(),_removePortalEntry(); portal-mode branches inrenderViewModel,renderPreloadView,disposeViewComponent,disposeAllViewComponentsreact-row-detail-plugin/src/RowDetailPortalHost.tsxreact-row-detail-plugin/tsconfig.json"jsx": "react-jsx"react-row-detail-plugin/src/index.tsRowDetailPortalHostvue-row-detail-plugin/src/vueRowDetailView.tsTeleportEntryinterface,registerTeleportHost(),_updateTeleportEntry(),_removeTeleportEntry(); teleport-mode branches in render/dispose methodsvue-row-detail-plugin/src/RowDetailTeleportHost.tsvue-row-detail-plugin/src/index.tsRowDetailTeleportHostBreaking Changes
None. Both plugins are fully backward compatible — the host component is opt-in.