Install bun in macOS
curl -fsSL https://bun.sh/install | bash # for macOS, Linux, and WSL
# to install a specific version
curl -fsSL https://bun.sh/install | bash -s "bun-v1.0.0"
Install bun in macOS with Homebrew
brew tap oven-sh/bun # for macOS and Linux
brew install bun
Clone the project
git clone https://github.com/vishalvxhztl/state-with-url.git
Go to the project directory
cd state-with-url
Install dependencies
npm install
or
bun install
Start the server
npm run dev
or
bun dev
To learn more about state management technique
This README provides examples of websites and web applications that use URL-based state management for various use cases. URL-based state management allows for bookmarkable links, deep linking, browser history navigation, and more.
- Bookmarkable Links
- Google Maps: Google Maps allows users to create and share links to specific locations and directions with the map's state encoded in the URL.
- Deep Linking
- YouTube: YouTube allows users to share videos and playlists with specific timestamps using URLs that include time parameters.
- Browser History
- GitHub: GitHub's web application uses URL routing to navigate between repositories, issues, and code files, enabling users to navigate through their browser's history.
- State Restoration
- Gmail: Gmail often allows users to restore their previous sessions by reopening the same URL, as it stores mailbox state in the URL.
- Sharing Data
- Tableau Public: Tableau Public enables users to create and share interactive data visualizations with URLs containing parameters for filters and view settings.
- Multi-Step Processes
- LinkedIn: LinkedIn uses URL parameters to track progress through profile creation and other multi-step processes.
- Filtering and Sorting
- Amazon: Amazon allows users to filter and sort search results by various criteria, and the selected filters are encoded in the URL.
- Localization and Language Preferences
- Wikipedia: Wikipedia allows users to switch between languages by appending a language code to the URL.
- Debugging and Troubleshooting
- WordPress: WordPress developers often use URL parameters for debugging purposes, such as enabling debugging mode or specifying specific queries.
- A/B Testing
- Optimizely: Optimizely is a platform for A/B testing and experimentation, and URL parameters can be used to specify different test variations.