Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
d6d3bb7
Initialize @fedify/uri-template package
2chanhaeng Apr 27, 2026
b041c47
Update version of @fedify/uri-template
2chanhaeng Apr 28, 2026
4221e43
Add test for template
2chanhaeng Apr 28, 2026
dbccf03
Allow **/*.bench.ts files use `@fedfiy/fixture`
2chanhaeng May 1, 2026
1a3b080
Implement RFC 6570 URI template expansion
2chanhaeng May 1, 2026
cc9c68d
Add test suite for @fedify/uri-template Template
2chanhaeng May 1, 2026
36ab25b
Report URI template expansion errors
2chanhaeng May 2, 2026
de606cf
Document URI template compatibility
2chanhaeng May 2, 2026
acd9ac8
Refine URI template expansion internals
2chanhaeng May 4, 2026
fb7807a
Add URI template matching
2chanhaeng May 4, 2026
3348c5b
Add test suite for URI template matching
2chanhaeng May 4, 2026
8a2f337
Add RFC 6570 Router class
2chanhaeng May 6, 2026
b072abd
Add Router conformance tests
2chanhaeng May 6, 2026
7888035
Capture legacy Router failures
2chanhaeng May 6, 2026
f2db97a
Reorganize uri-template into per-feature module layouts
2chanhaeng May 6, 2026
570429d
Rename "symmetric" to "round-trip" in user-facing prose
2chanhaeng May 6, 2026
22e9da8
Rename router memory pressure scenario factories
2chanhaeng May 6, 2026
a51a070
Document operator behavior table and drop dead constant
2chanhaeng May 6, 2026
6b78dff
Drop unused VariableSpec and align reporter docs with expansion
2chanhaeng May 6, 2026
6156fe7
Document route-shape gaps in uri-template-router compatibility test
2chanhaeng May 6, 2026
34690b6
Drop "using RegExp" qualifier from Template bench label
2chanhaeng May 6, 2026
efaf83e
Add Router#register, batch trie insert, and constructor routes
2chanhaeng May 7, 2026
5ebd5aa
Move URI template old tests
2chanhaeng May 8, 2026
50778c1
Group uri-template tests by suite via nested t.step
2chanhaeng May 8, 2026
87e7013
Export `isExpression` from @fedify/uri-template
2chanhaeng May 8, 2026
5be2a99
Migrate @fedify/fedify to @fedify/uri-template router
2chanhaeng May 8, 2026
99c7051
Note uri-template router migration in CHANGES.md
2chanhaeng May 8, 2026
6adf06e
Export isPath helper from @fedify/uri-template
2chanhaeng May 8, 2026
4d0ce91
Tighten match backtracking bounds in @fedify/uri-template
2chanhaeng May 8, 2026
231aa34
Replace match bench with backtracking-pressure cases
2chanhaeng May 8, 2026
a3e6b4e
Add PR link
2chanhaeng May 9, 2026
6a80126
Export `assertPath` from @fedify/uri-template
2chanhaeng May 9, 2026
e91fe93
Replace `Router` from @fedify/fedify with the wrapper of `Router` fro…
2chanhaeng May 9, 2026
07736ce
Apply review feedback from PR #758
2chanhaeng May 9, 2026
182756d
Fix `consumeUnnamed` over-pruning of valid match decompositions
2chanhaeng May 9, 2026
2b851bf
Fix `defaultReporter`
2chanhaeng May 11, 2026
f8bdc89
Tighten identifier path validation in FederationBuilder
2chanhaeng May 11, 2026
a17d17a
Accept the empty path so trailing-slash retry can match `/`
2chanhaeng May 11, 2026
8ef9cbd
Polish naming and fixture comments in uri-template tests
2chanhaeng May 11, 2026
2b45604
Centralize expression parse error reporting in the tokenizer
2chanhaeng May 11, 2026
f1a633b
Drop stale router trie entries on re-registration
2chanhaeng May 11, 2026
b9b72fe
Serialize Deno check tasks behind install in `mise test`
2chanhaeng May 11, 2026
85b8c05
Make @fedify/uri-template default reporter a no-op
2chanhaeng May 11, 2026
eb5e4b3
Recover round-trip for associative keys with non-varname characters
2chanhaeng May 11, 2026
95462f0
Split identifier path validation into loose and strict asserts
2chanhaeng May 12, 2026
7cac609
Exclude old/ compat tests from published @fedify/uri-template
2chanhaeng May 12, 2026
a03a50d
Reuse PrioritizedRouteEntry as the Trie entry constraint
2chanhaeng May 12, 2026
4b2057f
Drop unused throw() helper from TemplateParseError
2chanhaeng May 12, 2026
e0036ad
Note compat Router shim breaking changes in changelog
2chanhaeng May 12, 2026
31786d4
Index router trie at the token level to share dynamic prefixes
2chanhaeng May 14, 2026
c77e82f
Refactor router trie traversals with fold helpers
2chanhaeng May 14, 2026
f99e5bc
Fix lockfile
2chanhaeng May 14, 2026
8407a34
Remove unnecessary `as Path`
2chanhaeng May 15, 2026
022c314
Make Router#register() failure-atomic
2chanhaeng May 15, 2026
7c81ef2
Update stale router design in uri-template README
2chanhaeng May 15, 2026
0dac1a9
Make registered router patterns immutable
2chanhaeng May 15, 2026
3f729c9
Reject path-style {/identifier} identifier routes
2chanhaeng May 16, 2026
9756b4c
Forward trailingSlashInsensitive in deprecated Router
2chanhaeng May 16, 2026
d5e346d
Keep deprecated RouterError instanceof working
2chanhaeng May 16, 2026
f83968b
Keep deprecated Router.route() a nullable probe
2chanhaeng May 16, 2026
a031672
Drop Breaking Change note from changelog
2chanhaeng May 16, 2026
924c223
Log deprecated Router warning once per process
2chanhaeng May 16, 2026
0da4cc5
Document standalone @fedify/uri-template in docs
2chanhaeng May 18, 2026
2d6d080
Clarify that test:old intentionally fails
2chanhaeng May 18, 2026
b25d61c
Add per-variable matching constraints to Router
2chanhaeng May 19, 2026
a44e9cd
Validate dispatcher paths via Router route options
2chanhaeng May 19, 2026
67f13c3
Bind unbound nullable scalars as null in route values
2chanhaeng May 19, 2026
13d9f19
Fix URI Template and outbox doc inaccuracies
2chanhaeng May 19, 2026
f9f1c04
Fix explodable route value typing
2chanhaeng May 19, 2026
bb5e874
Key route value typing off resolved `multiple`, not `explodable`
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 @@ -151,7 +151,13 @@ To be released.
`http.response.status_code` and a richer
`activitypub.lookup.result` taxonomy. [[#316], [#738], [#771]]

- 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 @@ -164,6 +170,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 @@ -180,6 +187,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
11 changes: 8 additions & 3 deletions docs/manual/outbox.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,14 @@ 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: both `~Federatable.setOutboxDispatcher()` and
> `~Federatable.setOutboxListeners()` require the strict single-segment
> `{identifier}` shape and reject `{+identifier}` at registration time, so a
> writable (or read-only) outbox cannot use reserved expansion. See
> the [*URI Template* guide][uri-template-guide] for details.

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

Expand Down
Loading
Loading