Skip to content

Commit 382958a

Browse files
committed
feat(span)!: remove re-exports of string types from oxc_span crate (#21246)
For historical reasons, `oxc_span` crate was re-exporting string types which now live in `oxc_str` crate. Remove these re-exports, and import these types directly from `oxc_str`. Main motivation is just that it makes sense, but it should also have a minor positive effect on compile times - `oxc_span` and `oxc_str` crates can now be compiled in parallel.
1 parent c4aedfa commit 382958a

173 files changed

Lines changed: 322 additions & 174 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/generated/ast_changes_watch_list.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ src:
3131
- 'crates/oxc_parser/src/**/*.rs'
3232
- 'crates/oxc_regular_expression/src/**/*.rs'
3333
- 'crates/oxc_span/src/**/*.rs'
34+
- 'crates/oxc_str/src/**/*.rs'
3435
- 'crates/oxc_syntax/src/**/*.rs'
3536
- 'crates/oxc_traverse/src/generated/ancestor.rs'
3637
- 'crates/oxc_traverse/src/generated/scopes_collector.rs'

Cargo.lock

Lines changed: 13 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apps/oxlint/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ oxc_napi = { workspace = true }
3939
oxc_parser = { workspace = true }
4040
oxc_semantic = { workspace = true }
4141
oxc_span = { workspace = true }
42+
oxc_str = { workspace = true }
4243

4344
bpaf = { workspace = true, features = ["autocomplete", "bright-color", "derive"] }
4445
cow-utils = { workspace = true }

apps/oxlint/src/output_formatter/json.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
use std::{cell::RefCell, rc::Rc};
22

3+
use oxc_str::CompactStr;
4+
35
use miette::JSONReportHandler;
4-
use oxc_span::CompactStr;
56
use rustc_hash::FxHashSet;
67
use serde::Serialize;
78

crates/oxc_ast/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ oxc_diagnostics = { workspace = true }
2727
oxc_estree = { workspace = true }
2828
oxc_regular_expression = { workspace = true }
2929
oxc_span = { workspace = true }
30+
oxc_str = { workspace = true }
3031
oxc_syntax = { workspace = true }
3132

3233
bitflags = { workspace = true }

crates/oxc_ast/src/ast/js.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ use std::cell::Cell;
2525
use oxc_allocator::{Box, CloneIn, Dummy, GetAddress, TakeIn, UnstableAddress, Vec};
2626
use oxc_ast_macros::ast;
2727
use oxc_estree::ESTree;
28-
use oxc_span::{ContentEq, GetSpan, GetSpanMut, Ident, SourceType, Span, Str};
28+
use oxc_span::{ContentEq, GetSpan, GetSpanMut, SourceType, Span};
29+
use oxc_str::{Ident, Str};
2930
use oxc_syntax::{
3031
node::NodeId,
3132
operator::{

crates/oxc_ast/src/ast/jsx.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ use std::cell::Cell;
99
use oxc_allocator::{Box, CloneIn, Dummy, GetAddress, TakeIn, UnstableAddress, Vec};
1010
use oxc_ast_macros::ast;
1111
use oxc_estree::ESTree;
12-
use oxc_span::{ContentEq, GetSpan, GetSpanMut, Span, Str};
12+
use oxc_span::{ContentEq, GetSpan, GetSpanMut, Span};
13+
use oxc_str::Str;
1314
use oxc_syntax::node::NodeId;
1415

1516
use super::{inherit_variants, js::*, literal::*, ts::*};

crates/oxc_ast/src/ast/literal.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ use oxc_allocator::{Box, CloneIn, Dummy, TakeIn, UnstableAddress};
1111
use oxc_ast_macros::ast;
1212
use oxc_estree::ESTree;
1313
use oxc_regular_expression::ast::Pattern;
14-
use oxc_span::{ContentEq, GetSpan, GetSpanMut, Span, Str};
14+
use oxc_span::{ContentEq, GetSpan, GetSpanMut, Span};
15+
use oxc_str::Str;
1516
use oxc_syntax::{
1617
node::NodeId,
1718
number::{BigintBase, NumberBase},

crates/oxc_ast/src/ast/mod.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,8 @@
174174
//! If you are seeing compile-time errors in `src/ast/macros.rs`, this will be the cause.
175175
176176
// Re-export AST types from other crates
177-
pub use oxc_span::{Language, LanguageVariant, ModuleKind, SourceType, Span, Str};
177+
pub use oxc_span::{Language, LanguageVariant, ModuleKind, SourceType, Span};
178+
pub use oxc_str::Str;
178179
pub use oxc_syntax::{
179180
number::{BigintBase, NumberBase},
180181
operator::{

crates/oxc_ast/src/ast/ts.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ use std::cell::Cell;
2424
use oxc_allocator::{Box, CloneIn, Dummy, GetAddress, TakeIn, UnstableAddress, Vec};
2525
use oxc_ast_macros::ast;
2626
use oxc_estree::ESTree;
27-
use oxc_span::{ContentEq, GetSpan, GetSpanMut, Span, Str};
27+
use oxc_span::{ContentEq, GetSpan, GetSpanMut, Span};
28+
use oxc_str::Str;
2829
use oxc_syntax::{node::NodeId, scope::ScopeId};
2930

3031
use super::{inherit_variants, js::*, literal::*};

0 commit comments

Comments
 (0)