-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
feat(swc/core): introduce swc_core package #5364
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
crates/swc_core/src/lib.rs
Outdated
#![cfg_attr(docsrs, feature(doc_cfg))] | ||
|
||
// Quote | ||
#[cfg(feature = "quote")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we need #[cfg(any(docsrs, feature = "quote")]
along with #[cfg_attr(docsrs, doc(cfg(feature = "quote")))]
crates/swc_core/src/lib.rs
Outdated
} | ||
|
||
// Plugins | ||
#[cfg(feature = "__plugin_transform")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
crates/swc_core/src/lib.rs
Outdated
// ast exposed via swc_ecma_ast | ||
// TODO: Can dependency tree simplified | ||
// by swc_ecma_ast reexports swc_atoms? | ||
#[cfg(any(feature = "__ast"))] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
crates/swc_core/src/lib.rs
Outdated
} | ||
|
||
// visit* interfaces | ||
#[cfg(any(feature = "__visit"))] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
crates/swc_core/src/lib.rs
Outdated
} | ||
|
||
// swc_common features | ||
#[cfg(any(feature = "__common"))] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
@@ -0,0 +1,36 @@ | |||
// #[plugin_transform] macro | |||
#[cfg(feature = "__plugin_transform")] | |||
pub use swc_plugin_macro::plugin_transform; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
crates/swc_core/src/plugin.rs
Outdated
|
||
/// Global HANDLER implementation for the plugin | ||
/// for error reporting. | ||
#[cfg(feature = "__plugin_transform")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
crates/swc_core/src/plugin.rs
Outdated
} | ||
|
||
/// Plugin's environment metadata context. | ||
#[cfg(feature = "__plugin_transform")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
crates/swc_core/src/plugin.rs
Outdated
} | ||
|
||
/// Proxy to the host's data not attached to the AST, like sourcemap / comments. | ||
#[cfg(feature = "__plugin_transform")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
a3258ee
to
9cb23f0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
swc-bump:
- swc_plugin_macro --breaking
Description:
First step implementation for #5244.
PR introduces new package
swc_core
, then moveswc_plugin
's feature under theswc_core
as first step. This is a breaking change to any plugins that we'll need to update references accordingly.The idea of
swc_core
is simple, thatmostly reexport all the features, without having its own code as much as it can
.I'd like to setup these principles for those, while it may / should change depends on how we'll going to make it work actually.
swc_*
dependencies other thanswc_core
. (We do not care about any other 3rd party deps though, like serde, etcs)swc_common::*
->swc_core::common::*
.This is probably not the complete
swc_plugin
support, may need to check with existing plugins to find out missing exports. Still it is a first step.BREAKING CHANGE:
Related issue (if exists):
#5244