summaryrefslogtreecommitdiff
path: root/CHANGELOG.md
blob: ca5610a4a8f1499bf1314a52aef80321ae902730 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# Changelog

## 2.1.0

- **Jank support**: Ruuter now runs on [Jank](https://jank-lang.org) (built from source, latest main).
- **Jank benchmarks**: Benchmarks run on Jank using C++ interop (`std::chrono::high_resolution_clock`) for nanosecond timing via `cpp/raw`, since `System/nanoTime` is not available.
- **Example project**: Added `examples/jank-test-project/` with a standalone Jank example.
- **Jank test runner**: Added `jank_test.sh` and `jank_test_runner.jank` for running the test suite on Jank.

## 2.0.0

- **Best-match routing**: Routes are now matched by specificity instead of first-match-wins. Literal segments beat parameters, parameters beat optionals, optionals beat wildcards. Route order in the vector no longer matters.
- **Segment trie**: Routes are compiled into a trie (prefix tree) data structure for O(path-depth) matching instead of O(N) linear scan. This yields 4-380x performance improvements depending on route count and match type.
- **`compile-routes` function**: New public function for explicit route compilation. Routes are also compiled implicitly and cached via memoization when using `route` directly.
- **Single wildcard constraint**: Wildcard parameters (`:name*`) must now be the last segment in a path. Multiple wildcards per path are no longer supported.
- **No regex**: Route matching no longer uses regular expressions. Matching is done via direct string comparison of path segments against a trie.
- **deps.edn only**: Leiningen (`project.clj`) has been retired. All build, test, and benchmark tasks use `deps.edn` and `bb.edn`.

## 1.3.5

- Fixes an issue where the usage of wildcard parameters [did not work quite right](https://github.com/askonomm/ruuter/issues/7).
- Added test cases to cover the fix

## 1.3.4

- Fixes an issue where if used with middlewares (like Ring), or really anything that passes a `:params` key from outside of Ruuter in the request, Ruuter overwrites the `:params` key with its own parametarization. It now does a deep merge instead, with the outside parameters having priority. This means that Ruuter parameters will remain unless overwritten, and should co-exist with outside parameters nicely. [Issue #6](https://github.com/askonomm/ruuter/issues/6).

- Added and fixed some tests

## 1.3.3

- Removed ClojureScript from dependencies to make the bundle size smaller in case you want to use Ruuter with nbb.

## 1.3.2

- When using wildcard parameters, the keyword returned in ´:params´ of a request was ´:name*´, but aiming for consistency with an optional parameter where we remove the question mark ´?´, the asterisk has been removed. 

## 1.3.1 

- A small bugfix related to wildcard parameters losing the first character in the result.

## 1.3.0

- Fixed an issue with optional parameters not matching correctly when there were multiple optional paremeters in use.
- Implemented wildcard parameters in the form of `:name*`, which will match everything including forward slashes.

## 1.2.2

- Fixed an issue where CLJS compilation would fail because of the `(:gen-class)` that is JVM-only. 

- Tests are now runnable for CLJS as well.

## 1.2.1

- Fixed an issue with regex parsing. Sorry about that.

## 1.2.0

- Implemented optional route parameters, so now you can do paths like `/hi/:name?` in your routes, and it would match the route even if the `:name` is not present. All you have to do is add a question mark to the parameter, and that's it.

- Changed Ruuter from a .clj file to a .cljc file, so it would also work with ClojureScript. Although it would probably require a more hands-on set-up than just a drop-in to an HTTP server like http-kit or ring + jetty, there is no reason that the router itself wouldn't work as it does not rely on any platform-specific code.

- Ruuter also works with [Babashka](https://github.com/babashka/babashka), and I've created a "Setting up with Babashka" section in this README to show that.

## 1.1.0

- Made Ruuter server-agnostic, which means now it really is just a router and nothing else, and can thus be used with just about any HTTP server you can throw at it. It also means there are now zero dependencies! ZERO!