Skip to content

feat: add router utilities#14

Open
Guria wants to merge 2 commits intomainfrom
router
Open

feat: add router utilities#14
Guria wants to merge 2 commits intomainfrom
router

Conversation

@Guria
Copy link
Collaborator

@Guria Guria commented Feb 15, 2026

  • Implemented setupHashUrl to switch urlAtom to hash-based routing, including hashToUrl and pathToHash helpers.
  • Added tests and examples for setupHashUrl.
  • Created setupStorybookUrl to configure urlAtom for Storybook, preventing History API sync and restoring original iframe URL.
  • Included tests and examples for setupStorybookUrl.
  • Updated registry.json to include new utilities and their metadata.

Copilot AI review requested due to automatic review settings February 15, 2026 21:16
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds two router utilities to configure urlAtom for different routing scenarios: setupHashUrl for hash-based routing and setupStorybookUrl for Storybook integration.

Changes:

  • Added setupHashUrl utility to enable hash-based routing (#/path format) with helper functions hashToUrl and pathToHash
  • Added setupStorybookUrl utility to configure urlAtom for Storybook by preventing History API sync and preserving iframe URL
  • Updated registry.json to include both utilities with their metadata

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/reusables/router/setup-hash-url/setup-hash-url.ts Main implementation of hash-based routing with URL conversion helpers
src/reusables/router/setup-hash-url/setup-hash-url.meta.ts Registry metadata for setupHashUrl utility
src/reusables/router/setup-hash-url/setup-hash-url.md Documentation for setupHashUrl API and usage
src/reusables/router/setup-hash-url/setup-hash-url.example.ts Example usage of setupHashUrl
src/reusables/router/setup-hash-url/setup-hash-url.browser.test.ts Browser tests for setupHashUrl and helper functions
src/reusables/router/setup-storybook-url/setup-storybook-url.ts Main implementation for Storybook URL configuration
src/reusables/router/setup-storybook-url/setup-storybook-url.meta.ts Registry metadata for setupStorybookUrl utility
src/reusables/router/setup-storybook-url/setup-storybook-url.md Documentation for setupStorybookUrl API and usage
src/reusables/router/setup-storybook-url/setup-storybook-url.example.ts Example usage of setupStorybookUrl
src/reusables/router/setup-storybook-url/setup-storybook-url.browser.test.ts Browser tests for setupStorybookUrl
registry.json Updated registry with both new utilities and their file metadata

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

- Implemented setupHashUrl to switch urlAtom to hash-based routing, including hashToUrl and pathToHash helpers.
- Added tests and examples for setupHashUrl.
- Created setupStorybookUrl to configure urlAtom for Storybook, preventing History API sync and restoring original iframe URL.
- Included tests and examples for setupStorybookUrl.
- Updated registry.json to include new utilities and their metadata.
@Guria
Copy link
Collaborator Author

Guria commented Feb 23, 2026

@Xelson @artalar can we merge this one?

@Guria Guria requested review from Xelson and artalar February 23, 2026 12:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants