Skip to content

Commit 7208cd7

Browse files
Brooooooklynclaude
andauthored
chore: upgrade oxc_* dependencies from 0.110 to 0.116 (#84)
Adapt to breaking change where IdentifierReference.name, BindingIdentifier.name, and IdentifierName.name changed from Atom<'a> to Ident<'a>. Added .into() conversions and .as_str() for string comparisons throughout the codebase. Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent aa92562 commit 7208cd7

File tree

13 files changed

+391
-248
lines changed

13 files changed

+391
-248
lines changed

Cargo.lock

Lines changed: 308 additions & 168 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -87,14 +87,14 @@ multiple_crate_versions = "allow"
8787

8888
[workspace.dependencies]
8989
# External oxc crates from crates.io
90-
oxc_allocator = "0.110"
91-
oxc_ast = "0.110"
92-
oxc_ast_visit = "0.110"
93-
oxc_diagnostics = "0.110"
94-
oxc_napi = "0.110"
95-
oxc_parser = "0.110"
96-
oxc_semantic = "0.110"
97-
oxc_span = "0.110"
90+
oxc_allocator = "0.116"
91+
oxc_ast = "0.116"
92+
oxc_ast_visit = "0.116"
93+
oxc_diagnostics = "0.116"
94+
oxc_napi = "0.116"
95+
oxc_parser = "0.116"
96+
oxc_semantic = "0.116"
97+
oxc_span = "0.116"
9898
oxc_sourcemap = "6.0.1"
9999

100100
# Internal

crates/oxc_angular_compiler/src/class_metadata/builders.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ pub fn build_decorator_metadata_array<'a>(
3333
let type_expr = match &decorator.expression {
3434
Expression::CallExpression(call) => match &call.callee {
3535
Expression::Identifier(id) => Some(OutputExpression::ReadVar(Box::new_in(
36-
ReadVarExpr { name: id.name, source_span: None },
36+
ReadVarExpr { name: id.name.into(), source_span: None },
3737
allocator,
3838
))),
3939
Expression::StaticMemberExpression(member) => {
@@ -42,7 +42,7 @@ pub fn build_decorator_metadata_array<'a>(
4242
OutputExpression::ReadProp(Box::new_in(
4343
ReadPropExpr {
4444
receiver: Box::new_in(receiver, allocator),
45-
name: member.property.name,
45+
name: member.property.name.into(),
4646
optional: false,
4747
source_span: None,
4848
},
@@ -53,7 +53,7 @@ pub fn build_decorator_metadata_array<'a>(
5353
_ => None,
5454
},
5555
Expression::Identifier(id) => Some(OutputExpression::ReadVar(Box::new_in(
56-
ReadVarExpr { name: id.name, source_span: None },
56+
ReadVarExpr { name: id.name.into(), source_span: None },
5757
allocator,
5858
))),
5959
_ => None,
@@ -370,8 +370,8 @@ fn extract_param_type_name<'a>(param: &FormalParameter<'a>) -> Option<Atom<'a>>
370370
let type_annotation = param.type_annotation.as_ref()?;
371371
match &type_annotation.type_annotation {
372372
TSType::TSTypeReference(type_ref) => match &type_ref.type_name {
373-
TSTypeName::IdentifierReference(id) => Some(id.name),
374-
TSTypeName::QualifiedName(qualified) => Some(qualified.right.name),
373+
TSTypeName::IdentifierReference(id) => Some(id.name.into()),
374+
TSTypeName::QualifiedName(qualified) => Some(qualified.right.name.into()),
375375
TSTypeName::ThisExpression(_) => None,
376376
},
377377
_ => None,
@@ -394,12 +394,12 @@ fn extract_param_type_expression<'a>(
394394
// Handle simple type references like SomeService
395395
match &type_ref.type_name {
396396
TSTypeName::IdentifierReference(id) => Some(OutputExpression::ReadVar(
397-
Box::new_in(ReadVarExpr { name: id.name, source_span: None }, allocator),
397+
Box::new_in(ReadVarExpr { name: id.name.into(), source_span: None }, allocator),
398398
)),
399399
TSTypeName::QualifiedName(qualified) => {
400400
// Handle qualified names like ns.SomeType
401401
Some(OutputExpression::ReadVar(Box::new_in(
402-
ReadVarExpr { name: qualified.right.name, source_span: None },
402+
ReadVarExpr { name: qualified.right.name.into(), source_span: None },
403403
allocator,
404404
)))
405405
}
@@ -446,7 +446,7 @@ fn get_decorator_name<'a>(decorator: &Decorator<'a>) -> Option<&'a str> {
446446
/// Get property key name as an Atom.
447447
fn get_property_key_name<'a>(key: &PropertyKey<'a>) -> Option<Atom<'a>> {
448448
match key {
449-
PropertyKey::StaticIdentifier(id) => Some(id.name),
449+
PropertyKey::StaticIdentifier(id) => Some(id.name.into()),
450450
PropertyKey::StringLiteral(lit) => Some(lit.value),
451451
_ => None,
452452
}

crates/oxc_angular_compiler/src/component/decorator.rs

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ pub fn extract_component_metadata<'a>(
5252
import_map: &ImportMap<'a>,
5353
) -> Option<ComponentMetadata<'a>> {
5454
// Get the class name
55-
let class_name = class.id.as_ref()?.name.clone();
55+
let class_name: Atom<'a> = class.id.as_ref()?.name.clone().into();
5656
let class_span = class.span;
5757

5858
// Find the @Component decorator
@@ -336,7 +336,7 @@ fn is_component_call(callee: &Expression<'_>) -> bool {
336336
/// Get the name of a property key as a string.
337337
fn get_property_key_name<'a>(key: &PropertyKey<'a>) -> Option<Atom<'a>> {
338338
match key {
339-
PropertyKey::StaticIdentifier(id) => Some(id.name.clone()),
339+
PropertyKey::StaticIdentifier(id) => Some(id.name.clone().into()),
340340
PropertyKey::StringLiteral(lit) => Some(lit.value.clone()),
341341
_ => None,
342342
}
@@ -405,7 +405,7 @@ fn extract_identifier_array<'a>(
405405
for element in &arr.elements {
406406
match element {
407407
ArrayExpressionElement::Identifier(id) => {
408-
result.push(id.name.clone());
408+
result.push(id.name.clone().into());
409409
}
410410
// Handle spread elements, etc. - for now just collect identifiers
411411
_ => {}
@@ -562,9 +562,10 @@ fn extract_single_host_directive<'a>(
562562
match element {
563563
// Simple identifier: TooltipDirective
564564
ArrayExpressionElement::Identifier(id) => {
565-
let mut meta = HostDirectiveMetadata::new(allocator, id.name.clone());
565+
let name: Atom<'a> = id.name.clone().into();
566+
let mut meta = HostDirectiveMetadata::new(allocator, name.clone());
566567
// Look up the source module from the import map
567-
if let Some(import_info) = import_map.get(&id.name) {
568+
if let Some(import_info) = import_map.get(&name) {
568569
meta.source_module = Some(import_info.source_module.clone());
569570
}
570571
Some(meta)
@@ -645,7 +646,7 @@ fn extract_single_host_directive<'a>(
645646
fn extract_directive_reference<'a>(expr: &Expression<'a>) -> (Option<Atom<'a>>, bool) {
646647
match expr {
647648
// Simple identifier: ColorDirective
648-
Expression::Identifier(id) => (Some(id.name.clone()), false),
649+
Expression::Identifier(id) => (Some(id.name.clone().into()), false),
649650

650651
// ForwardRef call: forwardRef(() => ColorDirective)
651652
Expression::CallExpression(call) => {
@@ -692,7 +693,7 @@ fn extract_forward_ref_directive_name<'a>(arg: Option<&Argument<'a>>) -> Option<
692693
body.statements.first()
693694
{
694695
if let Expression::Identifier(id) = &stmt.expression {
695-
return Some(id.name.clone());
696+
return Some(id.name.clone().into());
696697
}
697698
}
698699
None
@@ -967,11 +968,11 @@ fn extract_param_dependency<'a>(
967968
fn get_decorator_name<'a>(expr: &'a Expression<'a>) -> Option<Atom<'a>> {
968969
match expr {
969970
// @Optional
970-
Expression::Identifier(id) => Some(id.name.clone()),
971+
Expression::Identifier(id) => Some(id.name.clone().into()),
971972
// @Optional()
972973
Expression::CallExpression(call) => {
973974
if let Expression::Identifier(id) = &call.callee {
974-
Some(id.name.clone())
975+
Some(id.name.clone().into())
975976
} else {
976977
None
977978
}
@@ -983,12 +984,12 @@ fn get_decorator_name<'a>(expr: &'a Expression<'a>) -> Option<Atom<'a>> {
983984
/// Extract the injection token from an @Inject decorator argument.
984985
fn extract_inject_token<'a>(arg: &'a Argument<'a>) -> Option<Atom<'a>> {
985986
match arg {
986-
Argument::Identifier(id) => Some(id.name.clone()),
987+
Argument::Identifier(id) => Some(id.name.clone().into()),
987988
_ => {
988989
// For other expressions, try to get the expression form
989990
let expr = arg.to_expression();
990991
match expr {
991-
Expression::Identifier(id) => Some(id.name.clone()),
992+
Expression::Identifier(id) => Some(id.name.clone().into()),
992993
_ => None,
993994
}
994995
}
@@ -1005,7 +1006,7 @@ fn extract_param_token<'a>(param: &'a oxc_ast::ast::FormalParameter<'a>) -> Opti
10051006
if let oxc_ast::ast::TSType::TSTypeReference(type_ref) = ts_type {
10061007
// Get the type name
10071008
let type_name = match &type_ref.type_name {
1008-
oxc_ast::ast::TSTypeName::IdentifierReference(id) => Some(id.name.clone()),
1009+
oxc_ast::ast::TSTypeName::IdentifierReference(id) => Some(id.name.clone().into()),
10091010
oxc_ast::ast::TSTypeName::QualifiedName(_)
10101011
| oxc_ast::ast::TSTypeName::ThisExpression(_) => {
10111012
// Qualified names like Namespace.Type or 'this' type - not valid injection tokens

crates/oxc_angular_compiler/src/component/import_elision.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,11 @@ impl<'a> ImportElisionAnalyzer<'a> {
9292
ImportDeclarationSpecifier::ImportSpecifier(spec) => {
9393
// Explicit type-only specifiers (import { type X }) are always elided
9494
if spec.import_kind.is_type() {
95-
type_only_specifiers.insert(spec.local.name.clone());
95+
type_only_specifiers.insert(spec.local.name.clone().into());
9696
continue;
9797
}
9898

99-
let name = &spec.local.name;
99+
let name: Atom<'a> = spec.local.name.clone().into();
100100

101101
// Check if this import has only type references
102102
if Self::is_type_only_import(&spec.local, semantic) {
@@ -108,7 +108,7 @@ impl<'a> ImportElisionAnalyzer<'a> {
108108
}
109109
}
110110
ImportDeclarationSpecifier::ImportDefaultSpecifier(spec) => {
111-
let name = &spec.local.name;
111+
let name: Atom<'a> = spec.local.name.clone().into();
112112

113113
if Self::is_type_only_import(&spec.local, semantic) {
114114
type_only_specifiers.insert(name.clone());
@@ -119,7 +119,7 @@ impl<'a> ImportElisionAnalyzer<'a> {
119119
// e.g., `import * as moment from 'moment'` where `moment` is only
120120
// used in type annotations like `moment.Moment`.
121121
if Self::is_type_only_import(&spec.local, semantic) {
122-
type_only_specifiers.insert(spec.local.name.clone());
122+
type_only_specifiers.insert(spec.local.name.clone().into());
123123
}
124124
}
125125
}
@@ -273,12 +273,12 @@ impl<'a> ImportElisionAnalyzer<'a> {
273273
fn collect_idents_from_expression(expr: &'a Expression<'a>, result: &mut FxHashSet<Atom<'a>>) {
274274
match expr {
275275
Expression::Identifier(id) => {
276-
result.insert(id.name.clone());
276+
result.insert(id.name.clone().into());
277277
}
278278
Expression::StaticMemberExpression(member) => {
279279
// For `RecipientType.To`, collect `RecipientType`
280280
if let Expression::Identifier(id) = &member.object {
281-
result.insert(id.name.clone());
281+
result.insert(id.name.clone().into());
282282
}
283283
}
284284
_ => {}
@@ -638,7 +638,7 @@ impl<'a> ImportElisionAnalyzer<'a> {
638638
}
639639

640640
/// Check if a specifier name should be elided (removed).
641-
pub fn should_elide(&self, name: &Atom<'a>) -> bool {
641+
pub fn should_elide(&self, name: &str) -> bool {
642642
self.type_only_specifiers.contains(name)
643643
}
644644

@@ -702,14 +702,14 @@ impl<'a> ImportElisionAnalyzer<'a> {
702702
let local_name = &spec.local.name;
703703

704704
// Skip if already marked as type-only by semantic analysis
705-
if analyzer.type_only_specifiers.contains(local_name) {
705+
if analyzer.type_only_specifiers.contains(local_name.as_str()) {
706706
continue;
707707
}
708708

709709
// Check cross-file: is the export type-only in the source file?
710710
let imported_name = spec.imported.name().as_str();
711711
if cross_file_analyzer.is_type_only_import(source, imported_name, file_path) {
712-
analyzer.type_only_specifiers.insert(local_name.clone());
712+
analyzer.type_only_specifiers.insert(local_name.clone().into());
713713
}
714714
}
715715
}
@@ -769,7 +769,7 @@ pub fn filter_imports<'a>(
769769
ImportDeclarationSpecifier::ImportDefaultSpecifier(s) => &s.local.name,
770770
ImportDeclarationSpecifier::ImportNamespaceSpecifier(s) => &s.local.name,
771771
};
772-
!analyzer.should_elide(name)
772+
!analyzer.should_elide(name.as_str())
773773
});
774774

775775
if removed.is_empty() && !kept.is_empty() {

crates/oxc_angular_compiler/src/component/transform.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,7 @@ pub fn build_import_map<'a>(
450450
// or aliased: `import { AuthService as Auth } from "module"`
451451
// We use the local name as the key
452452
// Named imports CAN be reused with bare name
453-
let local_name = spec.local.name.clone();
453+
let local_name: Atom<'a> = spec.local.name.clone().into();
454454

455455
// Type-only if the declaration is `import type { ... }` or the specifier
456456
// is `import { type X }` (inline type specifier)
@@ -471,7 +471,7 @@ pub fn build_import_map<'a>(
471471
ImportDeclarationSpecifier::ImportDefaultSpecifier(spec) => {
472472
// Default import: `import DefaultService from "module"`
473473
// Default imports CAN be reused with bare name
474-
let local_name = spec.local.name.clone();
474+
let local_name: Atom<'a> = spec.local.name.clone().into();
475475

476476
// Check if we have a resolved path for this identifier
477477
let source_module = resolved_imports
@@ -491,7 +491,7 @@ pub fn build_import_map<'a>(
491491
ImportDeclarationSpecifier::ImportNamespaceSpecifier(spec) => {
492492
// Namespace import: `import * as core from "module"`
493493
// Namespace imports CANNOT be reused with bare name for individual symbols
494-
let local_name = spec.local.name.clone();
494+
let local_name: Atom<'a> = spec.local.name.clone().into();
495495

496496
// Check if we have a resolved path for this identifier
497497
let source_module = resolved_imports

crates/oxc_angular_compiler/src/directive/decorator.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ pub fn extract_directive_metadata<'a>(
7979
implicit_standalone: bool,
8080
) -> Option<R3DirectiveMetadata<'a>> {
8181
// Get the class name
82-
let class_name = class.id.as_ref()?.name.clone();
82+
let class_name: Atom<'a> = class.id.as_ref()?.name.clone().into();
8383

8484
// Find the @Directive decorator
8585
let directive_decorator = find_directive_decorator(&class.decorators)?;
@@ -357,11 +357,11 @@ fn extract_param_dependency<'a>(
357357
fn get_decorator_name_from_expr<'a>(expr: &'a Expression<'a>) -> Option<Atom<'a>> {
358358
match expr {
359359
// @Optional
360-
Expression::Identifier(id) => Some(id.name.clone()),
360+
Expression::Identifier(id) => Some(id.name.clone().into()),
361361
// @Optional()
362362
Expression::CallExpression(call) => {
363363
if let Expression::Identifier(id) = &call.callee {
364-
Some(id.name.clone())
364+
Some(id.name.clone().into())
365365
} else {
366366
None
367367
}
@@ -388,7 +388,7 @@ fn extract_param_token<'a>(
388388
if let oxc_ast::ast::TSType::TSTypeReference(type_ref) = ts_type {
389389
// Get the type name
390390
let type_name = match &type_ref.type_name {
391-
oxc_ast::ast::TSTypeName::IdentifierReference(id) => id.name.clone(),
391+
oxc_ast::ast::TSTypeName::IdentifierReference(id) => id.name.clone().into(),
392392
oxc_ast::ast::TSTypeName::QualifiedName(_)
393393
| oxc_ast::ast::TSTypeName::ThisExpression(_) => {
394394
// Qualified names like Namespace.Type or 'this' type - not valid injection tokens
@@ -435,7 +435,7 @@ fn has_ng_on_changes_method(class: &Class<'_>) -> bool {
435435
/// Get the name of a property key as a string.
436436
fn get_property_key_name<'a>(key: &PropertyKey<'a>) -> Option<Atom<'a>> {
437437
match key {
438-
PropertyKey::StaticIdentifier(id) => Some(id.name.clone()),
438+
PropertyKey::StaticIdentifier(id) => Some(id.name.clone().into()),
439439
PropertyKey::StringLiteral(lit) => Some(lit.value.clone()),
440440
_ => None,
441441
}
@@ -549,7 +549,7 @@ fn extract_single_host_directive<'a>(
549549
match element {
550550
// Simple identifier: TooltipDirective
551551
ArrayExpressionElement::Identifier(id) => Some(R3HostDirectiveMetadata {
552-
directive: OutputAstBuilder::variable(allocator, id.name.clone()),
552+
directive: OutputAstBuilder::variable(allocator, id.name.clone().into()),
553553
is_forward_reference: false,
554554
inputs: Vec::new_in(allocator),
555555
outputs: Vec::new_in(allocator),
@@ -623,7 +623,7 @@ fn extract_directive_reference<'a>(
623623
match expr {
624624
// Simple identifier: ColorDirective
625625
Expression::Identifier(id) => {
626-
(Some(OutputAstBuilder::variable(allocator, id.name.clone())), false)
626+
(Some(OutputAstBuilder::variable(allocator, id.name.clone().into())), false)
627627
}
628628

629629
// ForwardRef call: forwardRef(() => ColorDirective)
@@ -663,7 +663,7 @@ fn extract_forward_ref_directive_name<'a>(arg: Option<&Argument<'a>>) -> Option<
663663
body.statements.first()
664664
{
665665
if let Expression::Identifier(id) = &stmt.expression {
666-
return Some(id.name.clone());
666+
return Some(id.name.clone().into());
667667
}
668668
}
669669
None

crates/oxc_angular_compiler/src/directive/property_decorators.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ fn find_decorator_by_name<'a>(
5252
/// Handles both identifier keys and string literal keys.
5353
fn get_property_key_name<'a>(key: &PropertyKey<'a>) -> Option<Atom<'a>> {
5454
match key {
55-
PropertyKey::StaticIdentifier(id) => Some(id.name.clone()),
55+
PropertyKey::StaticIdentifier(id) => Some(id.name.clone().into()),
5656
PropertyKey::StringLiteral(lit) => Some(lit.value.clone()),
5757
_ => None,
5858
}

0 commit comments

Comments
 (0)