Skip to content
Open
Show file tree
Hide file tree
Changes from 66 commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
11669ba
Initialize @fedify/uri-template package
2chanhaeng Apr 27, 2026
6d49aa2
Update version of @fedify/uri-template
2chanhaeng Apr 28, 2026
9f2de18
Add test for template
2chanhaeng Apr 28, 2026
7e7e00f
Allow **/*.bench.ts files use `@fedfiy/fixture`
2chanhaeng May 1, 2026
d0649c5
Implement RFC 6570 URI template expansion
2chanhaeng May 1, 2026
f91e433
Add test suite for @fedify/uri-template Template
2chanhaeng May 1, 2026
17c0d56
Report URI template expansion errors
2chanhaeng May 2, 2026
8f11b96
Document URI template compatibility
2chanhaeng May 2, 2026
38e1e56
Refine URI template expansion internals
2chanhaeng May 4, 2026
c40d1dd
Add URI template matching
2chanhaeng May 4, 2026
a7eb594
Add test suite for URI template matching
2chanhaeng May 4, 2026
bc60cda
Add RFC 6570 Router class
2chanhaeng May 6, 2026
cb96d18
Add Router conformance tests
2chanhaeng May 6, 2026
377afe3
Capture legacy Router failures
2chanhaeng May 6, 2026
414c5df
Reorganize uri-template into per-feature module layouts
2chanhaeng May 6, 2026
35e05d7
Rename "symmetric" to "round-trip" in user-facing prose
2chanhaeng May 6, 2026
ba527dc
Rename router memory pressure scenario factories
2chanhaeng May 6, 2026
e1eef02
Document operator behavior table and drop dead constant
2chanhaeng May 6, 2026
054190f
Drop unused VariableSpec and align reporter docs with expansion
2chanhaeng May 6, 2026
2cf91d4
Document route-shape gaps in uri-template-router compatibility test
2chanhaeng May 6, 2026
6423cfe
Drop "using RegExp" qualifier from Template bench label
2chanhaeng May 6, 2026
7cbbae3
Add Router#register, batch trie insert, and constructor routes
2chanhaeng May 7, 2026
abba323
Move URI template old tests
2chanhaeng May 8, 2026
b6c984f
Group uri-template tests by suite via nested t.step
2chanhaeng May 8, 2026
b0f8c97
Export `isExpression` from @fedify/uri-template
2chanhaeng May 8, 2026
947eab6
Migrate @fedify/fedify to @fedify/uri-template router
2chanhaeng May 8, 2026
10ba258
Note uri-template router migration in CHANGES.md
2chanhaeng May 8, 2026
7b61101
Export isPath helper from @fedify/uri-template
2chanhaeng May 8, 2026
1777a10
Tighten match backtracking bounds in @fedify/uri-template
2chanhaeng May 8, 2026
0401fad
Replace match bench with backtracking-pressure cases
2chanhaeng May 8, 2026
f416197
Add PR link
2chanhaeng May 9, 2026
173ced9
Export `assertPath` from @fedify/uri-template
2chanhaeng May 9, 2026
fbcfb5f
Replace `Router` from @fedify/fedify with the wrapper of `Router` fro…
2chanhaeng May 9, 2026
a648835
Apply review feedback from PR #758
2chanhaeng May 9, 2026
2e23955
Fix `consumeUnnamed` over-pruning of valid match decompositions
2chanhaeng May 9, 2026
87b5e72
Fix `defaultReporter`
2chanhaeng May 11, 2026
087963a
Tighten identifier path validation in FederationBuilder
2chanhaeng May 11, 2026
89e29c6
Accept the empty path so trailing-slash retry can match `/`
2chanhaeng May 11, 2026
27a9c33
Polish naming and fixture comments in uri-template tests
2chanhaeng May 11, 2026
e54f804
Centralize expression parse error reporting in the tokenizer
2chanhaeng May 11, 2026
fa934ad
Drop stale router trie entries on re-registration
2chanhaeng May 11, 2026
50cc19f
Serialize Deno check tasks behind install in `mise test`
2chanhaeng May 11, 2026
c308c41
Make @fedify/uri-template default reporter a no-op
2chanhaeng May 11, 2026
13b4886
Recover round-trip for associative keys with non-varname characters
2chanhaeng May 11, 2026
925ae65
Split identifier path validation into loose and strict asserts
2chanhaeng May 12, 2026
e9f37c0
Exclude old/ compat tests from published @fedify/uri-template
2chanhaeng May 12, 2026
4ff472a
Reuse PrioritizedRouteEntry as the Trie entry constraint
2chanhaeng May 12, 2026
500fb38
Drop unused throw() helper from TemplateParseError
2chanhaeng May 12, 2026
4f339f4
Note compat Router shim breaking changes in changelog
2chanhaeng May 12, 2026
19cf5d9
Index router trie at the token level to share dynamic prefixes
2chanhaeng May 14, 2026
27c8422
Refactor router trie traversals with fold helpers
2chanhaeng May 14, 2026
cac5f2e
Fix lockfile
2chanhaeng May 14, 2026
1c506af
Remove unnecessary `as Path`
2chanhaeng May 15, 2026
e58208f
Make Router#register() failure-atomic
2chanhaeng May 15, 2026
d5e13a2
Update stale router design in uri-template README
2chanhaeng May 15, 2026
88aa535
Make registered router patterns immutable
2chanhaeng May 15, 2026
ce920dc
Reject path-style {/identifier} identifier routes
2chanhaeng May 16, 2026
5f874ff
Forward trailingSlashInsensitive in deprecated Router
2chanhaeng May 16, 2026
a303702
Keep deprecated RouterError instanceof working
2chanhaeng May 16, 2026
2c0ade5
Keep deprecated Router.route() a nullable probe
2chanhaeng May 16, 2026
acd53c7
Drop Breaking Change note from changelog
2chanhaeng May 16, 2026
e79c77b
Log deprecated Router warning once per process
2chanhaeng May 16, 2026
8bbaaba
Document standalone @fedify/uri-template in docs
2chanhaeng May 18, 2026
ffa5ac6
Clarify that test:old intentionally fails
2chanhaeng May 18, 2026
f1773eb
Add per-variable matching constraints to Router
2chanhaeng May 19, 2026
7e735d0
Validate dispatcher paths via Router route options
2chanhaeng May 19, 2026
a8d4a06
Bind unbound nullable scalars as null in route values
2chanhaeng May 19, 2026
56c20be
Fix URI Template and outbox doc inaccuracies
2chanhaeng May 19, 2026
754b18e
Fix explodable route value typing
2chanhaeng May 19, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,13 @@ To be released.
and other high-cardinality identifiers are deliberately excluded
from the fanout histogram. [[#316], [#742], [#770]]

- Replaced Fedify's internal federation routing with
*@fedify/uri-template* for stricter RFC 6570 URI Template expansion and
matching. The deprecated `Router` export from *@fedify/fedify* remains
available for compatibility. [[#418], [#758] by ChanHaeng Lee]

[#316]: https://github.com/fedify-dev/fedify/issues/316
[#418]: https://github.com/fedify-dev/fedify/issues/418
[#619]: https://github.com/fedify-dev/fedify/issues/619
[#735]: https://github.com/fedify-dev/fedify/issues/735
[#736]: https://github.com/fedify-dev/fedify/issues/736
Expand All @@ -125,6 +131,7 @@ To be released.
[#753]: https://github.com/fedify-dev/fedify/pull/753
[#755]: https://github.com/fedify-dev/fedify/pull/755
[#757]: https://github.com/fedify-dev/fedify/pull/757
[#758]: https://github.com/fedify-dev/fedify/pull/758
[#759]: https://github.com/fedify-dev/fedify/pull/759
[#769]: https://github.com/fedify-dev/fedify/pull/769
[#770]: https://github.com/fedify-dev/fedify/pull/770
Expand All @@ -140,6 +147,13 @@ To be released.
- Added a `meterProvider` option to `createFederation()` so mock contexts can
expose a test OpenTelemetry meter provider. [[#316], [#619], [#755]]

### @fedify/uri-template

- Added *@fedify/uri-template*, a dependency-free RFC 6570 URI Template
implementation for expansion, variable extraction, and round-trip route
matching. This package replaces Fedify's previous direct use of
*url-template* and *uri-template-router*. [[#418], [#758] by ChanHaeng Lee]

### @fedify/amqp

- Added `AmqpMessageQueue.getDepth()` for reporting queued, ready, and
Expand Down
9 changes: 9 additions & 0 deletions cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,11 @@
"docloader",
"dotenvx",
"draft-cavage",
"duplicable",
"eddsa",
"elysia",
"elysiajs",
"explodable",
"fanout",
"federatable",
"Federatable",
Expand Down Expand Up @@ -79,6 +81,7 @@
"nodeinfo",
"nuxi",
"nuxt",
"operatables",
"optique",
"phensley",
"Pico",
Expand All @@ -88,6 +91,7 @@
"popd",
"poppanator",
"precommand",
"prefixable",
"proto",
"pushd",
"pwsh",
Expand Down Expand Up @@ -121,6 +125,11 @@
"urlpattern",
"uuidv7",
"valueparser",
"varspec",
"varname",
"varnames",
"varchar",
"varchars",
"Vinxi",
"vitepress",
"vtsls",
Expand Down
1 change: 1 addition & 0 deletions deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"./packages/sqlite",
"./packages/sveltekit",
"./packages/testing",
"./packages/uri-template",
Comment thread
coderabbitai[bot] marked this conversation as resolved.
"./packages/vocab",
"./packages/vocab-runtime",
"./packages/vocab-tools",
Expand Down
6 changes: 1 addition & 5 deletions deno.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 7 additions & 4 deletions docs/manual/actor.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,13 @@ should fall through to the next middleware or `onNotFound` handler.

> [!NOTE]
> The URI Template syntax supports different expansion types like `{identifier}`
> (simple expansion) and `{+identifier}` (reserved expansion). Choosing the
> right expansion type is important to avoid encoding issues. See the
> [*URI Template* guide](./uri-template.md) for details on when to use
> each type.
> (simple expansion) and `{+identifier}` (reserved expansion). Use the plain
> `{identifier}` form for ordinary segment-bounded identifiers such as
> `/users/{identifier}`. `{+identifier}` is an advanced choice reserved for
> identifiers that themselves contain slashes (such as embedded URIs); because
> it keeps `/` literal, it can consume extra path segments and overlap with
> more specific routes. See the [*URI Template* guide](./uri-template.md) for
> details on when to use each type.

[actors]: https://www.w3.org/TR/activitystreams-core/#actors
[activities]: https://www.w3.org/TR/activitystreams-core/#activities
Expand Down
9 changes: 6 additions & 3 deletions docs/manual/collections.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,12 @@ follows the [URI Template] specification.

> [!NOTE]
> The URI Template syntax supports different expansion types like `{identifier}`
> (simple expansion) and `{+identifier}` (reserved expansion). If your
> identifiers contain URIs or special characters, you may need to use
> `{+identifier}` to avoid double-encoding issues. See the
> (simple expansion) and `{+identifier}` (reserved expansion). Use the plain
> `{identifier}` form for ordinary segment-bounded identifiers; `{+identifier}`
> is an advanced choice reserved for identifiers that themselves contain
> slashes (such as embedded URIs), since it keeps `/` literal and can consume
> extra path segments. Note that a writable outbox is further restricted to
> the strict `{identifier}` shape and rejects `{+identifier}`. See the
> [*URI Template* guide](./uri-template.md) for details.

Since the outbox is a collection of activities, the outbox dispatcher should
Expand Down
11 changes: 7 additions & 4 deletions docs/manual/inbox.md
Original file line number Diff line number Diff line change
Expand Up @@ -182,10 +182,13 @@ multiple inbox listeners for different activity types.

> [!NOTE]
> The URI Template syntax supports different expansion types like `{identifier}`
> (simple expansion) and `{+identifier}` (reserved expansion). If your
> identifiers contain URIs or special characters, you may need to use
> `{+identifier}` to avoid double-encoding issues. See the
> [*URI Template* guide](./uri-template.md) for details.
> (simple expansion) and `{+identifier}` (reserved expansion). Use the plain
> `{identifier}` form for ordinary segment-bounded identifiers such as
> `/users/{identifier}/inbox`. `{+identifier}` is an advanced choice reserved
> for identifiers that themselves contain slashes (such as embedded URIs);
> because it keeps `/` literal, it can consume extra path segments and overlap
> with more specific routes, so add explicit validation when you use it. See
> the [*URI Template* guide](./uri-template.md) for details.

> [!WARNING]
> Activities of any type that are not registered with
Expand Down
10 changes: 7 additions & 3 deletions docs/manual/outbox.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,13 @@ actor who owns the addressed outbox.
> [!NOTE]
> The URI Template syntax supports different expansion types like
> `{identifier}` (simple expansion) and `{+identifier}` (reserved expansion).
> If your identifiers contain URIs or special characters, you may need to use
> `{+identifier}` to avoid double-encoding issues. See the
> [*URI Template* guide][uri-template-guide] for details.
> Use the plain `{identifier}` form for ordinary segment-bounded identifiers;
> `{+identifier}` is an advanced choice reserved for identifiers that
> themselves contain slashes (such as embedded URIs). The outbox is
> additionally restricted: `~Federatable.setOutboxListeners()` requires the
> strict single-segment `{identifier}` shape and rejects `{+identifier}` at
> registration time, so a writable outbox cannot use reserved expansion. See
> the [*URI Template* guide][uri-template-guide] for details.

[uri-template-guide]: ./uri-template.md

Expand Down
Loading