Open
Conversation
EditionCrafter 1.1
`editioncrafter` 1.2.0
`dev` into `main`
EditionCrafter 1.3.0
EditionCrafter 1.3.1
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
In this PR
Adds the following optional props to the
EditionCraftercomponent to give users more control over how routing is handled:serverNav: boolean-- If true, will configure the component not to use theHashRouterfromreact-router-dom, and instead use normal browser navigation or a providednavigatefunciton;navigate: (path) => void-- If provided, will be used as the navigation function when navigation is triggered from within the app;divider: string-- If provided, will be used as the URL segment that marks the beginning of the part of the path handled by EditionCrafter. Defaults toec/. Note that if server nav is enabled, the URL of the page on which the component appears should end with the divider (for examplewww.mysite.com/myedition/ec).The advantage of offering this mode is that the non-hash routes are more easily indexed by search engines such as Google.
Notes and questions
Depending on how the consuming application's routing works, using EC in this mode might cause full page reloads on any navigation action, which can be an undesirable user experience, especially if the component is embedded on a larger page with additional content.
Basic example using Astro and Netlify SSR: https://ec-test.netlify.app/
The example highlights some of the current UX issues with this mode -- for example the panel sizing resets to the default with each page load. Possibly things like the panel widths could be stored as URL parameters to allow them to be maintained through navigation? Open to suggestions.