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.
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
[docs] High-level Routing, Navigation and URL overview #76888
[docs] High-level Routing, Navigation and URL overview #76888
Changes from 8 commits
664e09b
ccf7ed1
9c8272d
cb40bfd
7c9676e
cc6d767
1ca84bc
3505bed
37d9c4e
6d4dd05
a64e376
8e32bfa
9ac8bda
01f3354
99bd668
1e55aa5
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For some reason this code block has almost no syntax highlighting:
I wonder if it is how our website is set up or does it has to do with
[source,js]
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great example, but I was initially confused because you say "using native browser apis" but part of the example is using core apis.
What if we had the "Deep linking into Kibana Apps" section first, so the user is introduced to the core api
core.http.basePath.prepend
and what it does and that it should only be used if there isn't a url generator available?Then you can follow up with this section and I think the user may understand that you are focusing on the
window.location.href
part of the line.Could then even write it as:
Which focuses in on which is the part to avoid.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should not mention
RedirectAppLinks
in this doc as it is a hack to easily make legacy Kibana URLs work. Or mention that it is a hack and you should not be using it.It seems we are missing a good way to navigate across Kibana apps, we need a component where one specifies an app and path:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe in
kibana_react
we could put a component that can do both, navigate within Kibana app:and across apps if
app
prop is specified:There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree that component would makes sense.
RedirectAppLinks
still worth a mention. Some places don't have React wired up and you need to make sure your non React links are nested into that component.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Late reply, but
RedirectAppLinks
is, AFAIK, not a hack, and the current preferred approach. See #58751 for more context and the whole discussion about the various options. The issue is still open for proposals for possible alternative to match other uses cases (theKbnLink
was one of them, so I'm totally in favor of adding that though, see #58751 (comment))There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't follow this one. I don't see State Syncing utils, or the _a and _g format used in any of the documentation links for ScopedHistory:
So seems like I can use ScopedHistory without using any state syncing utils directly? Or am I missing something?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exactly!
ScopedHistory
is a core's wrapper around browser's navigation and history apis.window.location
orwindow.history
, you should consider using core'sScopeHistory
instead. (for example, reading / writing query params, updating path, etc..)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So
state:storeInSessionStore
relies on _a and _g parameters in the URL?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, not really.
When using state syncing utils (with
kbnUrlStateStorage
to be precise) you can configure your state to be synced to any query key. You can also set it up to sync only hash into URL. This is covered in docs ofstateSync
, which is linked from this general guide: https://github.com/elastic/kibana/blob/master/src/plugins/kibana_utils/docs/state_sync/storages/kbn_url_storage.md#setting-url-format-option