Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(api): add namespace when storing widgets state #1627

Merged
merged 1 commit into from
Dec 1, 2016

Conversation

mthuret
Copy link
Contributor

@mthuret mthuret commented Nov 30, 2016

Does not contain the doc yet, only the namespacing.

{
  "range": {
    "price": {
      "min": "200",
      "max": "500"
    }
  },
  "refinementList": {
    "colors": [
      "White",
      "High gloss gray",
      "Black-brown",
      "High gloss white",
      "Walnut effect"
    ]
  },
  "hierarchicalMenu": {
    "category": "Bathroom"
  },
  "hitsPerPage": "2",
  "menu": {
    "type": "High cabinet with mirror door, black-brown"
  },
  "multiRange": {
    "price": "100:500"
  },
  "toggle": {
    "materials": "on"
  },
  "sortBy": "index_name",
  "query": "chair",
  "page": 2
}

@algobot
Copy link
Contributor

algobot commented Nov 30, 2016

By analyzing the blame information on this pull request, we identified @Morhaus, @bobylito and @vvo to be potential reviewers

@mthuret
Copy link
Contributor Author

mthuret commented Nov 30, 2016

Added the first documentation attempt.

Also see this #1581 (comment).

@mthuret mthuret force-pushed the feat/add-namespace-to-state branch from 0186a6d to 1a53b0c Compare November 30, 2016 15:47
BREAKING CHANGE:

- our internal state shape now includes namespacing to avoid id collision. Also some existing keys were renamed:
* searchbox was using 'q' now it uses 'query'
* hitsPerPage was using 'hPP' now it uses 'hitsPerPage'
* pagination and infiniteHits were using 'p' now it uses 'page'
- toggle internal state change from 'on/off' to 'true/false'
For more information about the state shape, please read our documentation.
@mthuret mthuret force-pushed the feat/add-namespace-to-state branch from 1a53b0c to 9f27a20 Compare November 30, 2016 16:47
@vvo
Copy link
Contributor

vvo commented Nov 30, 2016

Do we need to update our examples synchronizing the state into the url and any example reading the state?

@vvo
Copy link
Contributor

vvo commented Dec 1, 2016

In the future (noted as a task to discuss), we will have to think about an easy way/API to sync/parse state in the url so that urls are not too long and easily shareable.

@vvo vvo merged commit fbd4cd8 into v2 Dec 1, 2016
@vvo vvo deleted the feat/add-namespace-to-state branch December 1, 2016 10:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants