Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

yew-macro: remove transitive dependency on syn 1 #3752

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 23 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions packages/yew-macro/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ rust-version = "1.76.0"
proc-macro = true

[dependencies]
proc-macro-error = "1"
proc-macro-error2 = "2"
proc-macro2 = "1"
quote = "1"
syn = { version = "2", features = ["full", "extra-traits", "visit-mut"] }
Expand All @@ -31,4 +31,3 @@ yew = { path = "../yew" }

[lints.rust]
unexpected_cfgs = { level = "allow", check-cfg = ['cfg(nightly_yew)'] }

2 changes: 1 addition & 1 deletion packages/yew-macro/src/hook/body.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::sync::{Arc, Mutex};

use proc_macro_error::emit_error;
use proc_macro_error2::emit_error;
use syn::spanned::Spanned;
use syn::visit_mut::VisitMut;
use syn::{
Expand Down
2 changes: 1 addition & 1 deletion packages/yew-macro/src/hook/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use proc_macro2::{Span, TokenStream};
use proc_macro_error::emit_error;
use proc_macro_error2::emit_error;
use quote::quote;
use syn::parse::{Parse, ParseStream};
use syn::{
Expand Down
2 changes: 1 addition & 1 deletion packages/yew-macro/src/hook/signature.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use proc_macro2::{Span, TokenStream};
use proc_macro_error::emit_error;
use proc_macro_error2::emit_error;
use quote::{quote, ToTokens};
use syn::spanned::Spanned;
use syn::visit_mut::VisitMut;
Expand Down
2 changes: 1 addition & 1 deletion packages/yew-macro/src/html_tree/html_element.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use proc_macro2::{Delimiter, Group, Span, TokenStream};
use proc_macro_error::emit_warning;
use proc_macro_error2::emit_warning;
use quote::{quote, quote_spanned, ToTokens};
use syn::buffer::Cursor;
use syn::parse::{Parse, ParseStream};
Expand Down
2 changes: 1 addition & 1 deletion packages/yew-macro/src/html_tree/lint/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! Lints to catch possible misuse of the `html!` macro use. At the moment these are mostly focused
//! on accessibility.

use proc_macro_error::emit_warning;
use proc_macro_error2::emit_warning;
use syn::spanned::Spanned;

use super::html_element::{HtmlElement, TagName};
Expand Down
8 changes: 4 additions & 4 deletions packages/yew-macro/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,14 +112,14 @@ pub fn derive_props(input: TokenStream) -> TokenStream {
TokenStream::from(input.into_token_stream())
}

#[proc_macro_error::proc_macro_error]
#[proc_macro_error2::proc_macro_error]
#[proc_macro]
pub fn html_nested(input: TokenStream) -> TokenStream {
let root = parse_macro_input!(input as HtmlRoot);
TokenStream::from(root.into_token_stream())
}

#[proc_macro_error::proc_macro_error]
#[proc_macro_error2::proc_macro_error]
#[proc_macro]
pub fn html(input: TokenStream) -> TokenStream {
let root = parse_macro_input!(input as HtmlRootVNode);
Expand All @@ -138,7 +138,7 @@ pub fn classes(input: TokenStream) -> TokenStream {
TokenStream::from(classes.into_token_stream())
}

#[proc_macro_error::proc_macro_error]
#[proc_macro_error2::proc_macro_error]
#[proc_macro_attribute]
pub fn function_component(attr: TokenStream, item: TokenStream) -> proc_macro::TokenStream {
let item = parse_macro_input!(item as FunctionComponent);
Expand All @@ -149,7 +149,7 @@ pub fn function_component(attr: TokenStream, item: TokenStream) -> proc_macro::T
.into()
}

#[proc_macro_error::proc_macro_error]
#[proc_macro_error2::proc_macro_error]
#[proc_macro_attribute]
pub fn hook(attr: TokenStream, item: TokenStream) -> proc_macro::TokenStream {
let item = parse_macro_input!(item as HookFn);
Expand Down
Loading