This repository has been archived by the owner on Dec 30, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 157
fix(core): make InstantSearch(Ssr) into regular .js files #605
Merged
Conversation
This file contains 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
The reason I did this is to make sure that rollup turns this into valid components (before the template was compiled into the arguments of `createInstantSearchComponent` instead of into its result.
Haroenv
force-pushed
the
fix/instant-search-file
branch
from
January 17, 2019 09:09
68bc7ee
to
51c088a
Compare
samouss
reviewed
Jan 17, 2019
src/components/__tests__/__snapshots__/InstantSearchSsr.js.snap
Outdated
Show resolved
Hide resolved
Co-Authored-By: Haroenv <fingebimus@me.com>
samouss
approved these changes
Jan 17, 2019
Haroenv
added a commit
that referenced
this pull request
Jan 17, 2019
* chore: initial nuxt setup * refactor(SSR): hydrate doesn't assume where serialized state comes from * feat(ssr): add a warning if __forceRender gets called without active helper * docs(nuxt): add example * docs(ssr): add styling * chore(lint): fix minor errors * chore(build): don't do examples of nuxt & ssr * fix(warning): correct capitalisation Co-Authored-By: Haroenv <fingebimus@me.com> * fix(core): make InstantSearch(Ssr) into regular .js files (#605) * fix(core): make InstantSearch(Ssr) into regular .js files The reason I did this is to make sure that rollup turns this into valid components (before the template was compiled into the arguments of `createInstantSearchComponent` instead of into its result. * chore(test): use a global mock of InstantSearch.js root * chore: fix file lines Co-Authored-By: Haroenv <fingebimus@me.com> Co-Authored-By: Samuelv <users+samouss@github.com> * fix(ssr): correct class name * chore(test): cleaner snapshot * chore(example): remove unused import * refactor(ssr): better naming for function argument * chore(test): update snapshot * chore: remove wrong comment
Haroenv
added a commit
that referenced
this pull request
Jan 18, 2019
* chore: initial nuxt setup * refactor(SSR): hydrate doesn't assume where serialized state comes from * feat(ssr): add a warning if __forceRender gets called without active helper * docs(nuxt): add example * docs(ssr): add styling * chore(lint): fix minor errors * chore(build): don't do examples of nuxt & ssr * fix(warning): correct capitalisation Co-Authored-By: Haroenv <fingebimus@me.com> * fix(core): make InstantSearch(Ssr) into regular .js files (#605) * fix(core): make InstantSearch(Ssr) into regular .js files The reason I did this is to make sure that rollup turns this into valid components (before the template was compiled into the arguments of `createInstantSearchComponent` instead of into its result. * chore(test): use a global mock of InstantSearch.js root * chore: fix file lines Co-Authored-By: Haroenv <fingebimus@me.com> Co-Authored-By: Samuelv <users+samouss@github.com> * fix(ssr): correct class name * chore(test): cleaner snapshot * chore(example): remove unused import * refactor(ssr): better naming for function argument * chore(test): update snapshot * chore: remove wrong comment
Haroenv
added a commit
that referenced
this pull request
Jan 23, 2019
* chore: update lockfile * chore: add initial ssr example (no Algolia) * chore: redo SSR via vue cli & add algolia page * temp commit * chore(lint): allow $_ais * feat(ssr): split up components * refactor(ssr): factorise example usage * fix: call render once on client to give state before render * chore: remove log * chore: set default params to avoid highlight not working * chore: fix tests * chore: no linting on ssr example until we are done * fix: make sure it works with complex components search parameters is necessary if during mount the widget uses functions on the results * chore: rename ais-ssr to ais-instant-search-ssr * docs: refinement-list in example * fix: correct name for ais-instant-search-ssr * feat: throw warning when SSR and no injection * test(ssr): initial component * feat: rename all SSR methods * chore(ssr): small logic refactor of name Co-Authored-By: Haroenv <fingebimus@me.com> * chore: make linting pass * refactor(ssr): rename internal file * chore: remove helper-serializer * chore(build): allow spread * chore(example): kebab * feat(ssr): move monkeypatching inside code * docs(example): pagination * test(ssr): write tests for all injection functions * chore: downgrade node * chore(babel): allow spread in storybook * docs(ssr): add Nuxt example (#603) * chore: initial nuxt setup * refactor(SSR): hydrate doesn't assume where serialized state comes from * feat(ssr): add a warning if __forceRender gets called without active helper * docs(nuxt): add example * docs(ssr): add styling * chore(lint): fix minor errors * chore(build): don't do examples of nuxt & ssr * fix(warning): correct capitalisation Co-Authored-By: Haroenv <fingebimus@me.com> * fix(core): make InstantSearch(Ssr) into regular .js files (#605) * fix(core): make InstantSearch(Ssr) into regular .js files The reason I did this is to make sure that rollup turns this into valid components (before the template was compiled into the arguments of `createInstantSearchComponent` instead of into its result. * chore(test): use a global mock of InstantSearch.js root * chore: fix file lines Co-Authored-By: Haroenv <fingebimus@me.com> Co-Authored-By: Samuelv <users+samouss@github.com> * fix(ssr): correct class name * chore(test): cleaner snapshot * chore(example): remove unused import * refactor(ssr): better naming for function argument * chore(test): update snapshot * chore: remove wrong comment * fix(test): avoid broken dependency injection * refactor(ssr): remove findRoot * refactor(ssr): findResultsState returns nothing, introduce getState * docs(example): update code * chore(examples): remove unused sample files * docs(example-ssr): make use of correct state var * fix(ssr): move getState error to warning this is not a fatal warning, so throwing can confuse people * chore(example): lint * fix(ssr): prevent overriding of forced parameters * chore(ssr): improve test wording * docs(ssr): add explaining comment on searchOnce * fix(babel): use _objectSpread from babel instead of Object.assign * refactor(ais-instant-search): move from pure factory function to augmented factory This limits the amounts of conditionals in the code * chore(rollup): remove spread * chore(babel): remove spread * chore(nuxt): simpler example * chore(examples): avoid lint for now (prettier conflicts) * chore(nuxt): easier example * chore(ssr-example): only hydrate if possible * fix(ssr): only __forceRender once on server, once on client * fix(core): prevent instance from starting multiple times (#607) * fix(core): prevent instance from starting multiple times This was no problem with regular InstantSearch; but when in SSR the instance is not recreated when InstantSearch mounts; and thus it starts again, which throws an error. We need to set the flag to false, since otherwise InstantSearch throws an error. * chore: add maintainer note * chore(test): general improvements * test(core): dispose gets called and started gets patched * chore(build): fix indention * refactor(ssr): getState shouldn't warn if early * test(mock): remove global _stalledSearchDelay * chore(example): add vue-instantsearch via npm * chore(nuxt): consistent state naming * test(cis): better naming * refactor(CISC): move spreading into util * refactor(cis): createInstantSearch has same signature as regular instantsearch * fix(destroy): set helper to null to avoid old requests see algolia/instantsearch#3415 * chore: remove unused import * fix(ssr): review of error messages Co-Authored-By: Haroenv <fingebimus@me.com> fix(core): better errors * chore(errors): fix typo * chore(lint): prettier * chore(jest): fix static mock * fix(core): set hydrated to false on destroy * fix(ssr): do not allow instance to start multiple times This can only happen in extreme edge cases (mount - unmount - nextTick - mount).
Closed
Haroenv
added a commit
to algolia/instantsearch
that referenced
this pull request
Dec 28, 2022
* chore: update lockfile * chore: add initial ssr example (no Algolia) * chore: redo SSR via vue cli & add algolia page * temp commit * chore(lint): allow $_ais * feat(ssr): split up components * refactor(ssr): factorise example usage * fix: call render once on client to give state before render * chore: remove log * chore: set default params to avoid highlight not working * chore: fix tests * chore: no linting on ssr example until we are done * fix: make sure it works with complex components search parameters is necessary if during mount the widget uses functions on the results * chore: rename ais-ssr to ais-instant-search-ssr * docs: refinement-list in example * fix: correct name for ais-instant-search-ssr * feat: throw warning when SSR and no injection * test(ssr): initial component * feat: rename all SSR methods * chore(ssr): small logic refactor of name Co-Authored-By: Haroenv <fingebimus@me.com> * chore: make linting pass * refactor(ssr): rename internal file * chore: remove helper-serializer * chore(build): allow spread * chore(example): kebab * feat(ssr): move monkeypatching inside code * docs(example): pagination * test(ssr): write tests for all injection functions * chore: downgrade node * chore(babel): allow spread in storybook * docs(ssr): add Nuxt example (algolia/vue-instantsearch#603) * chore: initial nuxt setup * refactor(SSR): hydrate doesn't assume where serialized state comes from * feat(ssr): add a warning if __forceRender gets called without active helper * docs(nuxt): add example * docs(ssr): add styling * chore(lint): fix minor errors * chore(build): don't do examples of nuxt & ssr * fix(warning): correct capitalisation Co-Authored-By: Haroenv <fingebimus@me.com> * fix(core): make InstantSearch(Ssr) into regular .js files (algolia/vue-instantsearch#605) * fix(core): make InstantSearch(Ssr) into regular .js files The reason I did this is to make sure that rollup turns this into valid components (before the template was compiled into the arguments of `createInstantSearchComponent` instead of into its result. * chore(test): use a global mock of InstantSearch.js root * chore: fix file lines Co-Authored-By: Haroenv <fingebimus@me.com> Co-Authored-By: Samuelv <users+samouss@github.com> * fix(ssr): correct class name * chore(test): cleaner snapshot * chore(example): remove unused import * refactor(ssr): better naming for function argument * chore(test): update snapshot * chore: remove wrong comment * fix(test): avoid broken dependency injection * refactor(ssr): remove findRoot * refactor(ssr): findResultsState returns nothing, introduce getState * docs(example): update code * chore(examples): remove unused sample files * docs(example-ssr): make use of correct state var * fix(ssr): move getState error to warning this is not a fatal warning, so throwing can confuse people * chore(example): lint * fix(ssr): prevent overriding of forced parameters * chore(ssr): improve test wording * docs(ssr): add explaining comment on searchOnce * fix(babel): use _objectSpread from babel instead of Object.assign * refactor(ais-instant-search): move from pure factory function to augmented factory This limits the amounts of conditionals in the code * chore(rollup): remove spread * chore(babel): remove spread * chore(nuxt): simpler example * chore(examples): avoid lint for now (prettier conflicts) * chore(nuxt): easier example * chore(ssr-example): only hydrate if possible * fix(ssr): only __forceRender once on server, once on client * fix(core): prevent instance from starting multiple times (algolia/vue-instantsearch#607) * fix(core): prevent instance from starting multiple times This was no problem with regular InstantSearch; but when in SSR the instance is not recreated when InstantSearch mounts; and thus it starts again, which throws an error. We need to set the flag to false, since otherwise InstantSearch throws an error. * chore: add maintainer note * chore(test): general improvements * test(core): dispose gets called and started gets patched * chore(build): fix indention * refactor(ssr): getState shouldn't warn if early * test(mock): remove global _stalledSearchDelay * chore(example): add vue-instantsearch via npm * chore(nuxt): consistent state naming * test(cis): better naming * refactor(CISC): move spreading into util * refactor(cis): createInstantSearch has same signature as regular instantsearch * fix(destroy): set helper to null to avoid old requests see algolia/instantsearch.jsalgolia/vue-instantsearchalgolia/vue-instantsearch#3415 * chore: remove unused import * fix(ssr): review of error messages Co-Authored-By: Haroenv <fingebimus@me.com> fix(core): better errors * chore(errors): fix typo * chore(lint): prettier * chore(jest): fix static mock * fix(core): set hydrated to false on destroy * fix(ssr): do not allow instance to start multiple times This can only happen in extreme edge cases (mount - unmount - nextTick - mount).
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
building further on #603