Description
Describe the feature
This is by far the biggest blocker for the official release for the plugin feature. (I thought I filed this already somehow).
The main issue in here is reducing chances of breaking changes for the plugin. There are 3 possible cases which causes diverge between plugins to the host for serialization / deserialization, namely
- adding a new property into an existing ast struct
- removing a new property from an existing ast struct
- rename existing property from an ast struct
Each time this happens, the plugin will not be able to run on the newer versions of swc include those changes. These kind of breaking change itself is unavoidable unfortunately, but also we may be able to reduce the chances of it or at least avoid it happening unexpectedly.
We'll attempt to follow versioned
struct approach suggested by underlying serialization mechanism (https://github.com/rkyv/rkyv/blob/master/examples/backwards_compat/src/main.rs) with compiler flags. When we need a possible breaking changes it'll be guarded by flags, providing backward compatibility as much as it can. Still worth mentioning this only applies to adding
part - removing, or renaming is a clear breaking change we can't avoid to request plugin bumps up with the latest changes. At least, we hope those kind of operation won't happen that frequently.
Babel plugin or link to the feature description
No response
Activity