add new persistence_type: history_state
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 24.4k
- Forks
- 2.3k
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 13
Description
When basing the app around internal links which add entries to the browser history it could be useful with a persistence type which stores the values in the history state entries (history.pushState(state, ...)).
I know that ideally most/all such state would be part of the URL as this has more advantages beyond preserving the state on back/forward. But sometimes this can be a bit tricky - using URL parameters for state does require a certain app architecture - so I think it could be useful to easily add some state to the history entry "under the hood".
I think this could be reasonable easy to implement. Do a replaceState({...history.state, ...historyProps}, ...) each time a "history-state persisted" property is changed. Then restore these in a "popstate" event handler.
(I could not find any previous discussion on this topic)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue names no files or tests. Start by locating the existing persistence-type implementations and browser-history integration, then trace how state is saved and restored during back/forward navigation; done means a history_state persistence type that handles history entries as described.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100