lib.rs 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. #![doc = include_str!("../README.md")]
  2. //!
  3. //! ## Dioxus Crate Features
  4. //!
  5. //! This crate has several features that can be enabled to change the active renderer and enable various integrations:
  6. //!
  7. //! - `signals`: (default) re-exports `dioxus-signals`
  8. //! - `macro`: (default) re-exports `dioxus-macro`
  9. //! - `html`: (default) exports `dioxus-html` as the default elements to use in rsx
  10. //! - `hooks`: (default) re-exports `dioxus-hooks`
  11. //! - `hot-reload`: (default) enables hot rsx reloading in all renderers that support it
  12. //! - `router`: exports the [router](https://dioxuslabs.com/learn/0.5/router) and enables any router features for the current platform
  13. //! - `third-party-renderer`: Just disables warnings about no active platform when no renderers are enabled
  14. //!
  15. //! Platform features (the current platform determines what platform the [`launch()`] function runs):
  16. //!
  17. //! - `fullstack`: enables the fullstack platform. This must be used in combination with the `web` feature for wasm builds and `axum` feature for server builds
  18. //! - `desktop`: enables the desktop platform
  19. //! - `mobile`: enables the mobile platform
  20. //! - `web`: enables the web platform. If the fullstack platform is enabled, this will set the fullstack platform to client mode
  21. //! - `liveview`: enables the liveview platform
  22. //! - `static-generation`: enables the static generation platform. This must be used in combination with the `web` feature for wasm builds and `axum` feature for server builds
  23. //! - `axum`: enables the axum server with static generation or fullstack and sets the platform to server mode
  24. #![doc(html_logo_url = "https://avatars.githubusercontent.com/u/79236386")]
  25. #![doc(html_favicon_url = "https://avatars.githubusercontent.com/u/79236386")]
  26. #![cfg_attr(docsrs, feature(doc_cfg))]
  27. pub use dioxus_core;
  28. pub use dioxus_core::{CapturedError, Ok, Result};
  29. #[cfg(feature = "launch")]
  30. #[cfg_attr(docsrs, doc(cfg(feature = "launch")))]
  31. mod launch;
  32. #[cfg(feature = "launch")]
  33. #[cfg_attr(docsrs, doc(cfg(feature = "launch")))]
  34. #[allow(deprecated)]
  35. pub use launch::launch;
  36. #[cfg(feature = "hooks")]
  37. #[cfg_attr(docsrs, doc(cfg(feature = "hooks")))]
  38. pub use dioxus_hooks as hooks;
  39. #[cfg(feature = "signals")]
  40. #[cfg_attr(docsrs, doc(cfg(feature = "signals")))]
  41. pub use dioxus_signals as signals;
  42. pub mod events {
  43. #[cfg(feature = "html")]
  44. #[cfg_attr(docsrs, doc(cfg(feature = "html")))]
  45. pub use dioxus_html::prelude::*;
  46. }
  47. #[cfg(feature = "html")]
  48. #[cfg_attr(docsrs, doc(cfg(feature = "html")))]
  49. pub use dioxus_html as html;
  50. #[cfg(feature = "macro")]
  51. #[cfg_attr(docsrs, doc(cfg(feature = "macro")))]
  52. pub use dioxus_core_macro as core_macro;
  53. pub mod prelude {
  54. #[cfg(feature = "launch")]
  55. #[cfg_attr(docsrs, doc(cfg(feature = "launch")))]
  56. pub use crate::launch::*;
  57. #[cfg(feature = "hooks")]
  58. #[cfg_attr(docsrs, doc(cfg(feature = "hooks")))]
  59. pub use crate::hooks::*;
  60. #[cfg(feature = "signals")]
  61. #[cfg_attr(docsrs, doc(cfg(feature = "signals")))]
  62. pub use dioxus_signals::*;
  63. pub use dioxus_core::prelude::*;
  64. #[cfg(feature = "macro")]
  65. #[cfg_attr(docsrs, doc(cfg(feature = "macro")))]
  66. #[allow(deprecated)]
  67. pub use dioxus_core_macro::{component, rsx, Props};
  68. #[cfg(feature = "launch")]
  69. #[cfg_attr(docsrs, doc(cfg(feature = "launch")))]
  70. pub use dioxus_config_macro::*;
  71. #[cfg(feature = "html")]
  72. #[cfg_attr(docsrs, doc(cfg(feature = "html")))]
  73. pub use dioxus_html as dioxus_elements;
  74. #[cfg(feature = "html")]
  75. #[cfg_attr(docsrs, doc(cfg(feature = "html")))]
  76. pub use dioxus_elements::{global_attributes, prelude::*, svg_attributes};
  77. #[cfg(all(
  78. not(any(target_arch = "wasm32", target_os = "ios", target_os = "android")),
  79. feature = "hot-reload"
  80. ))]
  81. #[cfg_attr(docsrs, doc(cfg(feature = "hot-reload")))]
  82. pub use dioxus_hot_reload;
  83. pub use dioxus_core;
  84. #[cfg(feature = "fullstack")]
  85. #[cfg_attr(docsrs, doc(cfg(feature = "fullstack")))]
  86. pub use dioxus_fullstack::prelude::*;
  87. #[cfg(all(feature = "static-generation", not(feature = "fullstack")))]
  88. #[cfg_attr(
  89. docsrs,
  90. doc(cfg(all(feature = "static-generation", not(feature = "fullstack"))))
  91. )]
  92. pub use dioxus_static_site_generation::prelude::*;
  93. #[cfg(feature = "router")]
  94. #[cfg_attr(docsrs, doc(cfg(feature = "router")))]
  95. pub use dioxus_router;
  96. #[cfg(feature = "router")]
  97. #[cfg_attr(docsrs, doc(cfg(feature = "router")))]
  98. pub use dioxus_router::prelude::*;
  99. #[cfg(feature = "axum")]
  100. #[cfg_attr(docsrs, doc(cfg(feature = "axum")))]
  101. pub use axum;
  102. #[cfg(feature = "asset")]
  103. #[cfg_attr(docsrs, doc(cfg(feature = "asset")))]
  104. pub use manganis::{self, classes, mg as asset, ImageAsset, ImageType};
  105. }
  106. #[cfg(feature = "web")]
  107. #[cfg_attr(docsrs, doc(cfg(feature = "web")))]
  108. pub use dioxus_web as web;
  109. #[cfg(feature = "router")]
  110. #[cfg_attr(docsrs, doc(cfg(feature = "router")))]
  111. pub use dioxus_router as router;
  112. #[cfg(feature = "fullstack")]
  113. #[cfg_attr(docsrs, doc(cfg(feature = "fullstack")))]
  114. pub use dioxus_fullstack as fullstack;
  115. #[cfg(feature = "static-generation")]
  116. #[cfg_attr(docsrs, doc(cfg(feature = "static-generation")))]
  117. pub use dioxus_static_site_generation as static_site_generation;
  118. #[cfg(feature = "desktop")]
  119. #[cfg_attr(docsrs, doc(cfg(feature = "desktop")))]
  120. pub use dioxus_desktop as desktop;
  121. #[cfg(feature = "mobile")]
  122. #[cfg_attr(docsrs, doc(cfg(feature = "mobile")))]
  123. pub use dioxus_mobile as mobile;
  124. #[cfg(feature = "liveview")]
  125. #[cfg_attr(docsrs, doc(cfg(feature = "liveview")))]
  126. pub use dioxus_liveview as liveview;
  127. #[cfg(feature = "ssr")]
  128. #[cfg_attr(docsrs, doc(cfg(feature = "ssr")))]
  129. pub use dioxus_ssr as ssr;