refactor!: rename slhx to hemx

Rename the tracked product identity, crate/package names, Rust paths/macros, generated artifacts, runtime files, public attributes, examples, docs, requirements, and tests from slhx to hemx without compatibility shims.

Verified with cargo run -p hemx-xtask -- test, cargo test -p hemx-derive --test compile_fail, cargo test -p hemx-js, cargo test -p hemx-axum, cargo test -p hemx-v0-examples, cargo check --workspace, redgate list, redgate refs, redgate health --strict, git diff --check, and git grep/ls-files legacy-name audits.

req: misc/001

req: codegen/001

req: component/004

req: runtime/001
This commit is contained in:
slhx agent
2026-06-05 06:52:37 +02:00
parent d4e865ef92
commit c33500440e
69 changed files with 1415 additions and 1415 deletions
+14 -14
View File
@@ -1,12 +1,12 @@
#[slhx::surface]
#[hemx::surface]
pub mod ui {}
#[cfg(test)]
mod tests {
use super::ui::{auth, counter, notifications, page_swap, todos, wizard};
use hemplate::Hemplate;
use slhx::{push, IntoEffect};
use slhx_test::inspect;
use hemx::{push, IntoEffect};
use hemx_test::inspect;
#[derive(Clone, Debug)]
struct Todo {
@@ -15,19 +15,19 @@ mod tests {
}
#[derive(Clone, Debug)]
#[slhx::form("new_todo")]
#[hemx::form("new_todo")]
struct TodoInput {
title: String,
}
#[derive(Clone, Debug)]
#[slhx::form("wizard_input")]
#[hemx::form("wizard_input")]
struct WizardInput {
step: u8,
}
#[derive(Clone, Debug)]
#[slhx::form("credentials")]
#[hemx::form("credentials")]
struct Credentials {
email: String,
password: String,
@@ -40,8 +40,8 @@ mod tests {
title: String,
}
impl slhx::KeyedPartial for TodoRow {
fn slhx_key(&self) -> String {
impl hemx::KeyedPartial for TodoRow {
fn hemx_key(&self) -> String {
self.id.to_string()
}
}
@@ -67,8 +67,8 @@ mod tests {
// req: examples/001 req: form/001 req: form/004 req: form/006 req: derive_handler/003
#[test]
fn form_handler_is_checked_against_hemplate_form() {
#[slhx::handler]
fn add_todo(_form: slhx::Form<TodoInput>) -> impl IntoEffect {
#[hemx::handler]
fn add_todo(_form: hemx::Form<TodoInput>) -> impl IntoEffect {
todos::todo_list.set("queued")
}
@@ -101,8 +101,8 @@ mod tests {
// req: examples/001 req: form/001 req: form/004 req: form/006 req: derive_handler/003
#[test]
fn wizard_form_handler_is_checked_against_hemplate_form() {
#[slhx::handler]
fn next_step(_form: slhx::Form<WizardInput>) -> impl IntoEffect {
#[hemx::handler]
fn next_step(_form: hemx::Form<WizardInput>) -> impl IntoEffect {
wizard::wizard_step.set("queued")
}
@@ -146,8 +146,8 @@ mod tests {
// req: examples/001 req: form/001 req: form/004 req: form/006 req: derive_handler/003
#[test]
fn auth_form_handler_is_checked_against_hemplate_form() {
#[slhx::handler]
fn login(_form: slhx::Form<Credentials>) -> impl IntoEffect {
#[hemx::handler]
fn login(_form: hemx::Form<Credentials>) -> impl IntoEffect {
auth::login_status.set("queued")
}
+32 -32
View File
@@ -4,12 +4,12 @@ use axum::routing::get;
use axum::Router;
use futures_util::{stream, StreamExt};
use hemplate::Hemplate;
use slhx::{Html, IntoEffect};
use slhx_axum::{
use hemx::{Html, IntoEffect};
use hemx_axum::{
interactions, runtime_js, sse, EffectResponse, Form, InteractionRequest, PageRequest, Registry,
};
use slhx_v0_examples::ui;
use slhx_v0_examples::ui::{auth, counter, notifications, page_swap, todo_row, todos, wizard};
use hemx_v0_examples::ui;
use hemx_v0_examples::ui::{auth, counter, notifications, page_swap, todo_row, todos, wizard};
use std::collections::BTreeMap;
use std::convert::Infallible;
use std::net::SocketAddr;
@@ -31,28 +31,28 @@ struct TodoRecord {
title: String,
}
#[slhx::form("new_todo")]
#[hemx::form("new_todo")]
struct NewTodo {
title: String,
}
#[slhx::form("rename_todo")]
#[hemx::form("rename_todo")]
struct RenameTodo {
id: u64,
title: String,
}
#[slhx::form("delete_todo")]
#[hemx::form("delete_todo")]
struct DeleteTodo {
id: u64,
}
#[slhx::form("wizard_input")]
#[hemx::form("wizard_input")]
struct WizardInput {
step: String,
}
#[slhx::form("credentials")]
#[hemx::form("credentials")]
struct Credentials {
email: String,
password: String,
@@ -82,8 +82,8 @@ struct TodoRow {
title: String,
}
impl slhx::KeyedPartial for TodoRow {
fn slhx_key(&self) -> String {
impl hemx::KeyedPartial for TodoRow {
fn hemx_key(&self) -> String {
self.id.to_string()
}
}
@@ -129,12 +129,12 @@ async fn main() {
.route("/", get(home).post(interact))
.route("/docs", get(docs).post(interact))
.route("/events", get(events))
.route("/slhx.js", get(runtime))
.route("/hemx.js", get(runtime))
.with_state(state);
let addr = SocketAddr::from(([127, 0, 0, 1], 3000));
let listener = tokio::net::TcpListener::bind(addr).await.unwrap();
println!("slhx v0 examples: http://{addr}");
println!("hemx v0 examples: http://{addr}");
axum::serve(listener, app).await.unwrap();
}
@@ -142,7 +142,7 @@ async fn main() {
async fn home(request: PageRequest) -> impl IntoResponse {
request
.page_html(all_examples(), shell)
.title("slhx v0 examples")
.title("hemx v0 examples")
.fingerprint(ui::BUILD_FINGERPRINT)
}
@@ -188,7 +188,7 @@ async fn events(Query(params): Query<BTreeMap<String, String>>) -> impl IntoResp
sse(batches)
}
#[slhx::app(
#[hemx::app(
counter_handlers,
todo_handlers,
todo_row_handlers,
@@ -216,11 +216,11 @@ fn shell(body: Html) -> Html {
ui::render(&AppShell { body })
}
#[slhx::component("counter")]
#[hemx::component("counter")]
mod counter_handlers {
use super::*;
#[slhx::handler]
#[hemx::handler]
async fn increment(State(state): State<Arc<ExampleState>>) -> impl IntoEffect {
// req: examples/001
let mut counter = state.counter.lock().unwrap();
@@ -229,11 +229,11 @@ mod counter_handlers {
}
}
#[slhx::component("todos")]
#[hemx::component("todos")]
mod todo_handlers {
use super::*;
#[slhx::handler]
#[hemx::handler]
async fn add_todo(
State(state): State<Arc<ExampleState>>,
Form(form): Form<NewTodo>,
@@ -261,7 +261,7 @@ mod todo_handlers {
))
}
#[slhx::handler]
#[hemx::handler]
async fn rename_todo(
State(state): State<Arc<ExampleState>>,
Form(form): Form<RenameTodo>,
@@ -269,7 +269,7 @@ mod todo_handlers {
rename_todo_effect(state, form)
}
#[slhx::handler]
#[hemx::handler]
async fn delete_todo(
State(state): State<Arc<ExampleState>>,
Form(form): Form<DeleteTodo>,
@@ -278,11 +278,11 @@ mod todo_handlers {
}
}
#[slhx::component("todo_row")]
#[hemx::component("todo_row")]
mod todo_row_handlers {
use super::*;
#[slhx::handler]
#[hemx::handler]
async fn rename_todo_row(
State(state): State<Arc<ExampleState>>,
Form(form): Form<RenameTodo>,
@@ -290,7 +290,7 @@ mod todo_row_handlers {
rename_todo_effect(state, form)
}
#[slhx::handler]
#[hemx::handler]
async fn delete_todo_row(
State(state): State<Arc<ExampleState>>,
Form(form): Form<DeleteTodo>,
@@ -299,11 +299,11 @@ mod todo_row_handlers {
}
}
#[slhx::component("wizard")]
#[hemx::component("wizard")]
mod wizard_handlers {
use super::*;
#[slhx::handler]
#[hemx::handler]
async fn next_step(
State(state): State<Arc<ExampleState>>,
Form(form): Form<WizardInput>,
@@ -316,11 +316,11 @@ mod wizard_handlers {
}
}
#[slhx::component("auth")]
#[hemx::component("auth")]
mod auth_handlers {
use super::*;
#[slhx::handler]
#[hemx::handler]
async fn login(
State(_state): State<Arc<ExampleState>>,
Form(credentials): Form<Credentials>,
@@ -401,7 +401,7 @@ fn render_docs_content(message: &'static str) -> Html {
mod tests {
use super::*;
use scraper::{Html, Selector};
use slhx_test::{
use hemx_test::{
article_selector, document_title_selector, escaped_markup_selector, heading_selector,
inspect_batch, keyed_items_selector, keyed_selector, list_item_selector,
page_nav_link_selector, prose_selector, root_element_selector, runtime_script_selector,
@@ -411,8 +411,8 @@ mod tests {
Selector::parse(value).expect("test selector parses")
}
fn form<I>(handle: slhx::Handle<I>, fields: &[(&str, &str)]) -> slhx_axum::InteractionForm {
slhx_axum::InteractionForm::for_handle(
fn form<I>(handle: hemx::Handle<I>, fields: &[(&str, &str)]) -> hemx_axum::InteractionForm {
hemx_axum::InteractionForm::for_handle(
handle,
fields
.iter()
@@ -430,7 +430,7 @@ mod tests {
.select(&selector(document_title_selector()))
.next()
.map(|title| title.text().collect::<String>()),
Some("slhx v0 examples".to_owned())
Some("hemx v0 examples".to_owned())
);
assert_eq!(
document