Unverified Commit 91861210 authored by Alex Kirszenberg's avatar Alex Kirszenberg Committed by GitHub

Port sorted-routes.ts to Rust (#48334)

`getSortedRoutes` is used in the `BuildManifestPlugin`, which I'm in the
process of porting to Next.js Turbo as part of Next Build. As such, I
ported it to Rust using GPT-4 (with manual review over the code).

The resulting code is not particularly idiomatic nor optimized Rust
code, but it passes all tests (similarly converted) and should be more
than fast enough for now.

In the process of porting, GPT-4 made some "suggestions" (read: it
automatically and silently changed parts of the code) which actually fix
some formatting issues with errors:
https://github.com/vercel/next.js/pull/48298Co-authored-by: 's avatarTobias Koppers <tobias.koppers@googlemail.com>
parent 051c90d4
......@@ -3252,6 +3252,7 @@ dependencies = [
"serde",
"serde_json",
"swc_core",
"thiserror",
"turbo-tasks",
"turbo-tasks-fs",
"turbopack-binding",
......
......@@ -23,6 +23,7 @@ indoc = { workspace = true }
allsorts = { workspace = true }
futures = { workspace = true }
lazy_static = { workspace = true }
thiserror = { workspace = true }
turbopack-binding = { workspace = true, features = [
"__swc_transform_modularize_imports",
"__swc_transform_relay",
......
......@@ -33,6 +33,7 @@ pub mod router;
pub mod router_source;
mod runtime;
mod transform_options;
pub mod url_node;
mod util;
mod web_entry_source;
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment