Skip to main content

leptos_sync_macros/
lib.rs

1//! Leptos-Sync Macros
2//! 
3//! This crate provides derive macros for automatic CRDT implementation
4//! and local-first collection setup.
5
6use proc_macro::TokenStream;
7use quote::quote;
8use syn::{parse_macro_input, DeriveInput};
9
10/// Derive macro for automatic CRDT implementation
11#[proc_macro_derive(LocalFirst, attributes(local_first))]
12pub fn derive_local_first(input: TokenStream) -> TokenStream {
13    let input = parse_macro_input!(input as DeriveInput);
14    
15    // Implementation will be added here
16    let name = input.ident;
17    
18    let expanded = quote! {
19        impl LocalFirst for #name {
20            // Auto-generated implementation
21        }
22    };
23    
24    TokenStream::from(expanded)
25}