change: migrate to nightly
and csr
features rather than stable
and default-features = false
#1227
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #567.
Ideally, I would have done this from 0.0.1, but I was younger and more foolish then 😄.
Ideally, Cargo features should be additive, not subtractive or mutually exclusive, i.e., each feature should enable additional functionality in the crate.
We do use a few mutually-exclusive features (
csr
,ssr
, andhydrate
). This is because they enable different behavior or enable certain optimizations for the different platforms, in a better way than the alternatives. (For example, usingtarget_arch = wasm32
to detect the browser would fail to support the growing number of server-side WASM environments; using a generic View that could be either a DOM element or an SSR version wouldn't let us detect SSR mode for compile-time SSR optimizations; etc.)However, the
stable
feature was just a bad idea. The crate was originally nightly-only, and I added thestable
feature when asked to support stable. This causes some downstream issues for libraries due to feature unification.This PR reverses the current setup so that
nightly
is now an opt-in feature, which basically enables the function-call syntax for signal getters and setters.While we're breaking things, it also removes the default
csr
feature from theleptos
crate, which now works the same way asleptos_router
andleptos_meta
: you should opt intocsr
,ssr
, orhydrate
.This means that
leptos = "0.x"
should now be something likeleptos = { version = "0.x", features = ["csr", "nightly"] }
It also means all thedefault-features = false
can be dropped fromCargo.toml
for setups using SSR + hydration, as Leptos will no longer default to CSR.Todos