Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
a2853cd
Initialize @fedify/uri-template package
2chanhaeng Apr 27, 2026
312afa1
Update version of @fedify/uri-template
2chanhaeng Apr 28, 2026
403beef
Add test for template
2chanhaeng Apr 28, 2026
b88c8ce
Allow **/*.bench.ts files use `@fedfiy/fixture`
2chanhaeng May 1, 2026
6a77012
Implement RFC 6570 URI template expansion
2chanhaeng May 1, 2026
fa10600
Add test suite for @fedify/uri-template Template
2chanhaeng May 1, 2026
6e1c9be
Report URI template expansion errors
2chanhaeng May 2, 2026
847e267
Document URI template compatibility
2chanhaeng May 2, 2026
bfd737d
Refine URI template expansion internals
2chanhaeng May 4, 2026
4746d46
Add URI template matching
2chanhaeng May 4, 2026
2d17e84
Add test suite for URI template matching
2chanhaeng May 4, 2026
a61061c
Add RFC 6570 Router class
2chanhaeng May 6, 2026
f1e0c58
Add Router conformance tests
2chanhaeng May 6, 2026
5ea6195
Capture legacy Router failures
2chanhaeng May 6, 2026
2b12fff
Reorganize uri-template into per-feature module layouts
2chanhaeng May 6, 2026
a9dba34
Rename "symmetric" to "round-trip" in user-facing prose
2chanhaeng May 6, 2026
1ee7dc9
Rename router memory pressure scenario factories
2chanhaeng May 6, 2026
a57a857
Document operator behavior table and drop dead constant
2chanhaeng May 6, 2026
6adebd6
Drop unused VariableSpec and align reporter docs with expansion
2chanhaeng May 6, 2026
2d11ed7
Document route-shape gaps in uri-template-router compatibility test
2chanhaeng May 6, 2026
99a35a6
Drop "using RegExp" qualifier from Template bench label
2chanhaeng May 6, 2026
e3ee87f
Add Router#register, batch trie insert, and constructor routes
2chanhaeng May 7, 2026
ae3690a
Move URI template old tests
2chanhaeng May 8, 2026
24a38f6
Group uri-template tests by suite via nested t.step
2chanhaeng May 8, 2026
de681ed
Export `isExpression` from @fedify/uri-template
2chanhaeng May 8, 2026
749e520
Migrate @fedify/fedify to @fedify/uri-template router
2chanhaeng May 8, 2026
641a9e4
Note uri-template router migration in CHANGES.md
2chanhaeng May 8, 2026
76b842c
Export isPath helper from @fedify/uri-template
2chanhaeng May 8, 2026
a0e690b
Tighten match backtracking bounds in @fedify/uri-template
2chanhaeng May 8, 2026
4876f79
Replace match bench with backtracking-pressure cases
2chanhaeng May 8, 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
13 changes: 13 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,13 @@ To be released.
attributes, and `TraceActivityRecord.activityJson` is present only when the
span event includes full activity JSON. [[#316], [#619], [#755]]

- 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]]

[#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
[#748]: https://github.com/fedify-dev/fedify/pull/748
Expand All @@ -60,6 +66,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]]

### @fedify/amqp

- Added `AmqpMessageQueue.getDepth()` for reporting queued, ready, and
Expand Down
5 changes: 5 additions & 0 deletions cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,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",
"./packages/vocab",
"./packages/vocab-runtime",
"./packages/vocab-tools",
Expand Down
3 changes: 3 additions & 0 deletions packages/fedify/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ Here is the list of packages:
| [@fedify/sqlite](/packages/sqlite/) | [JSR][jsr:@fedify/sqlite] | [npm][npm:@fedify/sqlite] | SQLite driver |
| [@fedify/sveltekit](/packages/sveltekit/) | [JSR][jsr:@fedify/sveltekit] | [npm][npm:@fedify/sveltekit] | SvelteKit integration |
| [@fedify/testing](/packages/testing/) | [JSR][jsr:@fedify/testing] | [npm][npm:@fedify/testing] | Testing utilities |
| [@fedify/uri-template](/packages/uri-template/) | [JSR][jsr:@fedify/uri-template] | [npm][npm:@fedify/uri-template] | RFC 6570 URI Template library |
| [@fedify/vocab](/packages/vocab/) | [JSR][jsr:@fedify/vocab] | [npm][npm:@fedify/vocab] | Activity Vocabulary library |
| [@fedify/vocab-runtime](/packages/vocab-runtime/) | [JSR][jsr:@fedify/vocab-runtime] | [npm][npm:@fedify/vocab-runtime] | Runtime library for code-generated vocab |
| [@fedify/vocab-tools](/packages/vocab-tools/) | [JSR][jsr:@fedify/vocab-tools] | [npm][npm:@fedify/vocab-tools] | Code generation tools for Activity Vocab |
Expand Down Expand Up @@ -176,6 +177,8 @@ Here is the list of packages:
[npm:@fedify/sveltekit]: https://www.npmjs.com/package/@fedify/sveltekit
[jsr:@fedify/testing]: https://jsr.io/@fedify/testing
[npm:@fedify/testing]: https://www.npmjs.com/package/@fedify/testing
[jsr:@fedify/uri-template]: https://jsr.io/@fedify/uri-template
[npm:@fedify/uri-template]: https://www.npmjs.com/package/@fedify/uri-template
[jsr:@fedify/vocab]: https://jsr.io/@fedify/vocab
[npm:@fedify/vocab]: https://www.npmjs.com/package/@fedify/vocab
[jsr:@fedify/vocab-runtime]: https://jsr.io/@fedify/vocab-runtime
Expand Down
1 change: 1 addition & 0 deletions packages/fedify/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@
}
},
"dependencies": {
"@fedify/uri-template": "workspace:*",
"@fedify/vocab": "workspace:*",
"@fedify/vocab-runtime": "workspace:*",
"@fedify/webfinger": "workspace:*",
Expand Down
33 changes: 32 additions & 1 deletion packages/fedify/src/federation/builder.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { test } from "@fedify/fixture";
import { RouterError } from "@fedify/uri-template";
import { Activity, Note, Person } from "@fedify/vocab";
import { assertEquals, assertExists, assertThrows } from "@std/assert";
import type { Protocol } from "../nodeinfo/types.ts";
Expand All @@ -13,7 +14,6 @@ import type {
} from "./callback.ts";
import { MemoryKvStore } from "./kv.ts";
import type { FederationImpl } from "./middleware.ts";
import { RouterError } from "./router.ts";

test("FederationBuilder", async (t) => {
await t.step(
Expand Down Expand Up @@ -211,6 +211,27 @@ test("FederationBuilder", async (t) => {
),
RouterError,
);
assertThrows(
() =>
builderAfterInvalid.setOutboxListeners(
"/users/{identifier:3}/outbox" as `${string}{identifier}${string}`,
),
RouterError,
);
assertThrows(
() =>
builderAfterInvalid.setOutboxListeners(
"/users/{identifier*}/outbox" as `${string}{identifier}${string}`,
),
RouterError,
);
assertThrows(
() =>
builderAfterInvalid.setOutboxListeners(
"/users/{identifier,identifier}/outbox" as `${string}{identifier}${string}`,
),
RouterError,
);
builderAfterInvalid.setOutboxListeners("/users/{identifier}/outbox");

const builder2 = createFederationBuilder<void>();
Expand Down Expand Up @@ -240,6 +261,16 @@ test("FederationBuilder", async (t) => {
),
RouterError,
);

const builder5 = createFederationBuilder<void>();
assertThrows(
() =>
builder5.setOutboxDispatcher(
"/users/{identifier:3}/outbox" as `${string}{identifier}${string}`,
() => ({ items: [] }),
),
RouterError,
);
});

await t.step("should pass build options correctly", async () => {
Expand Down
Loading