From 55838095ef470e26b2571f1d01a2b375ccfb760f Mon Sep 17 00:00:00 2001 From: Tim Froehlich Date: Thu, 26 Dec 2024 12:15:32 -0600 Subject: [PATCH] Remove almost all types from Serdegen reflection We are able to successfully compile without almost anything from Serdegen reflection. The one exception is the `ConvertResponse` type, part of the JNI boundary, which just holds the already-encoded doc. It can be cleaned up in another task. (#1944) --- crates/figma_import/src/reflection.rs | 245 +------------------------- 1 file changed, 3 insertions(+), 242 deletions(-) diff --git a/crates/figma_import/src/reflection.rs b/crates/figma_import/src/reflection.rs index 03ff5aab9..b79cbeb86 100644 --- a/crates/figma_import/src/reflection.rs +++ b/crates/figma_import/src/reflection.rs @@ -12,7 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -use dc_bundle::definition::element::dimension_proto::Dimension; use dc_bundle::definition::EncodedImageMap; use serde_reflection::{Samples, Tracer, TracerConfig}; @@ -21,248 +20,10 @@ pub fn registry() -> serde_reflection::Result { let mut tracer = Tracer::new(TracerConfig::default()); let samples = Samples::new(); - tracer - .trace_type::(&samples) - .expect("couldn't trace AlignContent"); - tracer - .trace_type::(&samples) - .expect("couldn't trace AlignItems"); - tracer - .trace_type::(&samples) - .expect("couldn't trace AlignSelf"); - tracer - .trace_type::(&samples) - .expect("couldn't trace ScaleMode"); - tracer - .trace_type::(&samples) - .expect("couldn't trace BackgroundType"); - tracer - .trace_type::(&samples) - .expect("couldn't trace Background"); - tracer - .trace_type::(&samples) - .expect("couldn't trace BlendMode"); - tracer - .trace_type::(&samples) - .expect("couldn't trace BoxShadow"); - tracer.trace_type::(&samples).expect("couldn't trace Dimension"); - tracer - .trace_type::(&samples) - .expect("couldn't trace DimensionProto"); - tracer - .trace_type::(&samples) - .expect("couldn't trace DimensionRect"); - tracer - .trace_type::(&samples) - .expect("couldn't trace Display"); - tracer - .trace_type::(&samples) - .expect("couldn't trace FilterOp"); - tracer - .trace_type::(&samples) - .expect("couldn't trace FilterOpType"); - tracer - .trace_type::(&samples) - .expect("couldn't trace FlexDirection"); - tracer - .trace_type::(&samples) - .expect("couldn't trace FlexWrap"); - tracer - .trace_type::(&samples) - .expect("couldn't trace FontStyle"); - tracer - .trace_type::(&samples) - .expect("couldn't trace TextDecoration"); - tracer - .trace_type::(&samples) - .expect("couldn't trace JustifyContent"); - tracer - .trace_type::(&samples) - .expect("couldn't trace LineHeight"); - tracer - .trace_type::(&samples) - .expect("couldn't trace Overflow"); - tracer - .trace_type::(&samples) - .expect("couldn't trace PointerEvents"); - tracer - .trace_type::(&samples) - .expect("couldn't trace ItemSpacing"); - tracer - .trace_type::(&samples) - .expect("couldn't trace GridLayoutType"); - tracer - .trace_type::(&samples) - .expect("couldn't trace RotationMeterData"); - tracer - .trace_type::(&samples) - .expect("couldn't trace ArcMeterData"); - tracer - .trace_type::(&samples) - .expect("couldn't trace ProgressBarMeterData"); - tracer - .trace_type::(&samples) - .expect("couldn't trace ProgressVectorMeterData"); - tracer - .trace_type::(&samples) - .expect("couldn't trace MeterData"); - tracer - .trace_type::(&samples) - .expect("couldn't trace PositionType"); - tracer - .trace_type::(&samples) - .expect("couldn't trace ShadowBox"); - tracer - .trace_type::(&samples) - .expect("couldn't trace StrokeAlign"); - tracer - .trace_type::(&samples) - .expect("couldn't trace StrokeWeight"); - tracer - .trace_type::(&samples) - .expect("couldn't trace StrokeWeightType"); - tracer - .trace_type::(&samples) - .expect("couldn't trace TextAlign"); - tracer - .trace_type::(&samples) - .expect("couldn't trace TextAlignVertical"); - tracer - .trace_type::(&samples) - .expect("couldn't trace TextOverflow"); - tracer - .trace_type::(&samples) - .expect("couldn't trace LayoutSizing"); - tracer - .trace_type::(&samples) - .expect("couldn't trace ViewStyle"); - - tracer - .trace_type::(&samples) - .expect("couldn't trace Action"); - tracer - .trace_type::(&samples) - .expect("couldn't trace Trigger"); - tracer - .trace_type::(&samples) - .expect("couldn't trace transition"); - tracer - .trace_type::(&samples) - .expect("couldn't trace Navigation"); - tracer - .trace_type::(&samples) - .expect("couldn't trace OverlayBackgroundInteraction"); - tracer - .trace_type::(&samples) - .expect("couldn't trace OverlayPositionType"); - tracer - .trace_type::(&samples) - .expect("couldn't trace TransitionDirection"); - tracer - .trace_type::(&samples) - .expect("couldn't trace Easing"); - - tracer - .trace_type::(&samples) - .expect("couldn't trace WindingRule"); - tracer - .trace_type::(&samples) - .expect("couldn't trace Path"); - tracer - .trace_type::( - &samples, - ) - .expect("couldn't trace ComponentContentOverride"); - tracer - .trace_type::(&samples) - .expect("couldn't trace ComponentInfo"); - tracer - .trace_type::(&samples) - .expect("couldn't trace OverflowDirection"); - tracer - .trace_type::(&samples) - .expect("couldn't trace RenderMethod"); - tracer - .trace_type::(&samples) - .expect("couldn't trace StrokeCap"); - tracer - .trace_type::(&samples) - .expect("couldn't trace Mode"); - tracer - .trace_type::(&samples) - .expect("couldn't trace Collection"); - tracer - .trace_type::(&samples) - .expect("couldn't trace VariableType"); - tracer - .trace_type::(&samples) - .expect("couldn't trace FloatColor"); - tracer - .trace_type::(&samples) - .expect("couldn't trace NumOrVar"); - tracer - .trace_type::(&samples) - .expect("couldn't trace ColorOrVar"); - tracer - .trace_type::(&samples) - .expect("couldn't trace ColorOrVarType"); - tracer - .trace_type::(&samples) - .expect("couldn't trace VariableValue"); - tracer - .trace_type::(&samples) - .expect("couldn't trace variable_value::Value"); - tracer - .trace_type::(&samples) - .expect("couldn't trace Variable"); - tracer - .trace_type::(&samples) - .expect("couldn't trace VariableMap"); - tracer - .trace_type::(&samples) - .expect("couldn't trace ViewShape"); - tracer - .trace_type::(&samples) - .expect("couldn't trace Shape"); - tracer - .trace_type::(&samples) - .expect("couldn't trace ViewData"); - tracer - .trace_type::(&samples) - .expect("couldn't trace ViewDataType"); - tracer - .trace_type::(&samples) - .expect("couldn't trace StyledTextRuns"); - tracer - .trace_type::(&samples) - .expect("couldn't trace Container"); - tracer - .trace_type::(&samples) - .expect("couldn't trace Text"); - tracer.trace_type::(&samples).expect("couldn't trace View"); - tracer.trace_type::(&samples).expect("couldn't trace Layout"); - tracer - .trace_type::(&samples) - .expect("couldn't trace LayoutChangedResponse"); - tracer - .trace_type::(&samples) - .expect("couldn't trace LayoutNode"); - tracer - .trace_type::(&samples) - .expect("couldn't trace LayoutNodeList"); - tracer.trace_type::(&samples).expect("couldn't trace EncodedImageMap"); - tracer.trace_type::(&samples).expect("couldn't trace NodeQuery"); - tracer - .trace_type::(&samples) - .expect("couldn't trace SerializedDesignDocHeader"); - tracer - .trace_type::(&samples) - .expect("couldn't trace SerializedDesignDoc"); - tracer.trace_type::(&samples).expect("couldn't trace ServerFigmaDoc"); + // tracer.trace_type::(&samples).expect("couldn't trace EncodedImageMap"); + // tracer.trace_type::(&samples).expect("couldn't trace NodeQuery"); + // tracer.trace_type::(&samples).expect("couldn't trace ServerFigmaDoc"); tracer.trace_type::(&samples).expect("couldn't trace ConvertResponse"); - tracer - .trace_type::(&samples) - .expect("couldn't trace ItemSpacingType"); tracer.registry() }