diff --git a/crates/oxc_ast/Cargo.toml b/crates/oxc_ast/Cargo.toml index 2f951462640b2..669db141a2b00 100644 --- a/crates/oxc_ast/Cargo.toml +++ b/crates/oxc_ast/Cargo.toml @@ -21,7 +21,7 @@ doctest = false [dependencies] oxc_allocator = { workspace = true } oxc_ast_macros = { workspace = true } -oxc_data_structures = { workspace = true } +oxc_data_structures = { workspace = true, features = ["inline_string"] } oxc_estree = { workspace = true } oxc_regular_expression = { workspace = true } oxc_span = { workspace = true } diff --git a/crates/oxc_codegen/Cargo.toml b/crates/oxc_codegen/Cargo.toml index 22721355abca9..5a9c9ef0419be 100644 --- a/crates/oxc_codegen/Cargo.toml +++ b/crates/oxc_codegen/Cargo.toml @@ -22,7 +22,7 @@ doctest = false [dependencies] oxc_allocator = { workspace = true } oxc_ast = { workspace = true } -oxc_data_structures = { workspace = true } +oxc_data_structures = { workspace = true, features = ["code_buffer", "stack"] } oxc_index = { workspace = true } oxc_semantic = { workspace = true } oxc_sourcemap = { workspace = true } diff --git a/crates/oxc_data_structures/Cargo.toml b/crates/oxc_data_structures/Cargo.toml index 5017277cc20f4..a6b0e7f02364c 100644 --- a/crates/oxc_data_structures/Cargo.toml +++ b/crates/oxc_data_structures/Cargo.toml @@ -21,5 +21,13 @@ test = true doctest = false [dependencies] -assert-unchecked = { workspace = true } -ropey = { workspace = true } +assert-unchecked = { workspace = true, optional = true } +ropey = { workspace = true, optional = true } + +[features] +default = [] +all = ["code_buffer", "inline_string", "rope", "stack"] +code_buffer = ["dep:assert-unchecked"] +inline_string = [] +rope = ["dep:ropey"] +stack = ["dep:assert-unchecked"] diff --git a/crates/oxc_data_structures/src/lib.rs b/crates/oxc_data_structures/src/lib.rs index 8de8c3c94d6bf..f4e47146dd173 100644 --- a/crates/oxc_data_structures/src/lib.rs +++ b/crates/oxc_data_structures/src/lib.rs @@ -2,7 +2,11 @@ #![warn(missing_docs)] +#[cfg(feature = "code_buffer")] pub mod code_buffer; +#[cfg(feature = "inline_string")] pub mod inline_string; +#[cfg(feature = "rope")] pub mod rope; +#[cfg(feature = "stack")] pub mod stack; diff --git a/crates/oxc_estree/Cargo.toml b/crates/oxc_estree/Cargo.toml index a2f32a60623fc..2c526bba17d06 100644 --- a/crates/oxc_estree/Cargo.toml +++ b/crates/oxc_estree/Cargo.toml @@ -19,7 +19,7 @@ workspace = true doctest = false [dependencies] -oxc_data_structures = { workspace = true, optional = true } +oxc_data_structures = { workspace = true, features = ["code_buffer"], optional = true } itoa = { workspace = true, optional = true } ryu-js = { workspace = true, optional = true } diff --git a/crates/oxc_language_server/Cargo.toml b/crates/oxc_language_server/Cargo.toml index 8e58c2526a550..555e705075345 100644 --- a/crates/oxc_language_server/Cargo.toml +++ b/crates/oxc_language_server/Cargo.toml @@ -23,7 +23,7 @@ doctest = false [dependencies] oxc_allocator = { workspace = true } -oxc_data_structures = { workspace = true } +oxc_data_structures = { workspace = true, features = ["rope"] } oxc_diagnostics = { workspace = true } oxc_linter = { workspace = true } oxc_parser = { workspace = true } diff --git a/crates/oxc_mangler/Cargo.toml b/crates/oxc_mangler/Cargo.toml index ed33157a465e4..f00eaa67af29a 100644 --- a/crates/oxc_mangler/Cargo.toml +++ b/crates/oxc_mangler/Cargo.toml @@ -23,7 +23,7 @@ doctest = false [dependencies] oxc_allocator = { workspace = true } oxc_ast = { workspace = true } -oxc_data_structures = { workspace = true } +oxc_data_structures = { workspace = true, features = ["inline_string"] } oxc_index = { workspace = true } oxc_semantic = { workspace = true } oxc_span = { workspace = true } diff --git a/crates/oxc_minifier/Cargo.toml b/crates/oxc_minifier/Cargo.toml index d9b79b71d5030..d16992bef5c3f 100644 --- a/crates/oxc_minifier/Cargo.toml +++ b/crates/oxc_minifier/Cargo.toml @@ -25,7 +25,7 @@ oxc_allocator = { workspace = true } oxc_ast = { workspace = true } oxc_ast_visit = { workspace = true } oxc_codegen = { workspace = true } -oxc_data_structures = { workspace = true } +oxc_data_structures = { workspace = true, features = ["stack"] } oxc_ecmascript = { workspace = true } oxc_mangler = { workspace = true } oxc_parser = { workspace = true } diff --git a/crates/oxc_semantic/Cargo.toml b/crates/oxc_semantic/Cargo.toml index fe83decaabb4c..bc126b9699ea7 100644 --- a/crates/oxc_semantic/Cargo.toml +++ b/crates/oxc_semantic/Cargo.toml @@ -23,7 +23,7 @@ oxc_allocator = { workspace = true } oxc_ast = { workspace = true } oxc_ast_visit = { workspace = true } oxc_cfg = { workspace = true } -oxc_data_structures = { workspace = true } +oxc_data_structures = { workspace = true, features = ["stack"] } oxc_diagnostics = { workspace = true } oxc_ecmascript = { workspace = true } oxc_index = { workspace = true } diff --git a/crates/oxc_transformer/Cargo.toml b/crates/oxc_transformer/Cargo.toml index 022108bce5bb5..7b87f167ad8e2 100644 --- a/crates/oxc_transformer/Cargo.toml +++ b/crates/oxc_transformer/Cargo.toml @@ -25,7 +25,7 @@ oxc-browserslist = { workspace = true } oxc_allocator = { workspace = true } oxc_ast = { workspace = true } oxc_ast_visit = { workspace = true } -oxc_data_structures = { workspace = true } +oxc_data_structures = { workspace = true, features = ["rope", "stack"] } oxc_diagnostics = { workspace = true } oxc_ecmascript = { workspace = true } oxc_parser = { workspace = true } diff --git a/crates/oxc_traverse/Cargo.toml b/crates/oxc_traverse/Cargo.toml index 46db8963cbdb0..e36eb8679fde8 100644 --- a/crates/oxc_traverse/Cargo.toml +++ b/crates/oxc_traverse/Cargo.toml @@ -26,7 +26,7 @@ doctest = true oxc_allocator = { workspace = true } oxc_ast = { workspace = true } oxc_ast_visit = { workspace = true } -oxc_data_structures = { workspace = true } +oxc_data_structures = { workspace = true, features = ["stack"] } oxc_ecmascript = { workspace = true } oxc_semantic = { workspace = true } oxc_span = { workspace = true }