feat(swc/core): introduce swc_core package#5364
Merged
kdy1 merged 12 commits intoswc-project:mainfrom Aug 2, 2022
Merged
Conversation
kdy1
requested changes
Aug 2, 2022
crates/swc_core/src/lib.rs
Outdated
| #![cfg_attr(docsrs, feature(doc_cfg))] | ||
|
|
||
| // Quote | ||
| #[cfg(feature = "quote")] |
Member
There was a problem hiding this comment.
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")] |
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"))] |
crates/swc_core/src/lib.rs
Outdated
| } | ||
|
|
||
| // visit* interfaces | ||
| #[cfg(any(feature = "__visit"))] |
crates/swc_core/src/lib.rs
Outdated
| } | ||
|
|
||
| // swc_common features | ||
| #[cfg(any(feature = "__common"))] |
| @@ -0,0 +1,36 @@ | |||
| // #[plugin_transform] macro | |||
| #[cfg(feature = "__plugin_transform")] | |||
| pub use swc_plugin_macro::plugin_transform; | |||
crates/swc_core/src/plugin.rs
Outdated
|
|
||
| /// Global HANDLER implementation for the plugin | ||
| /// for error reporting. | ||
| #[cfg(feature = "__plugin_transform")] |
crates/swc_core/src/plugin.rs
Outdated
| } | ||
|
|
||
| /// Plugin's environment metadata context. | ||
| #[cfg(feature = "__plugin_transform")] |
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")] |
a3258ee to
9cb23f0
Compare
kdy1
reviewed
Aug 2, 2022
kdy1
reviewed
Aug 2, 2022
kdy1
approved these changes
Aug 2, 2022
Member
kdy1
left a comment
There was a problem hiding this comment.
Thanks!
swc-bump:
- swc_plugin_macro --breaking
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description:
First step implementation for #5244.
PR introduces new package
swc_core, then moveswc_plugin's feature under theswc_coreas first step. This is a breaking change to any plugins that we'll need to update references accordingly.The idea of
swc_coreis 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_pluginsupport, 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