invert stable and nightly features

This commit is contained in:
Greg Johnston 2023-05-05 17:27:49 -04:00
parent a5f6e0bac4
commit 0821de8a3a
25 changed files with 63 additions and 60 deletions

View file

@ -41,7 +41,7 @@ ssr = [
"leptos_meta/ssr",
"leptos_router/ssr",
]
stable = ["leptos/stable", "leptos_router/stable"]
nightly = ["leptos/nightly", "leptos_router/nightly"]
[package.metadata.cargo-all-features]
denylist = ["actix-files", "actix-web", "leptos_actix", "stable"]

View file

@ -23,7 +23,7 @@ server_fn = { workspace = true, default-features = false }
leptos = { path = ".", default-features = false }
[features]
default = ["csr", "serde"]
default = ["serde", "nightly"]
csr = [
"leptos_dom/web",
"leptos_macro/csr",
@ -44,11 +44,11 @@ ssr = [
"leptos_reactive/ssr",
"leptos_server/ssr",
]
stable = [
"leptos_dom/stable",
"leptos_macro/stable",
"leptos_reactive/stable",
"leptos_server/stable",
nightly = [
"leptos_dom/nightly",
"leptos_macro/nightly",
"leptos_reactive/nightly",
"leptos_server/nightly",
]
serde = ["leptos_reactive/serde"]
serde-lite = ["leptos_reactive/serde-lite"]
@ -57,8 +57,10 @@ rkyv = ["leptos_reactive/rkyv"]
tracing = ["leptos_macro/tracing"]
[package.metadata.cargo-all-features]
denylist = ["stable", "tracing"]
denylist = ["tracing"]
skip_feature_sets = [
[
],
[
"csr",
"ssr",

View file

@ -157,7 +157,7 @@ features = [
default = []
web = ["leptos_reactive/csr"]
ssr = ["leptos_reactive/ssr"]
stable = ["leptos_reactive/stable"]
nightly = ["leptos_reactive/nightly"]
[package.metadata.cargo-all-features]
denylist = ["stable"]

View file

@ -1,7 +1,7 @@
#![deny(missing_docs)]
#![forbid(unsafe_code)]
#![cfg_attr(not(feature = "stable"), feature(fn_traits))]
#![cfg_attr(not(feature = "stable"), feature(unboxed_closures))]
#![cfg_attr(feature = "nightly", feature(fn_traits))]
#![cfg_attr(feature = "nightly", feature(unboxed_closures))]
//! The DOM implementation for `leptos`.
@ -1125,7 +1125,7 @@ viewable_primitive![
];
cfg_if! {
if #[cfg(not(feature = "stable"))] {
if #[cfg(feature = "nightly")] {
viewable_primitive! {
std::backtrace::Backtrace
}

View file

@ -160,7 +160,7 @@ impl<T: ElementDescriptor> Clone for NodeRef<T> {
impl<T: ElementDescriptor + 'static> Copy for NodeRef<T> {}
cfg_if::cfg_if! {
if #[cfg(not(feature = "stable"))] {
if #[cfg(feature = "nightly")] {
impl<T: Clone + ElementDescriptor + 'static> FnOnce<()> for NodeRef<T> {
type Output = Option<HtmlElement<T>>;

View file

@ -39,7 +39,7 @@ default = ["ssr"]
csr = []
hydrate = []
ssr = []
stable = ["server_fn_macro/stable"]
nightly = ["server_fn_macro/nightly"]
tracing = []
[package.metadata.cargo-all-features]

View file

@ -1,4 +1,4 @@
#![cfg_attr(not(feature = "stable"), feature(proc_macro_span))]
#![cfg_attr(feature = "nightly", feature(proc_macro_span))]
#![forbid(unsafe_code)]
#[macro_use]
@ -353,7 +353,7 @@ pub fn view(tokens: TokenStream) -> TokenStream {
fn normalized_call_site(site: proc_macro::Span) -> Option<String> {
cfg_if::cfg_if! {
if #[cfg(all(debug_assertions, not(feature = "stable")))] {
if #[cfg(all(debug_assertions, feature = "nightly"))] {
Some(leptos_hot_reload::span_to_stable_id(
site.source_file().path(),
site.into()

View file

@ -68,15 +68,16 @@ hydrate = [
"dep:web-sys",
]
ssr = ["dep:tokio"]
stable = []
nightly = []
serde = []
serde-lite = ["dep:serde-lite"]
miniserde = ["dep:miniserde"]
rkyv = ["dep:rkyv", "dep:bytecheck"]
[package.metadata.cargo-all-features]
denylist = ["stable"]
skip_feature_sets = [
[
],
[
"csr",
"ssr",

View file

@ -1,7 +1,7 @@
#![deny(missing_docs)]
#![cfg_attr(not(feature = "stable"), feature(fn_traits))]
#![cfg_attr(not(feature = "stable"), feature(unboxed_closures))]
#![cfg_attr(not(feature = "stable"), feature(type_name_of_val))]
#![cfg_attr(feature = "nightly", feature(fn_traits))]
#![cfg_attr(feature = "nightly", feature(unboxed_closures))]
#![cfg_attr(feature = "nightly", feature(type_name_of_val))]
//! The reactive system for the [Leptos](https://docs.rs/leptos/latest/leptos/) Web framework.
//!

View file

@ -17,7 +17,7 @@ use thiserror::Error;
macro_rules! impl_get_fn_traits {
($($ty:ident $(($method_name:ident))?),*) => {
$(
#[cfg(not(feature = "stable"))]
#[cfg(feature = "nightly")]
impl<T: Clone> FnOnce<()> for $ty<T> {
type Output = T;
@ -27,7 +27,7 @@ macro_rules! impl_get_fn_traits {
}
}
#[cfg(not(feature = "stable"))]
#[cfg(feature = "nightly")]
impl<T: Clone> FnMut<()> for $ty<T> {
#[inline(always)]
extern "rust-call" fn call_mut(&mut self, _args: ()) -> Self::Output {
@ -35,7 +35,7 @@ macro_rules! impl_get_fn_traits {
}
}
#[cfg(not(feature = "stable"))]
#[cfg(feature = "nightly")]
impl<T: Clone> Fn<()> for $ty<T> {
#[inline(always)]
extern "rust-call" fn call(&self, _args: ()) -> Self::Output {
@ -55,7 +55,7 @@ macro_rules! impl_get_fn_traits {
macro_rules! impl_set_fn_traits {
($($ty:ident $($method_name:ident)?),*) => {
$(
#[cfg(not(feature = "stable"))]
#[cfg(feature = "nightly")]
impl<T> FnOnce<(T,)> for $ty<T> {
type Output = ();
@ -65,7 +65,7 @@ macro_rules! impl_set_fn_traits {
}
}
#[cfg(not(feature = "stable"))]
#[cfg(feature = "nightly")]
impl<T> FnMut<(T,)> for $ty<T> {
#[inline(always)]
extern "rust-call" fn call_mut(&mut self, args: (T,)) -> Self::Output {
@ -73,7 +73,7 @@ macro_rules! impl_set_fn_traits {
}
}
#[cfg(not(feature = "stable"))]
#[cfg(feature = "nightly")]
impl<T> Fn<(T,)> for $ty<T> {
#[inline(always)]
extern "rust-call" fn call(&self, args: (T,)) -> Self::Output {

View file

@ -225,7 +225,7 @@ impl SignalSet<()> for Trigger {
}
}
#[cfg(not(feature = "stable"))]
#[cfg(feature = "nightly")]
impl FnOnce<()> for Trigger {
type Output = ();
@ -235,7 +235,7 @@ impl FnOnce<()> for Trigger {
}
}
#[cfg(not(feature = "stable"))]
#[cfg(feature = "nightly")]
impl FnMut<()> for Trigger {
#[inline(always)]
extern "rust-call" fn call_mut(&mut self, _args: ()) -> Self::Output {
@ -243,7 +243,7 @@ impl FnMut<()> for Trigger {
}
}
#[cfg(not(feature = "stable"))]
#[cfg(feature = "nightly")]
impl Fn<()> for Trigger {
#[inline(always)]
extern "rust-call" fn call(&self, _args: ()) -> Self::Output {

View file

@ -1,10 +1,10 @@
#[cfg(not(feature = "stable"))]
#[cfg(feature = "nightly")]
use leptos_reactive::{
create_isomorphic_effect, create_memo, create_runtime, create_rw_signal,
create_scope, create_signal, SignalSet,
};
#[cfg(not(feature = "stable"))]
#[cfg(feature = "nightly")]
#[test]
fn effect_runs() {
use std::{cell::RefCell, rc::Rc};
@ -32,7 +32,7 @@ fn effect_runs() {
.dispose()
}
#[cfg(not(feature = "stable"))]
#[cfg(feature = "nightly")]
#[test]
fn effect_tracks_memo() {
use std::{cell::RefCell, rc::Rc};
@ -62,7 +62,7 @@ fn effect_tracks_memo() {
.dispose()
}
#[cfg(not(feature = "stable"))]
#[cfg(feature = "nightly")]
#[test]
fn untrack_mutes_effect() {
use std::{cell::RefCell, rc::Rc};
@ -92,7 +92,7 @@ fn untrack_mutes_effect() {
.dispose()
}
#[cfg(not(feature = "stable"))]
#[cfg(feature = "nightly")]
#[test]
fn batching_actually_batches() {
use std::{cell::Cell, rc::Rc};

View file

@ -1,9 +1,9 @@
#[cfg(not(feature = "stable"))]
#[cfg(feature = "nightly")]
use leptos_reactive::{
create_memo, create_runtime, create_scope, create_signal,
};
#[cfg(not(feature = "stable"))]
#[cfg(feature = "nightly")]
#[test]
fn basic_memo() {
create_scope(create_runtime(), |cx| {
@ -13,7 +13,7 @@ fn basic_memo() {
.dispose()
}
#[cfg(not(feature = "stable"))]
#[cfg(feature = "nightly")]
#[test]
fn memo_with_computed_value() {
create_scope(create_runtime(), |cx| {
@ -29,7 +29,7 @@ fn memo_with_computed_value() {
.dispose()
}
#[cfg(not(feature = "stable"))]
#[cfg(feature = "nightly")]
#[test]
fn nested_memos() {
create_scope(create_runtime(), |cx| {
@ -51,7 +51,7 @@ fn nested_memos() {
.dispose()
}
#[cfg(not(feature = "stable"))]
#[cfg(feature = "nightly")]
#[test]
fn memo_runs_only_when_inputs_change() {
use std::{cell::Cell, rc::Rc};
@ -94,7 +94,7 @@ fn memo_runs_only_when_inputs_change() {
.dispose()
}
#[cfg(not(feature = "stable"))]
#[cfg(feature = "nightly")]
#[test]
fn diamond_problem() {
use std::{cell::Cell, rc::Rc};
@ -131,7 +131,7 @@ fn diamond_problem() {
.dispose()
}
#[cfg(not(feature = "stable"))]
#[cfg(feature = "nightly")]
#[test]
fn dynamic_dependencies() {
use leptos_reactive::create_isomorphic_effect;

View file

@ -1,7 +1,7 @@
#[cfg(not(feature = "stable"))]
#[cfg(feature = "nightly")]
use leptos_reactive::{create_runtime, create_scope, create_signal};
#[cfg(not(feature = "stable"))]
#[cfg(feature = "nightly")]
#[test]
fn basic_signal() {
create_scope(create_runtime(), |cx| {
@ -13,7 +13,7 @@ fn basic_signal() {
.dispose()
}
#[cfg(not(feature = "stable"))]
#[cfg(feature = "nightly")]
#[test]
fn derived_signals() {
create_scope(create_runtime(), |cx| {

View file

@ -1,10 +1,10 @@
#[cfg(not(feature = "stable"))]
#[cfg(feature = "nightly")]
use leptos_reactive::{
create_isomorphic_effect, create_runtime, create_scope, create_signal,
signal_prelude::*, SignalGetUntracked, SignalSetUntracked,
};
#[cfg(not(feature = "stable"))]
#[cfg(feature = "nightly")]
#[test]
fn untracked_set_doesnt_trigger_effect() {
use std::{cell::RefCell, rc::Rc};
@ -36,7 +36,7 @@ fn untracked_set_doesnt_trigger_effect() {
.dispose()
}
#[cfg(not(feature = "stable"))]
#[cfg(feature = "nightly")]
#[test]
fn untracked_get_doesnt_trigger_effect() {
use std::{cell::RefCell, rc::Rc};

View file

@ -26,7 +26,7 @@ default-tls = ["server_fn/default-tls"]
hydrate = ["leptos_reactive/hydrate"]
rustls = ["server_fn/rustls"]
ssr = ["leptos_reactive/ssr", "server_fn/ssr"]
stable = ["leptos_reactive/stable", "server_fn/stable"]
nightly = ["leptos_reactive/nightly", "server_fn/nightly"]
[package.metadata.cargo-all-features]
denylist = ["stable"]

View file

@ -22,7 +22,7 @@ default = []
csr = ["leptos/csr", "leptos/tracing"]
hydrate = ["leptos/hydrate", "leptos/tracing"]
ssr = ["leptos/ssr", "leptos/tracing"]
stable = ["leptos/stable", "leptos/tracing"]
nightly = ["leptos/nightly", "leptos/tracing"]
[package.metadata.cargo-all-features]
denylist = ["stable"]

View file

@ -59,7 +59,7 @@ default = []
csr = ["leptos/csr"]
hydrate = ["leptos/hydrate"]
ssr = ["leptos/ssr", "dep:cached", "dep:lru", "dep:url", "dep:regex"]
stable = ["leptos/stable"]
nightly = ["leptos/nightly"]
[package.metadata.cargo-all-features]
# No need to test optional dependencies as they are enabled by the ssr feature

View file

@ -140,7 +140,7 @@ where
}
cfg_if::cfg_if! {
if #[cfg(not(feature = "stable"))] {
if #[cfg(feature = "nightly")] {
auto trait NotOption {}
impl<T> !NotOption for Option<T> {}

View file

@ -183,9 +183,9 @@
//! **Important Note:** You must enable one of `csr`, `hydrate`, or `ssr` to tell Leptos
//! which mode your app is operating in.
#![cfg_attr(not(feature = "stable"), feature(auto_traits))]
#![cfg_attr(not(feature = "stable"), feature(negative_impls))]
#![cfg_attr(not(feature = "stable"), feature(type_name_of_val))]
#![cfg_attr(feature = "nightly", feature(auto_traits))]
#![cfg_attr(feature = "nightly", feature(negative_impls))]
#![cfg_attr(feature = "nightly", feature(type_name_of_val))]
mod animation;
mod components;

View file

@ -34,4 +34,4 @@ default = ["default-tls"]
default-tls = ["reqwest/default-tls"]
rustls = ["reqwest/rustls-tls"]
ssr = []
stable = ["server_fn_macro_default/stable"]
nightly = ["server_fn_macro_default/nightly"]

View file

@ -19,4 +19,4 @@ server_fn = { version = "0.2" }
serde = "1"
[features]
stable = ["server_fn_macro/stable"]
nightly = ["server_fn_macro/nightly"]

View file

@ -1,4 +1,4 @@
#![cfg_attr(not(feature = "stable"), feature(proc_macro_span))]
#![cfg_attr(feature = "nightly", feature(proc_macro_span))]
//! This crate contains the default implementation of the #[macro@crate::server] macro without a context from the server. See the [server_fn_macro] crate for more information.
#![forbid(unsafe_code)]

View file

@ -18,4 +18,4 @@ xxhash-rust = { version = "0.8.6", features = ["const_xxh64"] }
const_format = "0.2.30"
[features]
stable = []
nightly = []

View file

@ -1,4 +1,4 @@
#![cfg_attr(not(feature = "stable"), feature(proc_macro_span))]
#![cfg_attr(feature = "nightly", feature(proc_macro_span))]
#![forbid(unsafe_code)]
#![deny(missing_docs)]
//! Implementation of the server_fn macro.