Repository: swc-project/swc
File: crates/swc/src/config/mod.rs (Rust)

Code before:
                        unresolved_ctxt,
                        es_version,
                        source_map: cm.clone(),
                    })),
                    !disable_all_lints,
                )
            };
            Box::new((
                (
                    if experimental.run_plugin_first.into_bool() {
                        plugin_transforms.take()
                    } else {
                        None
                    },
                    #[cfg(feature = "lint")]
                    lint,
                    // Decorators may use type information
                    Optional::new(decorator_pass, syntax.decorators()),
                    Optional::new(
                        explicit_resource_management(),
                        syntax.explicit_resource_management(),
                    ),
                ),
                // The transform strips import assertions, so it's only enabled if
                // keep_import_assertions is false.
                (
                    Optional::new(import_attributes(), !keep_import_attributes),
                    {
                        let native_class_properties = !assumptions.set_public_class_fields
                            && feature_config.as_ref().map_or_else(
                                || target.caniuse(Feature::ClassProperties),
                                |env| env.caniuse(Feature::ClassProperties),
                            );

                        let ts_config = typescript::Config {
                            import_export_assign_config,
                            verbatim_module_syntax,
                            native_class_properties,
                            ts_enum_is_mutable,
                            ..Default::default()
                        };

                        (
                            Optional::new(
                                typescript::typescript(ts_config, unresolved_mark, top_level_mark),
                                syntax.typescript() && !jsx_enabled,
                            ),
                            Optional::new(
                                typescript::tsx::<Option<&dyn Comments>>(
                                    cm.clone(),
                                    ts_config,

Review comment (refactor):
This refactoring changes the tuple structure in a way that alters the transform chain composition. The import_attributes transform was moved from being paired with the TypeScript transforms in a single tuple element to being a separate element in the first tuple. This changes how the transforms are grouped and may affect execution order or Pass composition semantics. The original structure had these as siblings in a 2-element tuple, while the new structure separates them into different tuple levels.

Code after:
                        unresolved_ctxt,
                        es_version,
                        source_map: cm.clone(),
                    })),
                    !disable_all_lints,
                )
            };
            Box::new((
                (
                    if experimental.run_plugin_first.into_bool() {
                        plugin_transforms.take()
                    } else {
                        None
                    },
                    #[cfg(feature = "lint")]
                    lint,
                    // Decorators may use type information
                    Optional::new(decorator_pass, syntax.decorators()),
                    Optional::new(
                        explicit_resource_management(),
                        syntax.explicit_resource_management(),
                    ),
                    // The transform strips import assertions, so it's only enabled if
                    // keep_import_assertions is false.
                    Optional::new(import_attributes(), !keep_import_attributes),
                ),
                ({
                    let native_class_properties = !assumptions.set_public_class_fields
                        && feature_config.as_ref().map_or_else(
                            || target.caniuse(Feature::ClassProperties),
                            |env| env.caniuse(Feature::ClassProperties),
                        );

                    let ts_config = typescript::Config {
                        import_export_assign_config,
                        verbatim_module_syntax,
                        native_class_properties,
                        ts_enum_is_mutable,
                        ..Default::default()
                    };

                    (
                        Optional::new(
                            typescript::typescript(ts_config, unresolved_mark, top_level_mark),
                            syntax.typescript() && !jsx_enabled,
                        ),
                        Optional::new(
                            typescript::tsx::<Option<&dyn Comments>>(
                                cm.clone(),
                                ts_config,
                                typescript::TsxConfig {