feat(vue): PoC — Composition API composables over a shared widget lifecycle controller - #7147
Draft
FabienMotte wants to merge 1 commit into
Draft
feat(vue): PoC — Composition API composables over a shared widget lifecycle controller#7147FabienMotte wants to merge 1 commit into
FabienMotte wants to merge 1 commit into
Conversation
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 153 |
TIP This summary will be updated as you push new changes.
More templates
algoliasearch-helper
instantsearch-ui-components
instantsearch.css
instantsearch.js
react-instantsearch
react-instantsearch-core
react-instantsearch-nextjs
react-instantsearch-router-nextjs
vue-instantsearch
commit: |
|
Size Change: +3.16 kB (+0.26%) Total Size: 1.21 MB 📦 View Changed
ℹ️ View Unchanged
|
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.
Summary
Throwaway PoC supporting RFC: Composition API composables for Vue InstantSearch. Not intended to merge — it exists so RFC reviewers can read the diff and comment inline.
It proves the RFC's central claim:
createWidgetMixinand a newuseConnectorcomposable can share a plain-JS widget lifecycle controller without breaking the mixin's public contract.src/util/widgetLifecycleController.js— shared core: connector → factory → widget, add/remove on the parent index, remove-and-recreate on params change, SSR__forceRender; state-update policy stays per consumer.src/mixins/widget.jsrewired over the controller — public contract unchanged (options,this.state,this.widget, timing, warnings, SSR error).src/composables/useConnector.js+useSearchBox.js— sync initial render state (never null),shallowRefout,MaybeRefOrGetterin, dequal-guarded commits and recreation.vue-compatshim: real re-exports of composition APIs on both Vue 2.7 and Vue 3 sides + atoValueshim; build/Jest infra picked them up with zero config changes.Result
The existing
vue-instantsearchsuite passes untouched in both modes:prepare-vue3): 54 suites, 562 passed / 0 failedPlus 11 new PoC tests (8
useConnectorunit, 3useSearchBoxintegration), passing in both modes.