Skip to content

Handle static routes on attach #60

Closed

Description

@nielsenko

Tricky case:

routerA.attach(/foo, routerB);
routerB.add('/bar', o);
routerA.lookup('/foo/bar'); // <-- should this be possible?

This is very easy to support for dynamic routes due to shared trie nodes (and kind of difficult to avoid). I wonder if the static route optimization carry its weight enough to complicate this scenario.

Activity

  1. self-assigned this
    on May 8, 2025
  2. moved this from Backlog to Next 🌟 in Relic Roadmapon May 8, 2025
  3. nielsenko commented on May 9, 2025

    @nielsenko
    CollaboratorAuthor

    I'll rework the logic so that all routes are maintained in the trie (making attach easy).

    Static routes will still benefit from lookup in a HashMap, but this will now be constructed lazily on lookup, so that it will be correctly populated after an attach operation. This means that the first lookup will always hit the trie.

  4. moved this from Next 🌟 to Now 🔥 in Relic Roadmapon May 9, 2025
  5. moved this from Now 🔥 to Done in Relic Roadmapon May 9, 2025
  6. moved this from Inbox 📫 to Done 🚀 in Serverpod Frameworkson Aug 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Relationships

None yet

Development

No branches or pull requests

Issue actions