Skip to content

Commit 3d01fa1

Browse files
committed
docs(transformer): update links to use Oxc docs (#18722)
Updated the links to Oxc docs instead of babel and esbuild.
1 parent 0867a36 commit 3d01fa1

File tree

6 files changed

+426
-417
lines changed

6 files changed

+426
-417
lines changed

crates/oxc_transformer/src/typescript/diagnostics.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,12 @@ pub fn ambient_module_nested(span: Span) -> OxcDiagnostic {
2828

2929
#[cold]
3030
pub fn namespace_exporting_non_const(span: Span) -> OxcDiagnostic {
31-
OxcDiagnostic::warn("Namespaces exporting non-const are not supported by Babel. Change to const or see: https://babeljs.io/docs/en/babel-plugin-transform-typescript")
31+
OxcDiagnostic::warn("Namespaces exporting non-const are not supported by Oxc. Change to const or see: https://oxc.rs/docs/guide/usage/transformer/typescript.html#partial-namespace-support")
3232
.with_label(span)
3333
}
3434

3535
#[cold]
3636
pub fn namespace_not_supported(span: Span) -> OxcDiagnostic {
37-
OxcDiagnostic::warn("Namespace not marked type-only declare. Non-declarative namespaces are only supported experimentally in Babel. To enable and review caveats see: https://babeljs.io/docs/en/babel-plugin-transform-typescript")
37+
OxcDiagnostic::warn("Namespace not marked type-only declare are disabled. To enable and review caveats see: https://oxc.rs/docs/guide/usage/transformer/typescript.html#partial-namespace-support")
3838
.with_label(span)
3939
}

napi/transform/index.d.ts

Lines changed: 24 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ export declare function isolatedDeclarationSync(filename: string, sourceText: st
185185
/**
186186
* Configure how TSX and JSX are transformed.
187187
*
188-
* @see {@link https://babeljs.io/docs/babel-plugin-transform-react-jsx#options}
188+
* @see {@link https://oxc.rs/docs/guide/usage/transformer/jsx}
189189
*/
190190
export interface JsxOptions {
191191
/**
@@ -201,8 +201,6 @@ export interface JsxOptions {
201201
* Emit development-specific information, such as `__source` and `__self`.
202202
*
203203
* @default false
204-
*
205-
* @see {@link https://babeljs.io/docs/babel-plugin-transform-react-jsx-development}
206204
*/
207205
development?: boolean
208206
/**
@@ -216,11 +214,7 @@ export interface JsxOptions {
216214
*/
217215
throwIfNamespace?: boolean
218216
/**
219-
* Enables `@babel/plugin-transform-react-pure-annotations`.
220-
*
221-
* It will mark JSX elements and top-level React method calls as pure for tree shaking.
222-
*
223-
* @see {@link https://babeljs.io/docs/en/babel-plugin-transform-react-pure-annotations}
217+
* Mark JSX elements and top-level React method calls as pure for tree shaking.
224218
*
225219
* @default true
226220
*/
@@ -342,7 +336,7 @@ export interface ReactRefreshOptions {
342336
/**
343337
* Configure how styled-components are transformed.
344338
*
345-
* @see {@link https://styled-components.com/docs/tooling#babel-plugin}
339+
* @see {@link https://oxc.rs/docs/guide/usage/transformer/plugins#styled-components}
346340
*/
347341
export interface StyledComponentsOptions {
348342
/**
@@ -461,9 +455,15 @@ export interface TransformOptions {
461455
sourcemap?: boolean
462456
/** Set assumptions in order to produce smaller output. */
463457
assumptions?: CompilerAssumptions
464-
/** Configure how TypeScript is transformed. */
458+
/**
459+
* Configure how TypeScript is transformed.
460+
* @see {@link https://oxc.rs/docs/guide/usage/transformer/typescript}
461+
*/
465462
typescript?: TypeScriptOptions
466-
/** Configure how TSX and JSX are transformed. */
463+
/**
464+
* Configure how TSX and JSX are transformed.
465+
* @see {@link https://oxc.rs/docs/guide/usage/transformer/jsx}
466+
*/
467467
jsx?: 'preserve' | JsxOptions
468468
/**
469469
* Sets the target environment for the generated JavaScript.
@@ -477,18 +477,27 @@ export interface TransformOptions {
477477
*
478478
* @default `esnext` (No transformation)
479479
*
480-
* @see [esbuild#target](https://esbuild.github.io/api/#target)
480+
* @see {@link https://oxc.rs/docs/guide/usage/transformer/lowering#target}
481481
*/
482482
target?: string | Array<string>
483483
/** Behaviour for runtime helpers. */
484484
helpers?: Helpers
485-
/** Define Plugin */
485+
/**
486+
* Define Plugin
487+
* @see {@link https://oxc.rs/docs/guide/usage/transformer/global-variable-replacement#define}
488+
*/
486489
define?: Record<string, string>
487-
/** Inject Plugin */
490+
/**
491+
* Inject Plugin
492+
* @see {@link https://oxc.rs/docs/guide/usage/transformer/global-variable-replacement#inject}
493+
*/
488494
inject?: Record<string, string | [string, string]>
489495
/** Decorator plugin */
490496
decorator?: DecoratorOptions
491-
/** Third-party plugins to use. */
497+
/**
498+
* Third-party plugins to use.
499+
* @see {@link https://oxc.rs/docs/guide/usage/transformer/plugins}
500+
*/
492501
plugins?: PluginsOptions
493502
}
494503

napi/transform/src/transformer.rs

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -111,9 +111,11 @@ pub struct TransformOptions {
111111
pub assumptions: Option<CompilerAssumptions>,
112112

113113
/// Configure how TypeScript is transformed.
114+
/// @see {@link https://oxc.rs/docs/guide/usage/transformer/typescript}
114115
pub typescript: Option<TypeScriptOptions>,
115116

116117
/// Configure how TSX and JSX are transformed.
118+
/// @see {@link https://oxc.rs/docs/guide/usage/transformer/jsx}
117119
#[napi(ts_type = "'preserve' | JsxOptions")]
118120
pub jsx: Option<Either<String, JsxOptions>>,
119121

@@ -128,24 +130,27 @@ pub struct TransformOptions {
128130
///
129131
/// @default `esnext` (No transformation)
130132
///
131-
/// @see [esbuild#target](https://esbuild.github.io/api/#target)
133+
/// @see {@link https://oxc.rs/docs/guide/usage/transformer/lowering#target}
132134
pub target: Option<Either<String, Vec<String>>>,
133135

134136
/// Behaviour for runtime helpers.
135137
pub helpers: Option<Helpers>,
136138

137139
/// Define Plugin
140+
/// @see {@link https://oxc.rs/docs/guide/usage/transformer/global-variable-replacement#define}
138141
#[napi(ts_type = "Record<string, string>")]
139142
pub define: Option<FxHashMap<String, String>>,
140143

141144
/// Inject Plugin
145+
/// @see {@link https://oxc.rs/docs/guide/usage/transformer/global-variable-replacement#inject}
142146
#[napi(ts_type = "Record<string, string | [string, string]>")]
143147
pub inject: Option<FxHashMap<String, Either<String, Vec<String>>>>,
144148

145149
/// Decorator plugin
146150
pub decorator: Option<DecoratorOptions>,
147151

148152
/// Third-party plugins to use.
153+
/// @see {@link https://oxc.rs/docs/guide/usage/transformer/plugins}
149154
pub plugins: Option<PluginsOptions>,
150155
}
151156

@@ -397,7 +402,7 @@ impl From<DecoratorOptions> for oxc::transformer::DecoratorOptions {
397402

398403
/// Configure how styled-components are transformed.
399404
///
400-
/// @see {@link https://styled-components.com/docs/tooling#babel-plugin}
405+
/// @see {@link https://oxc.rs/docs/guide/usage/transformer/plugins#styled-components}
401406
#[napi(object)]
402407
#[derive(Default)]
403408
pub struct StyledComponentsOptions {
@@ -507,7 +512,7 @@ impl From<StyledComponentsOptions> for oxc::transformer::StyledComponentsOptions
507512

508513
/// Configure how TSX and JSX are transformed.
509514
///
510-
/// @see {@link https://babeljs.io/docs/babel-plugin-transform-react-jsx#options}
515+
/// @see {@link https://oxc.rs/docs/guide/usage/transformer/jsx}
511516
#[napi(object)]
512517
pub struct JsxOptions {
513518
/// Decides which runtime to use.
@@ -522,8 +527,6 @@ pub struct JsxOptions {
522527
/// Emit development-specific information, such as `__source` and `__self`.
523528
///
524529
/// @default false
525-
///
526-
/// @see {@link https://babeljs.io/docs/babel-plugin-transform-react-jsx-development}
527530
pub development: Option<bool>,
528531

529532
/// Toggles whether or not to throw an error if an XML namespaced tag name
@@ -535,11 +538,7 @@ pub struct JsxOptions {
535538
/// @default true
536539
pub throw_if_namespace: Option<bool>,
537540

538-
/// Enables `@babel/plugin-transform-react-pure-annotations`.
539-
///
540-
/// It will mark JSX elements and top-level React method calls as pure for tree shaking.
541-
///
542-
/// @see {@link https://babeljs.io/docs/en/babel-plugin-transform-react-pure-annotations}
541+
/// Mark JSX elements and top-level React method calls as pure for tree shaking.
543542
///
544543
/// @default true
545544
pub pure: Option<bool>,

tasks/coverage/snapshots/semantic_babel.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -823,7 +823,7 @@ after transform: ScopeId(0): ["foo"]
823823
rebuilt : ScopeId(0): []
824824

825825
semantic Error: tasks/coverage/babel/packages/babel-parser/test/fixtures/typescript/scope/namespace-declaration-var-2/input.js
826-
Namespaces exporting non-const are not supported by Babel. Change to const or see: https://babeljs.io/docs/en/babel-plugin-transform-typescript
826+
Namespaces exporting non-const are not supported by Oxc. Change to const or see: https://oxc.rs/docs/guide/usage/transformer/typescript.html#partial-namespace-support
827827

828828
semantic Error: tasks/coverage/babel/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-class-interface/input.ts
829829
Bindings mismatch:

0 commit comments

Comments
 (0)