mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
Addresses: https://github.com/elastic/kibana/issues/140263 This PR was inspired by https://github.com/elastic/kibana/pull/146649 and while working on persistent rules table state https://github.com/elastic/kibana/pull/145111. ## Summary It includes improvements for url search parameters manipulation functionality. In particular `useGetInitialUrlParamValue` and `useReplaceUrlParams` hooks. The main idea is to isolate the encoding layer ([rison](https://github.com/Nanonid/rison)) as an implementation detail so `useGetInitialUrlParamValue` and `useReplaceUrlParams` consumers can just provide types they wish and the hooks serialize/desirealize the data into appropriate format under the hood. On top of that after `@kbn/rison` was added in https://github.com/elastic/kibana/pull/146649 it's possible to use this package directly to encode and decode parameters whenever necessary. The improvements include - store unserialized url parameters state in the redux store - encode and decode data by using functions from `@kbn/rison` directly - let `useReplaceUrlParams` accept an updater object ### Checklist - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios |
||
---|---|---|
.. | ||
BUILD.bazel | ||
index.ts | ||
jest.config.js | ||
kbn_rison.test.ts | ||
kbn_rison.ts | ||
kibana.jsonc | ||
package.json | ||
README.md | ||
tsconfig.json |
@kbn/rison
A simple wrapper around rison-node which gives us types and ensures that values are always encoded to a string.