feat(api): keep raw tokens out of prelude
Move generated metadata tokens behind a hidden compatibility export and tighten the public contract test so the beginner prelude stays focused on generated authoring, Html, forms, navigation, and IntoEffect. req: dx/006 req: public_api/005
This commit is contained in:
@@ -145,6 +145,12 @@ fn public_prelude_does_not_export_low_level_primitives() {
|
|||||||
"ResourceId",
|
"ResourceId",
|
||||||
"EffectBatch",
|
"EffectBatch",
|
||||||
"BuildFingerprint",
|
"BuildFingerprint",
|
||||||
|
"Atom",
|
||||||
|
"ComponentRef",
|
||||||
|
"EventName",
|
||||||
|
"GeneratedTarget",
|
||||||
|
"Handle",
|
||||||
|
"ParamName",
|
||||||
] {
|
] {
|
||||||
assert!(
|
assert!(
|
||||||
!exported.contains(&token),
|
!exported.contains(&token),
|
||||||
|
|||||||
+12
-5
@@ -6,10 +6,17 @@
|
|||||||
use hemx_core::{Effect, KeyedSlot, SafeHtml, Slot};
|
use hemx_core::{Effect, KeyedSlot, SafeHtml, Slot};
|
||||||
|
|
||||||
pub use hemx_core::{
|
pub use hemx_core::{
|
||||||
navigate, push, redirect, replace, Atom, ComponentRef, CssClass, CssClasses, EventName, Form,
|
navigate, push, redirect, replace, CssClass, CssClasses, Form, FormContract, FormControlKind,
|
||||||
FormContract, FormControlKind, FormError, FormField, FormModel, FormValue, FromForm,
|
FormError, FormField, FormModel, FormValue, FromForm, IntoEffect,
|
||||||
GeneratedTarget, Handle, IntoEffect, ParamName,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/// Generated metadata tokens used by macros, generated code, integrations, and tests.
|
||||||
|
///
|
||||||
|
/// These stay addressable for compatibility, but ordinary app code should use generated
|
||||||
|
/// helpers instead of naming raw handles, params, events, atoms, or component refs.
|
||||||
|
/// req: dx/006 req: public_api/005
|
||||||
|
#[doc(hidden)]
|
||||||
|
pub use hemx_core::{Atom, ComponentRef, EventName, GeneratedTarget, Handle, ParamName};
|
||||||
pub use hemx_derive::{app, component, form, handler, surface};
|
pub use hemx_derive::{app, component, form, handler, surface};
|
||||||
|
|
||||||
/// Advanced/raw hemx primitives used by generated code, integrations, and tests.
|
/// Advanced/raw hemx primitives used by generated code, integrations, and tests.
|
||||||
@@ -171,8 +178,8 @@ where
|
|||||||
pub mod prelude {
|
pub mod prelude {
|
||||||
pub use crate::{page, Html};
|
pub use crate::{page, Html};
|
||||||
pub use hemx_core::{
|
pub use hemx_core::{
|
||||||
navigate, push, redirect, replace, Atom, ComponentRef, CssClass, CssClasses, EventName,
|
navigate, push, redirect, replace, CssClass, CssClasses, Form, FormModel, FormValue,
|
||||||
Form, FormModel, FormValue, Handle, IntoEffect, ParamName,
|
IntoEffect,
|
||||||
};
|
};
|
||||||
pub use hemx_derive::{app, component, form, handler, surface};
|
pub use hemx_derive::{app, component, form, handler, surface};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user