Skip to content

Commit

Permalink
refactor: cleaned up checkpoint() availability
Browse files Browse the repository at this point in the history
  • Loading branch information
arctic-hen7 committed Jan 12, 2023
1 parent 04b6c76 commit 72e8af4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
9 changes: 3 additions & 6 deletions packages/perseus/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,6 @@ pub type Request = ();
#[cfg(feature = "macros")]
pub use perseus_macro::*;

// Browser-side only
#[cfg(any(client, doc))]
pub use crate::utils::checkpoint;
#[cfg(all(feature = "client-helpers", any(client, doc)))]
pub use client::{run_client, ClientReturn};

/// Internal utilities for lower-level work.
#[cfg(engine)]
pub mod internal {
Expand Down Expand Up @@ -161,4 +155,7 @@ pub mod prelude {
#[cfg(feature = "macros")]
pub use perseus_macro::*;
pub use sycamore_futures::spawn_local_scoped;

#[cfg(any(client, doc))]
pub use crate::utils::checkpoint;
}
6 changes: 3 additions & 3 deletions packages/perseus/src/utils/checkpoint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ use crate::reactor::WindowVariable;
/// Note: this is not just for internal usage, it's highly recommended that you
/// use this for your own checkpoints as well! Just make sure your tests don't
/// conflict with any internal Perseus checkpoint names (preferably prefix yours
/// with `custom-` or the like, as Perseus' checkpoints may change at any time,
/// with `custom_` or the like, as Perseus' checkpoints may change at any time,
/// but won't ever use that namespace).
///
/// WARNING: your checkpoint names must not include hyphens! This will result in
/// a `panic!`.
/// **Warning:** your checkpoint names must not include hyphens! This will
/// result in a `panic!`.
pub fn checkpoint(name: &str) {
if name.contains('-') {
panic!("checkpoint must not contain hyphens, use underscores instead (hyphens are used as an internal delimiter)");
Expand Down

0 comments on commit 72e8af4

Please sign in to comment.