ui2: Do not enable 'stories' feature by default. (#3363)
This cuts down LLVM IR size from 3 million lines to 700k in debug build. This then leads to ~3s compile time in debug build (without incremental on ui itself), as opposed to 10.5s on main. Release Notes: - N/A
This commit is contained in:
commit
b67193e322
4 changed files with 18 additions and 12 deletions
|
@ -18,5 +18,5 @@ theme2 = { path = "../theme2" }
|
||||||
rand = "0.8"
|
rand = "0.8"
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = ["stories"]
|
default = []
|
||||||
stories = ["dep:itertools"]
|
stories = ["dep:itertools"]
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
|
|
||||||
use gpui::{div, DefiniteLength, Hsla, MouseButton, StatefulInteractiveComponent, WindowContext};
|
use gpui::{DefiniteLength, Hsla, MouseButton, StatefulInteractiveComponent, WindowContext};
|
||||||
|
|
||||||
use crate::prelude::*;
|
use crate::prelude::*;
|
||||||
use crate::{h_stack, Icon, IconButton, IconElement, Label, LineHeightStyle, TextColor};
|
use crate::{h_stack, Icon, IconButton, IconElement, Label, LineHeightStyle, TextColor};
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
use gpui::Action;
|
use gpui::{actions, Action};
|
||||||
use strum::EnumIter;
|
use strum::EnumIter;
|
||||||
|
|
||||||
use crate::prelude::*;
|
use crate::prelude::*;
|
||||||
|
@ -74,24 +74,24 @@ pub enum ModifierKey {
|
||||||
Shift,
|
Shift,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
actions!(NoAction);
|
||||||
|
|
||||||
|
pub fn binding(key: &str) -> gpui::KeyBinding {
|
||||||
|
gpui::KeyBinding::new(key, NoAction {}, None)
|
||||||
|
}
|
||||||
|
|
||||||
#[cfg(feature = "stories")]
|
#[cfg(feature = "stories")]
|
||||||
pub use stories::*;
|
pub use stories::*;
|
||||||
|
|
||||||
#[cfg(feature = "stories")]
|
#[cfg(feature = "stories")]
|
||||||
mod stories {
|
mod stories {
|
||||||
use super::*;
|
use super::*;
|
||||||
use crate::Story;
|
pub use crate::KeyBinding;
|
||||||
use gpui::{actions, Div, Render};
|
use crate::{binding, Story};
|
||||||
|
use gpui::{Div, Render};
|
||||||
use itertools::Itertools;
|
use itertools::Itertools;
|
||||||
|
|
||||||
pub struct KeybindingStory;
|
pub struct KeybindingStory;
|
||||||
|
|
||||||
actions!(NoAction);
|
|
||||||
|
|
||||||
pub fn binding(key: &str) -> gpui::KeyBinding {
|
|
||||||
gpui::KeyBinding::new(key, NoAction {}, None)
|
|
||||||
}
|
|
||||||
|
|
||||||
impl Render for KeybindingStory {
|
impl Render for KeybindingStory {
|
||||||
type Element = Div<Self>;
|
type Element = Div<Self>;
|
||||||
|
|
||||||
|
|
|
@ -24,6 +24,7 @@ mod to_extract;
|
||||||
pub mod utils;
|
pub mod utils;
|
||||||
|
|
||||||
pub use components::*;
|
pub use components::*;
|
||||||
|
use gpui::actions;
|
||||||
pub use prelude::*;
|
pub use prelude::*;
|
||||||
pub use static_data::*;
|
pub use static_data::*;
|
||||||
pub use styled_ext::*;
|
pub use styled_ext::*;
|
||||||
|
@ -42,3 +43,8 @@ pub use crate::settings::*;
|
||||||
mod story;
|
mod story;
|
||||||
#[cfg(feature = "stories")]
|
#[cfg(feature = "stories")]
|
||||||
pub use story::*;
|
pub use story::*;
|
||||||
|
actions!(NoAction);
|
||||||
|
|
||||||
|
pub fn binding(key: &str) -> gpui::KeyBinding {
|
||||||
|
gpui::KeyBinding::new(key, NoAction {}, None)
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue