Bump @solidjs/router from 2.0.0-next.35 to 2.0.0-next.40#209

open1
main
dependabot/npm_and_yarn/solidjs/router-2.0.0-next.40
opened24d agobyDdependabotBot
View on GitHubTwo-way sync enabledPR last imported 20d ago

Bumps @solidjs/router from 2.0.0-next.35 to 2.0.0-next.40.

Release notes

Sourced from @​solidjs/router's releases.

v2.0.0-next.40

Patch Changes

  • 9cf2230: Route params are decoded (#670). useParams(), props.params and Router.match() return each dynamic segment decoded after matching, so /item/%E7%8C%AB gives id: "猫" and paths.item("猫") round-trips. matchFilters see the decoded value, so { k: ["猫"] } now matches. An encoded slash stays inside its param (/a%2Fb/view gives name: "a/b" for /:name/view), splat params are decoded segment by segment, and a malformed escape is left raw. match.path and location.pathname keep the URL's encoding.

    Breaking: code that already calls decodeURIComponent on params decodes twice; drop the extra decode. Encode a param (or use paths) when interpolating it into a URL by hand.

  • 3832cd5: Link claims trust the server's link state at hydration: an anchor the server marked is registered without resolving its URL, and is resolved on the first routing change. Anchors with an authored aria-current, and pages rendered without server link state, are resolved at claim as before.

  • 5943f7f: serverRouteComponent with a bare GET(fn) source sends one request per link visit instead of two (#677). The router hands a preload's call to the next render with the same args, so the route mounts the result the hover or focus preload already started. The hand-off happens once, within the same 5 s window query() gives a preload. A later visit calls fresh, a failed preload makes the render retry, and concurrent preloads of the same args share one call. query() and liveQuery() sources are unchanged.

  • 828b232: Add useInRouter, which returns whether the calling component is rendered under a router. The other router primitives throw outside one, so components that also render there (an error fallback above the router, a shared link component) can check first instead of wrapping useLocation() in a try/catch. Like the other primitives, it throws when called with no reactive owner, such as from an event handler.

v2.0.0-next.39

Patch Changes

  • f3b5f56: Put state, noscroll, replace, and preload back on JSX.AnchorHTMLAttributes by augmenting @solidjs/web/jsx-runtime. preload also accepts "viewport" and "eager". link stays owned by core. Pairs with the core change that removes those four props from the anchor type.
  • 4a85130: intentPreload preloads a link once per visit whichever intent comes first: a focus or touch on a link that already preloaded no longer preloads it again, and cancels a pending hover preload. A click after a hover, or a click with no dwell, now sends one preload instead of two.
  • ea24119: Follow client-side query redirects by status and origin. Keep local paths such as /next and server-function redirects relative to the router base. Other same-origin URLs use the history parser without adding the base again; targets outside the base, or URLs the integration cannot represent, navigate the document. A Location header on a non-redirect response stays data on the client, and the server-function carrier takes precedence. Server rendering is unchanged.
  • 5729e79: Require solid-js / @​solidjs/web 2.0.0-rc.15. Link and form claims follow rc.15's claim contract: an element's compiled mount claim fires once, after its initial attributes are applied, and later claims come from compiler-owned href/action writes or from claimElementTree sweeps (frame streams, morphs). The router's claim handlers are unchanged.
  • af98854: Server-rendered anchors carry link state (#654). The router sets the render's link handler (setLinkClaim from @solidjs/web), so plain anchors arrive with data-active and aria-current="page" in the server HTML instead of gaining them only after hydration, and pages that never hydrate mark the current page too. When the client claims an anchor from that HTML, it treats a server-written aria-current as its own and removes it on navigation. The peer floor for @solidjs/web and solid-js is raised to ^2.0.0-rc.15.

v2.0.0-next.38

Patch Changes

  • 457ac72: Claimed anchors share one parse of the location and base path instead of re-parsing both per anchor, roughly halving the URL constructions link state does at load and on every navigation sweep.

  • fb43a9c: Link preloading on focusin and touchstart now works. Both went through the click handler's primary-button gate, which FocusEvent and TouchEvent never pass, so only a resting mouse pointer preloaded. Preload triggers now find the anchor without the button and modifier-key checks; click handling is unchanged.

  • 9618caa: Link preloading is now pluggable and opt-in. Breaking: the router no longer preloads on hover, focus, or touch by default; pass a strategy to restore it:

    import { createRouter, intentPreload } from "@solidjs/router";
    

    const Router = createRouter({ routes, preloadLinks: intentPreload() });

    • preloadLinks takes a strategy or an array of strategies instead of a boolean. A boolean is a type error, warns in development, and preloads nothing.
    • intentPreload({ delay = 20, data = true }) is the previous behavior: preload when the pointer rests on a link for delay ms, on focus, and on touchstart. data: false warms route code only.
    • preload="false" on a link now opts it out of preloading entirely. Previously it still preloaded the route's code and skipped only its data.
    • transformUrl now applies inside route preloading itself, so preloads match the same pathname navigation does, including usePreloadRoute calls, which previously matched the untransformed URL.

    Apps that don't preload links no longer ship the hover/focus/touch listeners.

  • b9594e9: Route preloading (matching a link's URL, loading lazy components and subtrees, running preload functions with intent: "preload") moved out of the router core into its own module. Only link preload strategies and usePreloadRoute import it, so apps that use neither no longer ship it. No behavior change.

  • e493aae: Smaller link-preload strategies, with the same behavior. intentPreload and tapPreload register their listeners directly instead of through shared wrappers, and usePreloadRoute no longer allocates an options object when called with a URL alone.

... (truncated)

Changelog

Sourced from @​solidjs/router's changelog.

2.0.0-next.40

Patch Changes

  • 9cf2230: Route params are decoded (#670). useParams(), props.params and Router.match() return each dynamic segment decoded after matching, so /item/%E7%8C%AB gives id: "猫" and paths.item("猫") round-trips. matchFilters see the decoded value, so { k: ["猫"] } now matches. An encoded slash stays inside its param (/a%2Fb/view gives name: "a/b" for /:name/view), splat params are decoded segment by segment, and a malformed escape is left raw. match.path and location.pathname keep the URL's encoding.

    Breaking: code that already calls decodeURIComponent on params decodes twice; drop the extra decode. Encode a param (or use paths) when interpolating it into a URL by hand.

  • 3832cd5: Link claims trust the server's link state at hydration: an anchor the server marked is registered without resolving its URL, and is resolved on the first routing change. Anchors with an authored aria-current, and pages rendered without server link state, are resolved at claim as before.

  • 5943f7f: serverRouteComponent with a bare GET(fn) source sends one request per link visit instead of two (#677). The router hands a preload's call to the next render with the same args, so the route mounts the result the hover or focus preload already started. The hand-off happens once, within the same 5 s window query() gives a preload. A later visit calls fresh, a failed preload makes the render retry, and concurrent preloads of the same args share one call. query() and liveQuery() sources are unchanged.

  • 828b232: Add useInRouter, which returns whether the calling component is rendered under a router. The other router primitives throw outside one, so components that also render there (an error fallback above the router, a shared link component) can check first instead of wrapping useLocation() in a try/catch. Like the other primitives, it throws when called with no reactive owner, such as from an event handler.

2.0.0-next.39

Patch Changes

  • f3b5f56: Put state, noscroll, replace, and preload back on JSX.AnchorHTMLAttributes by augmenting @solidjs/web/jsx-runtime. preload also accepts "viewport" and "eager". link stays owned by core. Pairs with the core change that removes those four props from the anchor type.
  • 4a85130: intentPreload preloads a link once per visit whichever intent comes first: a focus or touch on a link that already preloaded no longer preloads it again, and cancels a pending hover preload. A click after a hover, or a click with no dwell, now sends one preload instead of two.
  • ea24119: Follow client-side query redirects by status and origin. Keep local paths such as /next and server-function redirects relative to the router base. Other same-origin URLs use the history parser without adding the base again; targets outside the base, or URLs the integration cannot represent, navigate the document. A Location header on a non-redirect response stays data on the client, and the server-function carrier takes precedence. Server rendering is unchanged.
  • 5729e79: Require solid-js / @​solidjs/web 2.0.0-rc.15. Link and form claims follow rc.15's claim contract: an element's compiled mount claim fires once, after its initial attributes are applied, and later claims come from compiler-owned href/action writes or from claimElementTree sweeps (frame streams, morphs). The router's claim handlers are unchanged.
  • af98854: Server-rendered anchors carry link state (#654). The router sets the render's link handler (setLinkClaim from @solidjs/web), so plain anchors arrive with data-active and aria-current="page" in the server HTML instead of gaining them only after hydration, and pages that never hydrate mark the current page too. When the client claims an anchor from that HTML, it treats a server-written aria-current as its own and removes it on navigation. The peer floor for @solidjs/web and solid-js is raised to ^2.0.0-rc.15.

2.0.0-next.38

Patch Changes

  • 457ac72: Claimed anchors share one parse of the location and base path instead of re-parsing both per anchor, roughly halving the URL constructions link state does at load and on every navigation sweep.

  • fb43a9c: Link preloading on focusin and touchstart now works. Both went through the click handler's primary-button gate, which FocusEvent and TouchEvent never pass, so only a resting mouse pointer preloaded. Preload triggers now find the anchor without the button and modifier-key checks; click handling is unchanged.

  • 9618caa: Link preloading is now pluggable and opt-in. Breaking: the router no longer preloads on hover, focus, or touch by default; pass a strategy to restore it:

    import { createRouter, intentPreload } from "@solidjs/router";
    

    const Router = createRouter({ routes, preloadLinks: intentPreload() });

    • preloadLinks takes a strategy or an array of strategies instead of a boolean. A boolean is a type error, warns in development, and preloads nothing.
    • intentPreload({ delay = 20, data = true }) is the previous behavior: preload when the pointer rests on a link for delay ms, on focus, and on touchstart. data: false warms route code only.
    • preload="false" on a link now opts it out of preloading entirely. Previously it still preloaded the route's code and skipped only its data.
    • transformUrl now applies inside route preloading itself, so preloads match the same pathname navigation does, including usePreloadRoute calls, which previously matched the untransformed URL.

    Apps that don't preload links no longer ship the hover/focus/touch listeners.

... (truncated)

Commits
  • 42ef623 Merge pull request #683 from solidjs/changeset-release/next
  • 708d4f9 Version Packages (next)
  • 3e617a9 chore: make useInRouter changeset a patch while in pre-release
  • 91345fc Merge pull request #675 from everton-dgn/feat/optional-location
  • cce9fe2 Merge pull request #684 from solidjs/claude/project-thread-271xwi
  • 3832cd5 perf(claims): trust server link state at hydration
  • 4a1685e Merge pull request #682 from solidjs/claude/project-thread-6h93rx
  • 04d9177 Merge pull request #681 from solidjs/claude/project-thread-xvubyg
  • 79a2aef refactor(matching): decode a param only on the dynamic branch
  • 5943f7f fix(serverRouteComponent): hand a bare GET preload's call to the render (#677)
  • Additional commits viewable in compare view

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

Polylane reviews this pull request when you ask:

Review with Polylane

Checks

1 failing · 3 successful · 2 skipped · 1 neutral
Some checks failed

Failing1

00644ec

Added 1 commit

  • Bump @solidjs/router from 2.0.0-next.35 to 2.0.0-next.4000644ec
Synced from GitHub

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 2e0a1546-1f80-43cb-b905-80f662e56caf

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.