-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Rework a bunch of cfg(feature) flags to be more principled #2666
Conversation
Visit the preview URL for this PR (updated for commit 371a434): https://yew-rs-api--pr2666-universal-scheduler-3dtmbqa6.web.app (expires Sat, 14 May 2022 14:56:37 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 |
Size Comparison
✅ None of the examples has changed their size significantly. |
leads to bundle size increase, so stick to the optimized version
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR looks good. Just a couple of changes to provide a better experience
We should consider moving to a principled log solution, like the log crate, after measuring impact on code size instead?
This is something I brought up before but it never got anywhere: we don't need to. The browser offers a way to filter logs in the console. We need to log at proper levels and let the browser handle the rest.
We can't provide LOG environment variable so if we end up using log, a recompile would be needed to change the log levels
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please also update the Supported Features
section in lib.rs
to reflect the current status of features?
|
Description
spawn_local
is now always present, soSuspension::from_future
etc is not feature/platform gated anyway. The scheduler for async panics on unsupported platforms. We could go for not compiling instead when ssr without a specific platform like tokio is enabled. Having to writeany(target_arch = .., feature = .. list all supported platforms)
is a no-go for me. Just do whatwasm_bindgen
does.doc_test
andwasm_test
have been removed. The former without replacement,cfg(doctest)
is stable if one needs it. The latter replaced withtarget_arch = "wasm32"
.trace_hydration
removed. Instead, a way to get the lifecycle logs for a component was re-introduced. We should consider moving to a principled log solution, like thelog
crate, after measuring impact on code size instead?feat_
submodules and imports moved into there from top-level. Honestlylifecycle.rs
is still a bit of a mess, but this PR is a start towards Feature soundness is a chore to deal with #2641Checklist