Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(transformer): improve encapsulation of transforms #7888

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -586,8 +586,8 @@ impl<'a> ArrowFunctionConverter<'a> {

/// Transforms a `MemberExpression` whose object is a `super` expression.
///
/// In the [`AsyncToGenerator`](crate::es2017::async_to_generator::AsyncToGenerator) and
/// [`AsyncGeneratorFunctions`](crate::es2018::async_generator_functions::AsyncGeneratorFunctions) plugins,
/// In the [`AsyncToGenerator`](crate::es2017::AsyncToGenerator) and
/// [`AsyncGeneratorFunctions`](crate::es2018::AsyncGeneratorFunctions) plugins,
/// we move the body of an async method to a new generator function. This can cause
/// `super` expressions to appear in unexpected places, leading to syntax errors.
///
Expand Down
6 changes: 3 additions & 3 deletions crates/oxc_transformer/src/es2017/mod.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
pub(crate) mod async_to_generator;
mod async_to_generator;
mod options;

pub use async_to_generator::AsyncGeneratorExecutor;
pub use async_to_generator::{AsyncGeneratorExecutor, AsyncToGenerator};
pub use options::ES2017Options;
use oxc_ast::ast::{Expression, Function, Statement};
use oxc_traverse::{Traverse, TraverseCtx};

use crate::{es2017::async_to_generator::AsyncToGenerator, TransformCtx};
use crate::TransformCtx;

#[allow(dead_code)]
pub struct ES2017<'a, 'ctx> {
Expand Down
4 changes: 2 additions & 2 deletions crates/oxc_transformer/src/es2018/mod.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
pub(crate) mod async_generator_functions;
mod async_generator_functions;
mod object_rest_spread;
mod options;

use async_generator_functions::AsyncGeneratorFunctions;
pub use async_generator_functions::AsyncGeneratorFunctions;
pub use object_rest_spread::{ObjectRestSpread, ObjectRestSpreadOptions};
pub use options::ES2018Options;
use oxc_ast::ast::*;
Expand Down
2 changes: 1 addition & 1 deletion crates/oxc_transformer/src/es2020/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ mod nullish_coalescing_operator;
mod optional_chaining;
mod options;

pub use nullish_coalescing_operator::NullishCoalescingOperator;
use nullish_coalescing_operator::NullishCoalescingOperator;
pub use optional_chaining::OptionalChaining;
pub use options::ES2020Options;
use oxc_ast::ast::*;
Expand Down
4 changes: 2 additions & 2 deletions crates/oxc_transformer/src/jsx/jsx_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ use oxc_syntax::{
};
use oxc_traverse::{BoundIdentifier, Traverse, TraverseCtx};

use super::diagnostics;
pub use super::{
use super::{
diagnostics,
jsx_self::JsxSelf,
jsx_source::JsxSource,
options::{JsxOptions, JsxRuntime},
Expand Down
4 changes: 2 additions & 2 deletions crates/oxc_transformer/src/jsx/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ mod jsx_source;
mod options;
mod refresh;
pub(crate) use comments::update_options_with_comments;
pub use display_name::ReactDisplayName;
pub use jsx_impl::JsxImpl;
use display_name::ReactDisplayName;
use jsx_impl::JsxImpl;
use jsx_self::JsxSelf;
pub use options::{JsxOptions, JsxRuntime, ReactRefreshOptions};
use refresh::ReactRefresh;
Expand Down
Loading