Skip to content

fix: handle relative paths in queryAdapter#10

Open
mollehxh wants to merge 1 commit into
effector:mainfrom
mollehxh:fix/query-adapter-relative-paths
Open

fix: handle relative paths in queryAdapter#10
mollehxh wants to merge 1 commit into
effector:mainfrom
mollehxh:fix/query-adapter-relative-paths

Conversation

@mollehxh

Copy link
Copy Markdown

Fixes #7.

queryAdapter currently passes relative history values to new URL(...).

This can crash when:

  • location.search is empty
  • location.pathname is a relative path like /users

This PR replaces new URL(...) usage with history path helpers:

  • parsePath for reading the nested route from search
  • createPath for serializing router navigation targets

The public API is unchanged.

Tested with:

pnpm --filter @effector/router test

@bolt-new-by-stackblitz

Copy link
Copy Markdown

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

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.

queryAdapter(createBrowserHistory()) throws Invalid URL on normal browser URL

1 participant