Skip to content
This repository has been archived by the owner on Jul 11, 2023. It is now read-only.

Use an immutability library for arrays and objects in SearchParameters #14

Closed
bobylito opened this issue Mar 26, 2015 · 6 comments
Closed
Assignees
Milestone

Comments

@bobylito
Copy link
Contributor

Although the state is mostly immutable in SearchParameters, the inner structures based on array and objects are not due to their nature of native objects. It would be nice to use a library like Immutable to change the implementations of those structures. We could also benefits from data structures like Set or OrderedMap.

We should also make sure to leak the very minimal amount of abstractions to the users...

@bobylito bobylito modified the milestones: V2, v2.1 Mar 26, 2015
@bobylito
Copy link
Contributor Author

Conjunctive, disjuncive and exclude facet refinements should be stored in sets

@Jerska
Copy link
Member

Jerska commented May 12, 2015

Pretty scared of the JSON.stringify(state) of this. Agreed if we handle URL parameters with the helper.

@bobylito
Copy link
Contributor Author

I have the same kind of fear, that's why I explicitly mentionned that we shouldn't leak to the user. It's for internal purpose only.

@vvo
Copy link
Contributor

vvo commented May 13, 2015

I do not understand the fear around JSON.stringify, where it is (would be?) used?

thx

@bobylito
Copy link
Contributor Author

If we expose objects that are much more complex that plain objects or array, what would their serialization? That's the question. I guess you question is right in the sense that if we stringify an object it'll be pure json. Then no need to worry... yet I think it's better that the users thinks the values are simple js structures.

@bobylito
Copy link
Contributor Author

see #105

bobylito pushed a commit that referenced this issue Jun 15, 2015
  * FIX : #29 Avoid callback for outdated queries
  * FIX : #64 Sum up the processing time of all queries
  * FIX : #92 Parameters that can be set in the dashboard shouldn't have defaults
  * FIX : #62 Make sure disctinct is set to false when it's not possible to use distinct in Algolia
  * FEATURE : #91 Support for tags (with support for the raw format #98)
  * FEATURE : #70 Ability to get all refined values : helper.getRefinements( facetname )
  * FEATURE : #51 multiple filters for a single conjunctive facet (tests)
  * FEATURE : Ability to modify any parameter of the state easily (#76 #84 #12)
  * FEATURE : #69 Ability to know if a facet is refined, whatever the value
  * FEATURE : #86 Expose SearchParameters, AlgoliaSearchHelper, SearchResults to users directly in the builds
  * FEATURE : #25 let the user do a clearRefinement with a function as a filter
  * REFACTORING : SearchParameters is immutable (#14)
  * REFACTORING : Ensure SearchParameters is totally frozen (#14)
  * LIB : Update lodash version to 3.9.x
dhayab pushed a commit to algolia/instantsearch that referenced this issue Jul 10, 2023
…eature/mutability

FIX algolia/algoliasearch-helper-js#14 Make the core model/state of the search (SearchParameter) immutable (for real)
dhayab pushed a commit to algolia/instantsearch that referenced this issue Jul 10, 2023
  * FIX : algolia/algoliasearch-helper-js#29 Avoid callback for outdated queries
  * FIX : algolia/algoliasearch-helper-js#64 Sum up the processing time of all queries
  * FIX : algolia/algoliasearch-helper-js#92 Parameters that can be set in the dashboard shouldn't have defaults
  * FIX : algolia/algoliasearch-helper-js#62 Make sure disctinct is set to false when it's not possible to use distinct in Algolia
  * FEATURE : algolia/algoliasearch-helper-js#91 Support for tags (with support for the raw format #98)
  * FEATURE : algolia/algoliasearch-helper-js#70 Ability to get all refined values : helper.getRefinements( facetname )
  * FEATURE : algolia/algoliasearch-helper-js#51 multiple filters for a single conjunctive facet (tests)
  * FEATURE : Ability to modify any parameter of the state easily (algolia/algoliasearch-helper-js#76 #84 #12)
  * FEATURE : algolia/algoliasearch-helper-js#69 Ability to know if a facet is refined, whatever the value
  * FEATURE : algolia/algoliasearch-helper-js#86 Expose SearchParameters, AlgoliaSearchHelper, SearchResults to users directly in the builds
  * FEATURE : algolia/algoliasearch-helper-js#25 let the user do a clearRefinement with a function as a filter
  * REFACTORING : SearchParameters is immutable (algolia/algoliasearch-helper-js#14)
  * REFACTORING : Ensure SearchParameters is totally frozen (algolia/algoliasearch-helper-js#14)
  * LIB : Update lodash version to 3.9.x
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants