swc_common/plugin/mod.rs
1pub mod diagnostics;
2pub mod metadata;
3#[cfg(feature = "__plugin")]
4#[cfg_attr(docsrs, doc(cfg(feature = "__plugin")))]
5pub mod serialized;
6
7/**
8 * Compile-time version constant for the AST struct schema's version.
9 *
10 * NOTE: this is for PARTIAL compatibility only, supporting if AST struct
11 * adds new properties without changing / removing existing properties.
12 *
13 * - When adding a new properties to the AST struct:
14 * 1. Create a new feature flag in cargo.toml
15 * 2. Create a new schema version with new feature flag.
16 * 3. Create a new AST struct with compile time feature flag with newly
17 * added properties. Previous struct should remain with existing feature
18 * flag, or add previous latest feature flag.
19 *
20 * - When removing, or changing existing properties in the AST struct: TBD
21 */
22#[cfg(feature = "plugin_transform_schema_v1")]
23pub const PLUGIN_TRANSFORM_AST_SCHEMA_VERSION: u32 = 1;
24
25// Reserved for the testing purpose.
26#[cfg(all(
27 feature = "plugin_transform_schema_vtest",
28 not(feature = "plugin_transform_schema_v1")
29))]
30pub const PLUGIN_TRANSFORM_AST_SCHEMA_VERSION: u32 = u32::MAX - 1;