Alan Agius bca5683893 feat(@angular/ssr): dynamic route resolution using Angular router
This enhancement eliminates the dependency on file extensions for server-side rendering (SSR) route handling, leveraging Angular's router configuration for more dynamic and flexible route determination. Additionally, configured redirectTo routes now correctly respond with a 302 redirect status.

The new router uses a radix tree for storing routes. This data structure allows for efficient prefix-based lookups and insertions, which is particularly crucial when dealing with nested and parameterized routes.

This change also lays the groundwork for potential future server-side routing configurations, further enhancing the capabilities of Angular's SSR functionality.
2024-08-14 11:05:12 +02:00

56 lines
1.2 KiB
Python

load("@npm//@angular/build-tooling/bazel/spec-bundling:index.bzl", "spec_bundle")
load("@npm//@bazel/jasmine:index.bzl", "jasmine_node_test")
load("//tools:defaults.bzl", "ts_library")
ESM_TESTS = [
"app_spec.ts",
"app-engine_spec.ts",
"routes/router_spec.ts",
]
ts_library(
name = "unit_test_lib",
testonly = True,
srcs = glob(
include = ["**/*_spec.ts"],
exclude = ESM_TESTS,
),
deps = [
"//packages/angular/ssr",
],
)
ts_library(
name = "unit_test_with_esm_deps_lib",
testonly = True,
srcs = ESM_TESTS + ["testing-utils.ts"],
deps = [
"//packages/angular/ssr",
"@npm//@angular/common",
"@npm//@angular/compiler",
"@npm//@angular/core",
"@npm//@angular/platform-browser",
"@npm//@angular/platform-server",
"@npm//@angular/router",
"@npm//zone.js",
],
)
spec_bundle(
name = "unit_test_with_esm_deps_lib_bundled",
downlevel_async_await = False,
platform = "node",
run_angular_linker = False,
deps = [
":unit_test_with_esm_deps_lib",
],
)
jasmine_node_test(
name = "test",
deps = [
":unit_test_lib",
":unit_test_with_esm_deps_lib_bundled",
],
)